Skip to content

feat: add minimal frontend for creating workspaces from specific template versions #9475

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
Sep 7, 2023

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Aug 31, 2023

Closes #9415
Closes #7157

This is super barebones, but I wanted to have some form of this working end-to-end before heading out for the long weekend, so here it is for people to look at!

  • Removes some patching that was holding us over while implementation continued
  • Adds a version search param to the "new workspace" page, which allows specifying the ID of a particular template version
  • Uses the new backend support from feat: create a workspace from any template version #9471 to create the workspace

This change does not yet expose a "version selector" of any kind to the user. We probably want to add that still, and it shouldn't be to hard, but this is a useful upgrade as is and I think building this out further incrementally will work just as well.

@bpmct
Copy link
Member

bpmct commented Aug 31, 2023

This is only available to template admins, right? A normal user cannot access "change version" so they shouldn't be able to create from a version.

@aslilac
Copy link
Member Author

aslilac commented Aug 31, 2023

This is only available to template admins, right? A normal user cannot access "change version" so they shouldn't be able to create from a version.

I haven't really looked into the permissions side of this at all yet. I forgot this week was a bit short, so I only had today to try to get something working.

@bpmct
Copy link
Member

bpmct commented Sep 5, 2023

What happens if parameters are required for the workspace?

@aslilac
Copy link
Member Author

aslilac commented Sep 5, 2023

What happens if parameters are required for the workspace?

I didn't actually test it yet, but from looking at the code "auto build" should fail and redirect to the normal workspace creation form

@bpmct
Copy link
Member

bpmct commented Sep 5, 2023

normal workspace creation form

Gotcha. And in that case, it won't persist the version it wants to use, right?

@aslilac
Copy link
Member Author

aslilac commented Sep 5, 2023

normal workspace creation form

Gotcha. And in that case, it won't persist the version it wants to use, right?

It will! The parameter isn't exposed in the UI, but the state machine will remember it!

Redirect is probably the wrong word to use. When you click "Create a workspace" it opens the workspace creation form in "auto" mode. If the workspace doesn't need parameters, it will just create a workspace with a random name and send you straight into it. If it needs parameters it will display the form and let you fill it out, and then send you to the new workspace. Either route will use the version you just created.

@bpmct
Copy link
Member

bpmct commented Sep 5, 2023

Ahh gotcha! I think we should probably show a `lil component that, even if not changeable, shows that we are respecting that version from the state machine. If it's not in the machine (and its using the default), we just hide that component in the form. I think its good visual feedback that the user is on the right track and Coder didn't bug out.

@aslilac
Copy link
Member Author

aslilac commented Sep 5, 2023

good point! that sounds like a nice improvement.

@aslilac
Copy link
Member Author

aslilac commented Sep 5, 2023

Screenshot 2023-09-05 at 4 12 15 PM

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

LGTM

@BrunoQuaresma
Copy link
Collaborator

Minor thing: Should we display the version name instead of the ID? I think most of the users will not care about or recognize the ID.

@aslilac
Copy link
Member Author

aslilac commented Sep 6, 2023

Minor thing: Should we display the version name instead of the ID? I think most of the users will not care about or recognize the ID.

long term yes, but the only information the page has available to it right now is the id. once we actually load version information and have the names available, we should display those instead.

@aslilac
Copy link
Member Author

aslilac commented Sep 6, 2023

this is ready to merge, but this test failure is unrelated to my changes and the tests seem to be failing pretty consistently :\

@aslilac aslilac merged commit 4f142fa into main Sep 7, 2023
@aslilac aslilac deleted the minimal-9415 branch September 7, 2023 16:33
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow template admins to create a workspace from any version template editor: better way to test "WIP" templates
3 participants