Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement basic templates versions CLI #3145

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

Merged
merged 8 commits into from
Jul 26, 2022

Conversation

AbhineetJain
Copy link
Contributor

@AbhineetJain AbhineetJain commented Jul 23, 2022

This PR implements the templates versions CLI command.

Subcommand implemented: list - List all the versions of the specified template.

Only displays the columns: "Name", "Created At", "Created By", "Status" and an "Active" tag for the active version.

Currently, the versions are displayed in chronological order (oldest to latest).

Subtasks

  • implement templates versions list command
  • add unit tests
  • add missing description for templates list
  • add unit test for templates list

Makes progress towards completing #1425
Closes #3041

Screenshot

Screen Shot 2022-07-25 at 7 38 20 PM

@AbhineetJain AbhineetJain requested a review from a team July 25, 2022 18:00
@Emyrk
Copy link
Member

Emyrk commented Jul 25, 2022

I have not read the code yet, but when you update a template with params, we actually upload 2 template versions. One has a failed job.

Is it possible that we also include a column for "active" template version, and also if it succeeded? So look into the Job field to show which versions are even usable?

@AbhineetJain
Copy link
Contributor Author

I have not read the code yet, but when you update a template with params, we actually upload 2 template versions. One has a failed job.

Is it possible that we also include a column for "active" template version, and also if it succeeded? So look into the Job field to show which versions are even usable?

I like the idea of showing the active version. For the failed versions, should we just not show them in the list? We can do so on the UI too.

@AbhineetJain
Copy link
Contributor Author

@Emyrk I have added a Status column for now, and an Active tag for the active version.

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

Comment on lines +21 to +26
Example: formatExamples(
example{
Description: "List versions of a specific template",
Command: "coder templates versions list my-template",
},
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should example be on the list subcommand? Probably ok in both spots?

@AbhineetJain AbhineetJain merged commit b1e0d69 into main Jul 26, 2022
@AbhineetJain AbhineetJain deleted the abhineetjain/template-versions branch July 26, 2022 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Templates help: missing description for coder templates list -h and coder template versions -h
3 participants