Skip to content

SQ-816: divbase-cli version update subcommand#71

Open
RMCrean wants to merge 9 commits intomainfrom
version-cli-subcommand-updates
Open

SQ-816: divbase-cli version update subcommand#71
RMCrean wants to merge 9 commits intomainfrom
version-cli-subcommand-updates

Conversation

@RMCrean
Copy link
Member

@RMCrean RMCrean commented Feb 24, 2026

Relatively simple change to add ability to modify the name and/or description of existing project versions in divbase.

PR covers:

  • API + CLI changes needed to do this.
  • Docs updated to include this
  • e2e tests on this new subcommand.

As we discussed a while ago (and as written in the docs):

!!! Info "Only the name and the description can be modified"
The files and timestamp associated with a version entry are immutable and cannot be changed.
This is by design to ensure version entries are representations of the project's state at the timepoint they were created at.
If you need to capture a new state, create a new version instead with divbase-cli version add.

Will take a review from copilot first.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements a new version update subcommand for the divbase-cli tool, allowing users to modify the name and/or description of existing project versions. The PR also refactors command names to use Unix-style short forms (ls and rm instead of list and delete), aligning with existing conventions in the file CLI.

Changes:

  • Added version update subcommand with support for updating version names and descriptions
  • Renamed version CLI commands from list/delete to ls/rm for consistency
  • Improved error messages for better clarity and consistency across version operations

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/e2e_integration/cli_commands/test_version_cli.py Updated all tests to use new command names (ls, rm) and added comprehensive e2e tests for the update functionality including edge cases
packages/divbase-lib/src/divbase_lib/api_schemas/project_versions.py Added UpdateVersionRequest and UpdateVersionResponse schema models for the update API endpoint
packages/divbase-cli/src/divbase_cli/services/project_versions.py Implemented update_version_command service function to handle API communication for updates
packages/divbase-cli/src/divbase_cli/cli_commands/version_cli.py Added update command, renamed list to ls and delete to rm, with proper validation and user feedback
packages/divbase-api/src/divbase_api/routes/project_versions.py Added PATCH /update endpoint with proper authorization checks for EDIT role
packages/divbase-api/src/divbase_api/crud/project_versions.py Implemented update_project_version function with database operations, error handling, and improved error messages
docs/user-guides/project-versioning.md Added comprehensive documentation for the update subcommand with examples and usage notes
docs/cli/_auto_generated/version.md Updated auto-generated CLI documentation to reflect new command names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RMCrean RMCrean marked this pull request as ready for review February 24, 2026 15:32
@RMCrean RMCrean requested a review from a team as a code owner February 24, 2026 15:32
@RMCrean
Copy link
Member Author

RMCrean commented Feb 24, 2026

@brinkdp , this one is ready for review, I feel happy with the changes so feel free to skim it or give a LGTM if you prefer

Copy link
Contributor

@brinkdp brinkdp left a comment

Choose a reason for hiding this comment

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

Clear and clean implementation and useful functionality to have. Thanks for harmonising the subcommands (ls, rm). That's a small change that makes a big impact on UX.

LGTM!

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.

3 participants