Skip to content

Archive old template versions #9478

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

Closed
matifali opened this issue Sep 1, 2023 · 5 comments · Fixed by #10179
Closed

Archive old template versions #9478

matifali opened this issue Sep 1, 2023 · 5 comments · Fixed by #10179
Assignees
Labels
cli Area: CLI

Comments

@matifali
Copy link
Member

matifali commented Sep 1, 2023

A user has requested to add the ability to delete or purge old versions of a template.

Motivation

Sometimes an old version of the template can be unusable due to many factors such as the docker image it refers doesn't exist anymore or have been renamed etc.

Solution

In such cases, when the old versions are practically unusable it's good to allow deleting them from the CLI and UI
e.g.,

coder templates version prune template_name

Originally requested in: #8307 (comment)

@matifali matifali added feature cli Area: CLI labels Sep 1, 2023
@MrPeacockNLB
Copy link
Contributor

I do not have counted all but it seems we have more than 200! For us it would be better to delete the template and create from scratch

@bpmct
Copy link
Member

bpmct commented Sep 1, 2023

Totally agree!

Must have

  • We have a CLI command to delete an old template version
    coder templates version delete my-version
  • We have a CLI command to delete all old template versions that are not promoted
    coder template version delete --all
  • If a workspace is on an old version, a version can not be deleted.

Should have

  • We document an example bash script to find and delete all template versions over 6 months old

Nice to have

  • There is some coder server flag for template retention policy (e.g. 6 months)

@sreya sreya changed the title Delete/purge old template versions Prune old template versions Oct 2, 2023
@Emyrk
Copy link
Member

Emyrk commented Oct 2, 2023

I can make this work like docker prune ...

@matifali
Copy link
Member Author

matifali commented Oct 2, 2023

This is also related to #9836, where failed versions can appear and even be promoted to default versions. IF we have this pruning, we may automatically prune those failed versions from the database.

@Emyrk
Copy link
Member

Emyrk commented Oct 2, 2023

I figure we should prune all unused versions that are not promoted. Should we have some mechanism to prevent pruning of some?

@Emyrk Emyrk changed the title Prune old template versions Archive old template versions Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Area: CLI
Projects
None yet
4 participants