-
Notifications
You must be signed in to change notification settings - Fork 937
feat: implement feature to support template version while creating workspace using cli #14880
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
…creating workspace using cli
version, err := client.TemplateVersionByName(inv.Context(), template.ID, templateVersion) | ||
if err != nil { | ||
return xerrors.Errorf("get template version by name: %w", err) | ||
} | ||
templateVersionID = version.ID |
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.
This unfortunately does not accept the template version uuid. It would be better if the name or uuid worked.
We should fix this in the route handler imo: https://github.com/coder/coder/blob/main/coderd/templateversions.go#L885-L885
Not needed in this PR.
version2 := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, completeWithAgent(), func(ctvr *codersdk.CreateTemplateVersionRequest) { | ||
ctvr.TemplateID = template.ID | ||
}) |
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.
Add coderdtest.AwaitTemplateVersionJobCompleted(t, client, version2.ID)
after creating the version. Otherwise we get a race condition in some tests.
version2 := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, completeWithAgent(), func(ctvr *codersdk.CreateTemplateVersionRequest) { | |
ctvr.TemplateID = template.ID | |
}) | |
version2 := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, completeWithAgent(), func(ctvr *codersdk.CreateTemplateVersionRequest) { | |
ctvr.TemplateID = template.ID | |
}) | |
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version2.ID) |
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.
got it, I've updated the test
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.
When tests are passing, I will approve and merge 👍
@Emyrk the tests are passing, can we merge this ? |
This PR closes #14860