Skip to content

docs: add Bitbucket Pipelines CI example and documentation - #199

Merged
vsn411 merged 2 commits into
secfoo-com:mainfrom
Labu1:repodestek/issue-172
Nov 26, 2026
Merged

vsn411 merged 2 commits into
secfoo-com:mainfrom
Labu1:repodestek/issue-172

Conversation

@Labu1

@Labu1 Labu1 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Closes #172

What does this change, and why?

docs/CI.md had copy-paste setups for GitHub Actions, GitLab, pre-commit and Jenkins, but Bitbucket Pipelines users only got the generic "Anything else" snippet (part of #110).

  • New examples/ci/bitbucket-pipelines.yml, modelled on examples/ci/gitlab-ci.yml: a python:3.12-slim image, pip install secfoo (plus git), secfoo run --agent api ... --fail-on high --max-cost 2.00 --project-name "$BITBUCKET_REPO_FULL_NAME", then SARIF and JSONL export. secfoo-result.json, secfoo.sarif and secfoo-findings.jsonl are kept as step artifacts. One YAML-anchored step is used by a pull-requests: '**' pipeline and by branches: main (commented as the default branch).
  • The exit code of secfoo run is saved, so both exports always run before the step fails with that code. Everything is in a single script block, as in the Jenkins example.
  • New ## Bitbucket Pipelines section in docs/CI.md after GitLab CI. It says where to add the provider key (Repository settings → Pipelines → Repository variables, with Secured ticked, or a workspace variable), what exit codes 0/1/2/3 mean, and where to find the artifacts.

Not done yet: the issue asks for one real run on a free Bitbucket workspace (--depth quick --max-cost 0.50), shown by a link or a screenshot with the uploaded secfoo.sarif. I could not do that run from this environment. One still needs to be done and attached before merge.

Testing

Ran pytest in a clean Linux container: the 4 remaining failure(s) also occur on the base branch without this change; no new failures are introduced.

  • pytest tests passes
  • ruff check . passes
  • Added/updated tests for the behavior change

This PR was prepared with AI assistance (Claude) and reviewed by me before submitting.

docs/CI.md had copy-paste setups for GitHub Actions, GitLab, pre-commit
and Jenkins, but Bitbucket Pipelines users only got the generic
"Anything else" snippet.

Add examples/ci/bitbucket-pipelines.yml, modelled on the GitLab job: a
python:3.12-slim image, pip install secfoo, secfoo run --agent api with
--fail-on high --max-cost 2.00, SARIF and JSONL export, and all three
files kept as step artifacts. One shared step runs in a pull-request
pipeline and on the main branch. A new "Bitbucket Pipelines" section
after GitLab CI explains where to set the secured OPENAI_API_KEY
variable and what the exit codes mean.

Fixes secfoo-com#172.
@Labu1
Labu1 requested a review from vsn411 as a code owner November 26, 2026 08:02
@vsn411

vsn411 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks, and welcome! This is a clean example and it follows the GitLab one closely. Saving the exit code so both exports still run is exactly right.

Don't worry about the real Bitbucket run the issue mentions. We'll merge the example without it and track the verification run separately. CI for first-time contributors waits for a maintainer to approve it, and we'll merge once it's green.

@vsn411
vsn411 merged commit 8c8930e into secfoo-com:main Nov 26, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown

Leaderboard update

Labu1 now has 6 points (rank #11). 19 more to reach Bronze.

Full leaderboard

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.

CI example: Bitbucket Pipelines (examples/ci + docs/CI.md)

2 participants