Skip to content

feat: wire Bitbucket Pipelines into parsec ci + fill pr-status CI/review fields #279

@erishforG

Description

@erishforG

Background

Follow-up to #240 (Bitbucket Cloud forge support, implemented in #276). The core forge integration is in place, but two gaps remain that were part of the #240 spec:

Gap 1: `parsec ci` does not dispatch to Bitbucket

`src/cli/commands/ci.rs` currently only handles GitHub. Bitbucket Pipelines users invoking `parsec ci ` get GitHub-flavored errors or no data even though `src/bitbucket/mod.rs` already exposes `PipelineStatus` and the underlying API client.

Acceptance:

  • `parsec ci ` detects a Bitbucket remote and calls the Bitbucket Pipelines API (mirroring how `parsec ship` and `parsec pr-status` already branch on remote type).
  • `--watch` mode also works against Bitbucket (poll Pipelines).
  • Output format aligns with the existing GitHub CI output (state, latest run URL, success/failure summary).

Gap 2: `parsec pr-status` Bitbucket path returns hardcoded "unknown" for CI/review

`src/cli/commands/pr.rs` ~lines 175-176 maps Bitbucket PR status into the GitHub-shaped `PrStatus` struct but hardcodes:
```rust
ci_status: "unknown".to_string(),
review_status: "unknown".to_string(),
```

So `parsec pr-status` shows the PR exists but never tells you whether CI passed or whether reviewers approved.

Acceptance:

  • Pull CI status from Pipelines API (latest pipeline for the PR's source branch / commit).
  • Pull review status from Bitbucket PR participants endpoint (approved / changes_requested / pending).
  • Map both to the same string vocabulary the GitHub path uses.

Test coverage

  • Unit tests for the Bitbucket Pipelines mapping (success / failure / running / not_found).
  • Integration test (mocked HTTP) for `parsec ci` against a Bitbucket remote.
  • Integration test for `parsec pr-status` returning real CI/review fields.

Notes

  • Reuse the existing `BitbucketClient` in `src/bitbucket/mod.rs` — `PipelineStatus` types are already defined there.
  • Keep behaviour unchanged for GitHub repos.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions