- Notifications
You must be signed in to change notification settings - Fork928
feat: add support for template version messages in api and cli#8336
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
77dbe0b
f40bcc7
a2aedfd
ffb7f3f
98377ad
960e5d1
7cd20bb
93de18a
5bee51f
9280af6
b8e36f6
9945e94
3329d5b
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -477,6 +477,7 @@ func TemplateVersion(t testing.TB, db database.Store, orig database.TemplateVers | ||
CreatedAt: takeFirst(orig.CreatedAt, database.Now()), | ||
UpdatedAt: takeFirst(orig.UpdatedAt, database.Now()), | ||
Name: takeFirst(orig.Name, namesgenerator.GetRandomName(1)), | ||
Message: orig.Message, | ||
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. nit: what about testing? do we need a random message generated for unit tests or maybe benchmarks in the future? 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. It's a valid concern, although I didn't do it because I'm sure how we'd set an empty message if we use 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. @mafredri the empty | ||
Readme: takeFirst(orig.Readme, namesgenerator.GetRandomName(1)), | ||
JobID: takeFirst(orig.JobID, uuid.New()), | ||
CreatedBy: takeFirst(orig.CreatedBy, uuid.New()), | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1306,6 +1306,7 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht | ||
CreatedAt: database.Now(), | ||
UpdatedAt: database.Now(), | ||
Name: req.Name, | ||
Message: req.Message, | ||
mafredri marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Readme: "", | ||
JobID: provisionerJob.ID, | ||
CreatedBy: apiKey.UserID, | ||
@@ -1420,6 +1421,7 @@ func convertTemplateVersion(version database.TemplateVersion, job codersdk.Provi | ||
CreatedAt: version.CreatedAt, | ||
UpdatedAt: version.UpdatedAt, | ||
Name: version.Name, | ||
Message: version.Message, | ||
Job: job, | ||
Readme: version.Readme, | ||
CreatedBy: createdBy, | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -42,7 +42,8 @@ type OrganizationMember struct { | ||
// CreateTemplateVersionRequest enables callers to create a new Template Version. | ||
type CreateTemplateVersionRequest struct { | ||
Name string `json:"name,omitempty" validate:"omitempty,template_version_name"` | ||
Message string `json:"message,omitempty"` | ||
mafredri marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
// TemplateID optionally associates a version with a template. | ||
TemplateID uuid.UUID `json:"template_id,omitempty" format:"uuid"` | ||
StorageMethod ProvisionerStorageMethod `json:"storage_method" validate:"oneof=file,required" enums:"file"` | ||