Skip to content
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

Add ability to create image from snapshot #1663

Merged
merged 7 commits into from
Jul 17, 2023
Merged

Conversation

zephraph
Copy link
Contributor

@zephraph zephraph commented Jul 15, 2023

Fixes #1456

This PR enables creating an image from a snapshot in the snapshots list page.

2023-07-16 19 14 56

Tasks

  • Create form for making new image from snapshot
  • Add edit action for creating an image on the snapshots table
  • Add end-to-end tests

Follow-up

There's some remaining work to be done here, but after thinking about it a bit I've decided to pull it out of this PR to contain the scope. When creating an image from the image list page instead of an action that says Upload image it should say New image (similarly to how projects, instances, etc are listed). We should then add an image source selector to mirror the API which should offer a choice between snapshot and upload.

image

(Note the designs show disk which isn't valid in this case)

@vercel
Copy link

vercel bot commented Jul 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Jul 17, 2023 5:56pm

@zephraph
Copy link
Contributor Author

There's a somewhat larger track of work here which is making the image creation form match the designs. Currently it's completely upload centric whereas the designs show being able to pick a source (upload, snapshot, and potentially URL). I haven't decided if I'm going to take that piece of work on or defer it for later.

@@ -313,6 +314,12 @@ export const routes = createRoutesFromElements(
element={<CreateSnapshotSideModalForm />}
handle={{ crumb: 'New snapshot' }}
/>
<Route
path="snapshots/:snapshot/image-new"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The path here is a little odd. I've patterned it after the other create endpoints though it doesn't necessarily need to be image-new. It could be something like create-image. There's really just no precedent for that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is the most reasonable choice.

@zephraph zephraph marked this pull request as ready for review July 16, 2023 23:16
@david-crespo david-crespo enabled auto-merge (squash) July 17, 2023 17:59
@david-crespo david-crespo merged commit b221098 into main Jul 17, 2023
6 checks passed
@david-crespo david-crespo deleted the image-from-snapshot branch July 17, 2023 18:04
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.

Create image from snapshot
2 participants