Skip to content

feat: add targeted and JSON output to basectl workspace update #2105

Description

@codeforester

Context

The core basectl workspace update command is already implemented and was previously closed as completed. It currently:

  • walks manifest repositories in order;
  • runs git pull --ff-only for present repositories;
  • continues after individual failures;
  • skips missing optional repositories and treats missing required repositories as failures;
  • supports --dry-run;
  • reports planned, updated, unchanged, skipped, and failed results in text.

This issue is reopened for the remaining targeting and automation enhancements.

Goal

Add two complementary capabilities to basectl workspace update:

  1. select a subset of manifest repositories with --repos;
  2. emit the existing result model as machine-readable JSON with --format json.

Proposed interface

basectl workspace update
basectl workspace update --repos base,base-cli
basectl workspace update --repos base,base-cli --dry-run
basectl workspace update --format json
basectl workspace update --repos base,base-cli --format json

Requirements

--repos

  • Accept a comma-separated list of manifest repository names.
  • Update only the selected repositories.
  • Preserve manifest order in both text and JSON output.
  • Validate the selection before any Git operation:
    • reject empty names and names not present in the manifest;
    • reject duplicate names.
  • Keep the current all-repositories behavior when --repos is omitted.
  • Preserve the existing required/optional and containment safety behavior for selected repositories.

--format json

  • Keep text as the default output format.
  • Emit exactly one JSON document to stdout and diagnostics only to stderr.
  • Use a versioned document with schema_version: 1.
  • Include workspace and manifest metadata, whether this was a dry run, the selected repositories, per-repository results, and aggregate counts.
  • Per-repository records should expose the existing result semantics: repository name, path, required status, action, status, detail when available, and Git exit code when available.
  • Represent dry-run work as planned without invoking Git.
  • Preserve existing success/failure exit-code semantics.

Acceptance criteria

  • --repos <name[,name...]> filters updates without changing the default behavior.
  • Repository selection is validated before mutation and preserves manifest order.
  • --format json emits the documented versioned schema.
  • JSON output supports normal runs, dry runs, skipped repositories, and failures.
  • Text output remains backward-compatible.
  • Tests cover filtering, ordering, unknown/invalid selections, JSON schema and statuses, dry-run no-Git behavior, and aggregate exit codes.
  • Command help, command reference, workspace-manifest documentation, AI context, and stability-tier/schema documentation are updated.

Non-goals

  • Do not change the current git pull --ff-only strategy.
  • Do not add automatic rebase, force-reset, conflict recovery, or dirty-tree mutation behavior here.
  • Do not change manifest contents or clone missing repositories.

Those behaviors can be proposed separately if needed after this focused enhancement is shipped.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions