feat: archive template versions to hide them from the ui (#10179)

* api + cli implementation
This commit is contained in:
Steven Masley
2023-10-11 09:26:22 -05:00
committed by GitHub
parent edbd51955c
commit 1e950fa9a8
35 changed files with 1472 additions and 38 deletions

View File

@ -670,6 +670,7 @@ func New(options *Options) *API {
r.Delete("/", api.deleteTemplate)
r.Patch("/", api.patchTemplateMeta)
r.Route("/versions", func(r chi.Router) {
r.Post("/archive", api.postArchiveTemplateVersions)
r.Get("/", api.templateVersionsByTemplate)
r.Patch("/", api.patchActiveTemplateVersion)
r.Get("/{templateversionname}", api.templateVersionByName)
@ -683,6 +684,8 @@ func New(options *Options) *API {
r.Get("/", api.templateVersion)
r.Patch("/", api.patchTemplateVersion)
r.Patch("/cancel", api.patchCancelTemplateVersion)
r.Post("/archive", api.postArchiveTemplateVersion())
r.Post("/unarchive", api.postUnarchiveTemplateVersion())
// Old agents may expect a non-error response from /schema and /parameters endpoints.
// The idea is to return an empty [], so that the coder CLI won't get blocked accidentally.
r.Get("/schema", templateVersionSchemaDeprecated)