feat: add --name and --description flags to commit create#183
Open
AlephNotation wants to merge 2 commits intomainfrom
Open
feat: add --name and --description flags to commit create#183AlephNotation wants to merge 2 commits intomainfrom
commit create#183AlephNotation wants to merge 2 commits intomainfrom
Conversation
Add --name/-n and --description/-d flags to 'vers commit create' so commits can be given human-readable names instead of the auto-generated 'commit: of_vm=<uuid> timestamp=<ts>' format. After creating the commit, if name or description is provided, a follow-up PATCH call is made to update the commit metadata. If the update fails, the error is returned but the commit ID is still available. Note: The API currently ignores name/description on the PATCH endpoint (see #177). The CLI is ready and will work end-to-end once the API supports it. Closes #177
Instead of a follow-up PATCH call, send name and description in the
POST /vm/{id}/commit request body using WithJSONSet. This is simpler,
atomic, and avoids the race window where a commit exists briefly
without its metadata.
Requires the companion chelsea change that accepts name/description
on the commit endpoint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--name/-nand--description/-dflags tovers commit createso commits can be given human-readable names instead of the auto-generatedcommit: of_vm=<uuid> timestamp=<ts>format.Closes #177
Requires: hdresearch/chelsea#1070 (API support for name/description on commit)
Usage
Implementation
Name and description are sent directly in the
POST /vm/{id}/commitrequest body viaoption.WithJSONSet. This is atomic — no follow-up PATCH call needed.Changes
cmd/commit.go— Added--name/-nand--description/-dflags, updated help text and output formattinginternal/handlers/commit_create.go— Extended request/view with Name/Description, sends them in commit request bodyinternal/handlers/commit_create_test.go— 3 test cases: name+description, no name, name onlyTests
All unit tests pass: