diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d7b6d..e99b10b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.4.0] - 2026-05-04 + ### Added -- `[worktree]` config section with `shared_cache` and `cache_strategy` for - selective build cache sharing between worktrees. New worktrees can now reuse - `target/`, `node_modules/`, `.venv/`, etc. from the main repo via symlink - (default) or recursive copy, eliminating cold-build cost on `parsec start` - (#207). +- **Bitbucket Cloud forge** — full PR lifecycle support (create, list, view, + merge, comments). New tracker/forge entries `bitbucket` selectable via + `parsec config` and `[forge]` settings (#240). +- **Bitbucket Pipelines CI integration** — `parsec ci` and `pr-status` + commands now report Bitbucket Pipelines build state alongside GitHub + Actions and GitLab CI (#279). +- **`parsec compress` command** — squash a stack of related commits into a + single tidy commit before shipping, preserving co-author trailers (#236). +- **`parsec ship --template`** — auto-populate the PR description from a + repository's `.github/PULL_REQUEST_TEMPLATE.md` (or first match under + `.github/PULL_REQUEST_TEMPLATE/`) (#233). +- **`ship --reviewer` and `--label`** — attach reviewers and labels at PR + creation time (#261). +- **Stack `--submit`** — open all PRs in a stack in one command (#261). +- **Stack navigation comments** — auto-posted "← prev / next →" comments on + every PR in a stack so reviewers can walk the chain (#234). +- **`ship.draft` config + `--draft` flag** — open PRs as drafts by default + when working in throwaway / WIP branches (#238). +- **`[worktree]` shared build cache** — `shared_cache` and `cache_strategy` + settings let new worktrees reuse `target/`, `node_modules/`, `.venv/`, etc. + from the main repo via symlink (default) or recursive copy, eliminating + cold-build cost on `parsec start` (#207). +- **Offline mode toggle** — `[behavior].offline` config and per-command + `--no-pr` / `--no-tracker` flags so parsec can operate without forge or + tracker connectivity (#237). +- **Observability lite** — every command run now has an execution ID and + step timing; opt in to JSONL export via `[observability]` settings for + tooling/agents to consume (#166). +- **Config JSON Schema + `parsec schema`** — schema published to + schemastore.org so editors auto-complete `parsec.toml`. The new + `parsec schema` subcommand emits the schema on demand (#239). +- **Windows CI coverage** — full test matrix on Windows runners (#257). +- 11 new integration tests across forge adapters and worktree paths (#278). + +### Changed +- README and reference docs updated to cover ship `--reviewer` / `--label`, + stack `--submit`, Bitbucket adapter, offline flags, build cache config, + and `parsec compress` (#265). + +### Fixed +- Windows UNC path issue (`\\?\` prefix) breaking worktree operations on + Windows hosts — resolved via the `dunce` crate (#263). + +### CI +- Trigger CI on `release/**` branches in addition to feature branches and + develop, so release-prep work is exercised before merge (#277). ## [0.3.3] - 2026-04-22 diff --git a/Cargo.toml b/Cargo.toml index abb82b5..933c91f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-parsec" -version = "0.3.3" +version = "0.4.0" edition = "2021" authors = ["erishforG"] description = "Git worktree lifecycle manager — ticket to PR in one command. Parallel AI agent workflows with Jira & GitHub Issues integration." diff --git a/README.md b/README.md index 2f3500d..5c14cd0 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,15 @@ Removed 1 worktree(s): - **Release workflow** -- Merge, tag, and create GitHub Releases with `parsec release` - **PR reviewers and labels** -- Assign reviewers and labels on ship with `--reviewer`/`--label` or config defaults - **Stack submit** -- Ship an entire stack in topological order with `parsec stack --submit` -- **Cross-platform** -- Tested on Linux, macOS, and Windows CI +- **Stack navigation comments** -- Auto-posted "← prev / next →" comments on each PR in a stack +- **PR template auto-fill** -- `parsec ship --template` populates the PR description from `.github/PULL_REQUEST_TEMPLATE.md` +- **Compress branch history** -- `parsec compress` squashes a branch's commits into a single tidy commit before shipping +- **Bitbucket Cloud** -- Full PR lifecycle (create, list, view, merge, comments) and Bitbucket Pipelines CI status +- **Offline mode** -- Global `--offline` flag (and `[workspace].offline` config) skips all network operations (tracker, PR, fetch) so parsec keeps working without connectivity +- **Observability** -- Every command run gets an execution ID with per-step timing; `parsec log --export` emits JSONL for tooling and AI agents to consume +- **Config JSON Schema** -- `parsec config schema` outputs a JSON Schema (also published to schemastore.org) so editors auto-complete `config.toml` +- **Draft-by-default** -- `[ship].draft = true` config or `--draft` flag opens PRs as drafts for WIP work +- **Cross-platform** -- Tested on Linux, macOS, and Windows CI; UNC path handling on Windows --- @@ -327,6 +335,7 @@ $ parsec log | [`parsec new-issue`](#parsec-new-issue) | Create a new issue (alias with extra options) | | [`parsec release`](#parsec-release-version) | Merge, tag, and create a GitHub Release | | [`parsec rename`](#parsec-rename-ticket---new-ticket-id) | Re-ticket a workspace to a different ticket ID | +| [`parsec compress`](#parsec-compress-ticket--m-message) | Squash all branch commits into one | --- @@ -628,6 +637,7 @@ parsec log [ticket] [-n, --last N] |--------|-------------| | `[ticket]` | Filter to a specific ticket | | `-n, --last N` | Show last N entries (default: 20) | +| `--export` | Emit the log as JSONL (one JSON object per line). Each entry includes execution ID and per-step timing for observability/debugging | ```bash $ parsec log @@ -645,6 +655,11 @@ $ parsec log PROJ-1234 # Last 3 entries only $ parsec log --last 3 + +# Export as JSONL (for tooling / AI agents) +$ parsec log --export +{"execution_id":"01HQ3D8R2K8...","op":"start","ticket":"PROJ-1234","steps":[{"name":"fetch_title","ms":214},{"name":"create_worktree","ms":98}],"started_at":"2026-04-15T09:14:01Z","duration_ms":312} +{"execution_id":"01HQ3D9V7Z2...","op":"ship","ticket":"PROJ-1234","steps":[{"name":"push","ms":820},{"name":"create_pr","ms":1305},{"name":"cleanup","ms":42}],"started_at":"2026-04-15T14:02:18Z","duration_ms":2167} ``` --- @@ -1037,6 +1052,16 @@ $ parsec config completions zsh # Install man page $ sudo parsec config man + +# Output the JSON Schema for config.toml (also published to schemastore.org) +$ parsec config schema > parsec-schema.json +``` + +The JSON Schema is published to **schemastore.org** so editors with schemastore integration (VS Code, IntelliJ, Helix) auto-complete and validate `~/.config/parsec/config.toml` and per-repo `.parsec.toml` automatically. To pin the schema locally instead, add to your config: + +```toml +# ~/.config/parsec/config.toml +#:schema https://json.schemastore.org/parsec.json ``` --- @@ -1186,6 +1211,33 @@ $ parsec rename PROJ-100 --new PROJ-200 --json --- +### `parsec compress [ticket] [-m ]` + +Squash all of a branch's commits into a single tidy commit before shipping. The branch is reset to the merge-base with the base branch and the cumulative changes are re-committed as one. Co-author trailers from squashed commits are preserved. + +``` +parsec compress [ticket] [-m ] +``` + +| Option | Description | +|--------|-------------| +| `ticket` | Optional. Auto-detects the current worktree's ticket if omitted. | +| `-m, --message ` | Custom commit message. Default: combines all squashed commit messages. | + +```bash +# Compress the current worktree's branch +$ parsec compress +Compressed 7 commits into one on feature/PROJ-1234. + +# Compress a specific ticket with a custom message +$ parsec compress PROJ-1234 -m "feat: add user authentication" + +# Combine with ship +$ parsec compress && parsec ship +``` + +--- + ## Global Flags These flags work on every command: @@ -1193,6 +1245,7 @@ These flags work on every command: | Flag | Description | |------|-------------| | `--dry-run` | Preview what a command would do without making changes | +| `--offline` | Skip all network operations (tracker, PR, fetch). Also enabled by `[workspace].offline = true` in config | | `--json` | Machine-readable JSON output | | `-q, --quiet` | Suppress non-essential output | | `--repo ` | Target a different repository | @@ -1280,6 +1333,9 @@ Config file: `~/.config/parsec/config.toml` layout = "sibling" base_dir = ".parsec/workspaces" branch_prefix = "feature/" +# Skip all network operations (tracker, PR, fetch). Equivalent to passing +# --offline on every command. Useful for air-gapped / flight-mode dev. +offline = false [worktree] # Directories to share from the main repo into new worktrees so that @@ -1293,7 +1349,7 @@ shared_cache = ["target", "node_modules", ".venv"] cache_strategy = "symlink" [tracker] -# "jira" | "github" | "gitlab" | "none" +# "jira" | "github" | "gitlab" | "bitbucket" | "none" provider = "jira" [tracker.jira] @@ -1307,10 +1363,29 @@ base_url = "https://yourcompany.atlassian.net" base_url = "https://gitlab.com" # Auth: PARSEC_GITLAB_TOKEN env var +[tracker.bitbucket] +# workspace = "your-bitbucket-workspace" +# Auth: PARSEC_BITBUCKET_TOKEN (or BITBUCKET_TOKEN) env var +# api_base override: PARSEC_BITBUCKET_API_BASE env var + +[forge] +# Auto-detected from the remote URL when omitted. Override here if multiple +# forges are reachable (e.g., GitHub for PRs, Bitbucket Pipelines for CI). +# provider = "github" | "gitlab" | "bitbucket" + [ship] auto_pr = true # Create PR/MR on ship auto_cleanup = true # Remove worktree after ship -draft = false # Create PRs as drafts +draft = false # Open PRs as drafts by default +# template = ".github/PULL_REQUEST_TEMPLATE.md" # Auto-fill PR description +# default_reviewers = ["alice", "bob"] # Reviewers added on every ship +# default_labels = ["needs-review"] # Labels added on every ship + +[observability] +# Enable per-step timing in `parsec log --export` JSONL output. +# Each command run gets a unique execution ID; useful for tooling and AI +# agents to correlate parsec actions with downstream effects. +enabled = true [hooks] # Commands to run in new worktrees after creation @@ -1348,9 +1423,13 @@ pre_ship = ["cargo test", "cargo clippy"] | `GH_TOKEN` | Fallback GitHub token | | `PARSEC_GITLAB_TOKEN` | GitLab token for MR creation | | `GITLAB_TOKEN` | Fallback GitLab token | +| `PARSEC_BITBUCKET_TOKEN` | Bitbucket Cloud app password / access token | +| `BITBUCKET_TOKEN` | Fallback Bitbucket token | +| `PARSEC_BITBUCKET_API_BASE` | Override Bitbucket API base URL (test/mock servers) | | `PARSEC_JIRA_PROJECT` | Default Jira project key for `board` | | `PARSEC_JIRA_BOARD_ID` | Default Jira board ID for `board` | | `PARSEC_JIRA_ASSIGNEE` | Default assignee filter for `board` | +| `PARSEC_OFFLINE` | Set to `1` to force offline mode (same as `--offline`) | Token priority: `PARSEC_*_TOKEN` > platform-specific variables. @@ -1390,11 +1469,12 @@ $ echo $? | Feature | parsec | GitButler | worktrunk | git worktree | git-town | |---------|--------|-----------|-----------|--------------|----------| -| Ticket tracker integration | Jira + GitHub Issues | No | No | No | No | +| Ticket tracker integration | Jira + GitHub + GitLab + Bitbucket | No | No | No | No | | Physical isolation | Yes (worktrees) | No (virtual branches) | Yes (worktrees) | Yes | No | | Conflict detection | Cross-worktree | N/A | No | No | No | | One-step ship (push+PR+clean) | Yes | No | No | No | Yes | -| GitHub + GitLab | Both | Both | GitHub | No | GitHub, GitLab, Gitea, Bitbucket | +| Forges | GitHub + GitLab + Bitbucket | Both | GitHub | No | GitHub, GitLab, Gitea, Bitbucket | +| CI integrations | GitHub Actions + GitLab CI + Bitbucket Pipelines | No | No | No | No | | Operation history + undo | Yes | Yes | No | No | Yes (undo) | | JSON output | Yes | Yes | No | No | No | | CI monitoring | Yes (--watch) | No | No | No | No | diff --git a/docs/guide/index.html b/docs/guide/index.html index fb60ee0..6d18d77 100644 --- a/docs/guide/index.html +++ b/docs/guide/index.html @@ -1087,6 +1087,7 @@
  • AI Agent Workflows
  • Stacked PRs
  • New Features
  • +
  • What's New in v0.4
  • @@ -1428,7 +1429,7 @@

    Config file reference

    tracker.type Issue tracker backend. - "jira" / "github" / "gitlab" + "jira" / "github" / "gitlab" / "bitbucket" tracker.base_url @@ -1736,6 +1737,179 @@

    Pre-ship hooks

    + +
    +
    +

    What's New in v0.4

    + # +
    + +

    + v0.4 broadens forge support to Bitbucket Cloud, adds workflow utilities (compress, --template, stack navigation comments), and introduces operational primitives — offline mode, observability JSONL, and a published config schema — designed for tooling and AI agents. +

    + +

    Bitbucket Cloud — full PR lifecycle

    +

    + parsec now speaks Bitbucket Cloud's API: parsec ship opens PRs, parsec pr-status reports CI from Bitbucket Pipelines, parsec ci tails build status, and parsec merge merges from the terminal. Tracker integration uses the same tracker.bitbucket config block. +

    + +
    +
    +
    + Bitbucket setup +
    +
    +# Auth via env var +$ export PARSEC_BITBUCKET_TOKEN="<app-password>" +  +# Configure in ~/.config/parsec/config.toml +[tracker] +provider = "bitbucket" +[tracker.bitbucket] +workspace = "my-team" +  +$ parsec ship CL-2208 + PR opened: bitbucket.org/my-team/repo/pull-requests/142 + Bitbucket Pipelines: BUILD #318 in_progress +
    +
    + +

    Compress branch history with parsec compress

    +

    + Squash a branch's commits into one tidy commit before shipping. Co-author trailers from squashed commits are preserved automatically. +

    + +
    +
    +
    + parsec compress +
    +
    +# Squash all branch commits into one +$ parsec compress + Compressed 7 commits into one on feature/PROJ-123 +  +# With a custom message +$ parsec compress -m "feat: add user authentication" +  +# Compose: tidy history then ship +$ parsec compress && parsec ship +
    +
    + +

    Stack navigation comments

    +

    + When you ship a stacked PR, parsec auto-posts "← previous PR" / "next PR →" navigation comments on every PR in the stack. Reviewers can walk the chain without leaving the PR view. +

    + +

    PR template auto-fill — ship --template

    +

    + Use the repository's .github/PULL_REQUEST_TEMPLATE.md (or the first match under .github/PULL_REQUEST_TEMPLATE/) as the PR description automatically. Combine with ship.template in config.toml to make it the default. +

    + +
    +
    +
    + ship --template +
    +
    +$ parsec ship PROJ-123 --template +Loaded .github/PULL_REQUEST_TEMPLATE.md (348 chars) + PR opened with template body +
    +
    + +

    Offline mode — --offline / [workspace].offline

    +

    + Skip all network operations: tracker lookups, PR creation, fetches. Use a global --offline flag, the PARSEC_OFFLINE=1 env var, or set offline = true under [workspace] in config.toml. Per-command escapes (--no-pr, --no-tracker) remain available for finer control. +

    + +
    +
    +
    + offline mode +
    +
    +# Per-invocation +$ parsec start CL-2208 --offline --title "Add login retry" +  +# Persistent — flight mode +[workspace] +offline = true +
    +
    + +

    Observability — execution IDs + JSONL export

    +

    + Every command run gets a unique execution ID and per-step timing. parsec log --export emits one JSON object per line for tooling and AI agents to consume. Combined with --json on individual commands, parsec is fully introspectable. +

    + +
    +
    +
    + parsec log --export +
    +
    +$ parsec log --export | jq 'select(.duration_ms > 1000)' +{ + "execution_id": "01HQ3D9V7Z2...", + "op": "ship", + "ticket": "PROJ-123", + "steps": [ + {"name":"push","ms":820}, + {"name":"create_pr","ms":1305}, + {"name":"cleanup","ms":42} + ], + "duration_ms": 2167 +} +
    +
    + +

    Config JSON Schema — editor autocomplete

    +

    + The schema for config.toml is published to schemastore.org, so VS Code, IntelliJ, Helix, and any editor with schemastore integration auto-complete and validate every key. parsec config schema emits the schema for offline use. +

    + +
    +
    +
    + config schema +
    +
    +$ parsec config schema > parsec-schema.json +  +# Pin schema in your config for editor support +#:schema https://json.schemastore.org/parsec.json +
    +
    + +

    Worktree build cache sharing — [worktree].shared_cache

    +

    + New worktrees can reuse target/, node_modules/, .venv/, etc. from the main repo via symlink (default) or recursive copy. Eliminates cold-build cost on parsec start for any project with significant dependency caches. +

    + +
    +
    +
    + [worktree] config +
    +
    +[worktree] +shared_cache = ["target", "node_modules", ".venv"] +# "symlink" (default) — fast, zero-disk; parallel build of same artifact may race +# "copy" — independent caches per worktree, no race risk, more disk +cache_strategy = "symlink" +
    +
    + +

    Draft-by-default — ship.draft

    +

    + Set [ship].draft = true in config.toml to open every PR as a draft, or pass --draft per ship. Useful for iterative WIP review flows where you want CI feedback before requesting human review. +

    +
    + diff --git a/docs/index.html b/docs/index.html index 3773010..5beba37 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1960,6 +1960,66 @@

    Worktree Diff

    $ parsec diff --stat
    + + + + + +
    +
    + +
    +

    Compress Branch History

    +

    + New in v0.4. parsec compress squashes a branch's commits into one tidy commit before shipping, preserving co-author trailers. Optional --message for a custom commit subject. +

    +
    $ parsec compress -m "feat: add user authentication"
    +
    + + +
    +
    + +
    +

    Offline Mode

    +

    + New in v0.4. Global --offline flag (and [workspace].offline config) skips all network operations — tracker lookups, PR creation, fetches — so parsec keeps working on a plane, in CI without secrets, or in air-gapped environments. +

    +
    $ parsec start CL-2208 --offline --title "Add login retry"
    +
    + + + + + +
    +
    + +
    +

    Config JSON Schema

    +

    + New in v0.4. The config.toml JSON Schema is published to schemastore.org so VS Code, IntelliJ, and Helix auto-complete and validate every key. parsec config schema emits the schema for offline use. +

    +
    $ parsec config schema > parsec-schema.json
    +
    diff --git a/docs/reference/index.html b/docs/reference/index.html index 6da1f2f..7f35b48 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -984,6 +984,7 @@
  • create
  • new-issue
  • rename
  • +
  • compress
  • release
  • @@ -1065,6 +1066,7 @@

    Global Options — available on every command

    -q / --quiet suppress non-essential output
    --repo <PATH> target repository path
    --dry-run preview changes without executing
    +
    --offline skip all network ops (tracker, PR, fetch)
    @@ -1914,6 +1916,7 @@

    History

    --last <N>Show only the last N operations. + --exportEmit the log as JSONL (one JSON object per line). Each entry includes execution_id and per-step timing for observability/debugging by tooling and AI agents. @@ -1930,6 +1933,11 @@

    History

    2024-01-15 09:05 start PROJ-123 worktree created 2024-01-14 17:44 start PROJ-125 worktree created 2024-01-14 16:30 clean 3 worktrees removed +  +# JSONL export — one JSON object per line, with execution_id and per-step timing +$ parsec log --export +{"execution_id":"01HQ3D8R2K8...","op":"start","ticket":"PROJ-123","steps":[{"name":"fetch_title","ms":214},{"name":"create_worktree","ms":98}],"duration_ms":312} +{"execution_id":"01HQ3D9V7Z2...","op":"ship","ticket":"PROJ-123","steps":[{"name":"push","ms":820},{"name":"create_pr","ms":1305},{"name":"cleanup","ms":42}],"duration_ms":2167} @@ -2095,6 +2103,7 @@

    Setup

    showDisplay current configuration (redacts sensitive tokens). manOpen the parsec manual in your pager. completions <SHELL>Generate shell completion script for zsh, bash, or fish. + schemaOutput the JSON Schema for config.toml. The schema is also published to schemastore.org so editors auto-complete configuration files. shellDeprecated. Use parsec init <SHELL> instead. @@ -2118,6 +2127,9 @@

    Setup

      # Show current config $ parsec config show +  +# Output the JSON Schema (also at https://json.schemastore.org/parsec.json) +$ parsec config schema > parsec-schema.json @@ -2327,6 +2339,62 @@

    Setup

    + +
    +
    + compress + Squash all branch commits into one + # +
    +

    + Resets the branch to the merge-base with the base branch and re-commits all changes as a single commit. Co-author trailers from squashed commits are preserved. Useful before parsec ship to keep PR history tidy. +

    +
    + Usage + parsec compress [TICKET] [OPTIONS] +
    + +
    + + + + + + + +
    ArgumentDescription
    [TICKET]Optional. Auto-detects the current worktree's ticket if omitted.
    +
    + +
    + + + + + + + +
    OptionDescription
    -m, --message <TEXT>Custom commit message. Default: combines all squashed commit messages.
    +
    + +
    +
    +
    + parsec compress +
    +
    +# Compress current worktree's branch +$ parsec compress + Compressed 7 commits into one on feature/PROJ-1234 +  +# Compress with custom message +$ parsec compress PROJ-1234 -m "feat: add user authentication" +  +# Combine with ship +$ parsec compress && parsec ship +
    +
    +
    +