-
Notifications
You must be signed in to change notification settings - Fork 58
feat: add coder_parameter_order to all data.coder_parameter fields #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
type = number | ||
description = "The order determines the position of the 'username' template parameter in the UI/CLI presentation. The lowest order is shown first and parameters with equal order are sorted by name (ascending order)." | ||
default = null | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be feasible to just use one coder_parameter_order
for all parameters? If someone wants to change these individually, then there may be something wrong with the module or how it's being used.
Why? This makes modules updates more risky. If we ever add a third parameter, it could end up anywhere when the user updates.
Perhaps we can still apply order if it's given, e.g. order = var.coder_parameter_order ? var.coder_parameter_order + 0 : null
, + 1
, etc.
An author can reserve as much ordered space for a module as they wish.
module "git-config" {
source = "registry.coder.com/modules/git-config/coder"
version = "1.0.11"
agent_id = coder_agent.example.id
allow_email_change = true
coder_parameter_order = 10
}
module "gcp_region" {
source = "registry.coder.com/modules/gcp-region/coder"
version = "1.0.11"
regions = ["us", "europe"]
coder_parameter_order = 20
}
To clarify this, maybe we could name it something like coder_parameter_group_order
or coder_parameter_order_weight
, I'm open to better ideas 😄.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, i can keep it all the same field name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mafredri - i have updated the code and tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks for the PR!
Add
coder_parameter_order
variable to modules that have a data coder_parameterExamples
related to #207