Skip to content

Replace var.name with a pretty name #4073

Closed

Description

@matifali

image

Activity

  1. BrunoQuaresma commented on Sep 15, 2022

    @BrunoQuaresma
    Contributor

    @matifali what a pretty name should be?

  2. matifali commented on Sep 15, 2022

    @matifali
    ContributorAuthor

    For example
    var.ram can be Total RAM
    var.cpu can be CPU Cores
    var.docker_image Docker Image

  3. BrunoQuaresma commented on Sep 15, 2022

    @BrunoQuaresma
    Contributor

    Since these var names are dynamic and came from terraform I don't see how we could use better names 🤔 Any ideas?

  4. matifali commented on Sep 15, 2022

    @matifali
    ContributorAuthor

    Yes I understand why it can't be done. Terraform HCL does not provide any field to be used for pretty ne. We can't use description as it's longer.
    May be a data in coder provider can be used to create a title for every variable.

  5. BrunoQuaresma commented on Sep 16, 2022

    @BrunoQuaresma
    Contributor

    cc.: @bpmct

  6. bpmct commented on Sep 16, 2022

    @bpmct
    Member

    We have a plan to replace variable with a coder_parameter data source. The scheme is TBD but it would allow us to have friendly names, validate on the frontend, and mark specific variables as immutable. related: #802

    For example,

    data "coder_parameter" "cpu" {
      friendly_name = "CPU Cores"
      description = "Lorem ipsum"
      immutable = false
    }
    
    resource "some_resource" "dev" {
       cpu = data.cpu.value
    }

    Legacy variables would be supported, but wouldn't show up as pretty in the dashboard

    There are other ways we could do it without that (e.g. mapping common terms in the backend, replacing underscores with spaces), but I think we should wait until we have more controls with coder_parameter :).

  7. bpmct commented on Sep 16, 2022

    @bpmct
    Member

    We should keep this issue open until there is a way to do that, though :)

  8. self-assigned this
    on Sep 24, 2022
  9. github-actions commented on Nov 24, 2022

    @github-actions
    Contributor

    This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

  10. BrunoQuaresma commented on Nov 24, 2022

    @BrunoQuaresma
    Contributor

    This is done in the latest version

  11. added and removed
    staleThis issue is like stale bread.
    on Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions