-
Notifications
You must be signed in to change notification settings - Fork 878
feat!: extract provisioner tags from coder_workspace_tags data source #15578
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
Changes from 1 commit
944eb3a
7bc2fc8
4653638
fc8ff56
85c2c8f
2e9526b
01c8e99
5a53d86
c1e321d
ed534bd
42f39a7
c6f33f7
b22e890
a8a620f
8ec672c
7b7aa40
80dc6c2
5631577
58fae97
90991bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,22 @@ type ProvisionerDaemon struct { | |
Tags map[string]string `json:"tags"` | ||
} | ||
|
||
// MatchedProvisioners represents the number of provisioner daemons | ||
// available to take a job at a specific point in time. | ||
type MatchedProvisioners struct { | ||
// Count is the number of provisioner daemons that matched the given | ||
// tags. If the count is 0, it means no provisioner daemons matched the | ||
// requested tags. | ||
Count int `json:"count"` | ||
// Available is the number of provisioner daemons that are available to | ||
// take jobs. This may be less than the count if some provisioners are | ||
// busy or have been stopped. | ||
Available int `json:"available"` | ||
// MostRecentlySeen is the most recently seen time of the set of matched | ||
// provisioners. If no provisioners matched, this field will be null. | ||
MostRecentlySeen NullTime `json:"most_recently_seen,omitempty" format:"date-time"` | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
|
||
// ProvisionerJobStatus represents the at-time state of a job. | ||
type ProvisionerJobStatus string | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,8 @@ type TemplateVersion struct { | |
CreatedBy MinimalUser `json:"created_by"` | ||
Archived bool `json:"archived"` | ||
|
||
Warnings []TemplateVersionWarning `json:"warnings,omitempty" enums:"DEPRECATED_PARAMETERS"` | ||
Warnings []TemplateVersionWarning `json:"warnings,omitempty" enums:"DEPRECATED_PARAMETERS"` | ||
MatchedProvisioners MatchedProvisioners `json:"matched_provisioners,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. review: I considered adding as a field on the However, as it does not make sense to return this from e.g. getting a previous template version, it may make sense instead to make this nullable (e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I could see last week, the only way to see tags for a workspace build is to get that workspace's template version. Therefore, I think we need this even for previous template versions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looked at where else we use this payload. You're right, it isn't necessary elsewhere. That means we could make it nullable. Whether that would be better for API clients, I'm not sure. Would be happy if you made it nullable. Would be happy if you left it as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll keep it as-is for now so you can build on top of it. It should be a fairly simple refactor to make it a nullable field later. |
||
} | ||
|
||
type TemplateVersionExternalAuth struct { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
review: this is duplicated from / in line with
coderd/healthcheck
: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.
Do we need the above as a code comment or perhaps a test that checks that they remain in sync?
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.
I'm not sure of the value of adding a test for this, but we can possibly refactor where it's defined in a follow-up so that it's consistent. For now, I'll add a comment 👍
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.
On the surface it kinda makes sense to use the same logic (3*poll), but at the same time I feel multiplying by 3 is pretty extreme, I'm more in favor of a fixed time like poll+30s or something like that. In this instance poll+30s would surface the issue in half the time. If poll is ever raised, to say 2min, the multiplication would go from 1.5min to 3.5min longer to surface the issue, etc.