Repository navigation
docs: add Bitbucket Pipelines CI example and documentation - #199
Merged
Merged
Conversation
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.
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. |
Leaderboard update
Labu1 now has 6 points (rank #11). 19 more to reach Bronze. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #172
What does this change, and why?
docs/CI.mdhad 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).examples/ci/bitbucket-pipelines.yml, modelled onexamples/ci/gitlab-ci.yml: apython:3.12-slimimage,pip install secfoo(plusgit),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.sarifandsecfoo-findings.jsonlare kept as step artifacts. One YAML-anchored step is used by apull-requests: '**'pipeline and bybranches: main(commented as the default branch).secfoo runis 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.## Bitbucket Pipelinessection indocs/CI.mdafter 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 uploadedsecfoo.sarif. I could not do that run from this environment. One still needs to be done and attached before merge.Testing
Ran
pytestin a clean Linux container: the 4 remaining failure(s) also occur on the base branch without this change; no new failures are introduced.pytest testspassesruff check .passesThis PR was prepared with AI assistance (Claude) and reviewed by me before submitting.