Title: Add Bitbucket PR comment support by obarrera · Pull Request #206 · SocketDev/socket-python-cli · GitHub
Open Graph Title: Add Bitbucket PR comment support by obarrera · Pull Request #206 · SocketDev/socket-python-cli
X Title: Add Bitbucket PR comment support by obarrera · Pull Request #206 · SocketDev/socket-python-cli
Description: Summary Adds socketsecurity/core/scm/bitbucket.py with BitbucketConfig + Bitbucket SCM that posts/updates Dependency Overview and Security Issue comments on Bitbucket Cloud PRs, mirroring the GitHub and GitLab modules. Reads BITBUCKET_* Pipelines env vars; supports Bearer (BITBUCKET_TOKEN) or Basic auth (BITBUCKET_USERNAME + BITBUCKET_APP_PASSWORD). BITBUCKET_API_URL lets Server/Data Center users point at a self-hosted REST API. Normalizes Bitbucket's {content: {raw}, user: {nickname, uuid}} payload onto the shared Comment dataclass so the existing Comments helpers, ignore-command flow, and security-comment scrubbing all work unchanged. Substitutes Bitbucket's missing reaction API with a hidden marker that has_thumbsup_reaction looks for on subsequent runs. Wires --scm bitbucket into socketcli.py and updates workflows/bitbucket-pipelines.yml to use it. Why The Bitbucket comment implementation was partially completed, but couldn't get the API to accept comments. Most likely culprit: GitHub-style {"body": "..."} form-encoded payloads, where Bitbucket Cloud requires JSON {"content": {"raw": "..."}} with Content-Type: application/json. This PR uses that shape. Out of scope Azure DevOps — left for a follow-up since it's a separate API surface. Live smoke test on a real Bitbucket workspace — a test instance still needs to be set up. Test plan uv run pytest tests/unit/test_bitbucket.py — 15 new tests covering env parsing (Bearer + Basic + missing creds), default-branch detection, event-type detection, comment normalization (raw content, deleted, missing fields), POST/PUT payload shape, and create-vs-update dispatch. uv run pytest tests/unit -q --no-cov — 164 passed, 2 pre-existing skips. End-to-end run against a Bitbucket Cloud PR on a workspace with BITBUCKET_TOKEN configured. End-to-end run with BITBUCKET_USERNAME / BITBUCKET_APP_PASSWORD to confirm Basic auth path. Verify ignore-comment flow: post @SocketSecurity ignore npm/foo@1.0.0, re-run, confirm alert filtered + hidden marker appended. (Optional) Bitbucket Server / Data Center run with BITBUCKET_API_URL override.
Open Graph Description: Summary Adds socketsecurity/core/scm/bitbucket.py with BitbucketConfig + Bitbucket SCM that posts/updates Dependency Overview and Security Issue comments on Bitbucket Cloud PRs, mirroring the GitH...
X Description: Summary Adds socketsecurity/core/scm/bitbucket.py with BitbucketConfig + Bitbucket SCM that posts/updates Dependency Overview and Security Issue comments on Bitbucket Cloud PRs, mirroring the GitH...
Opengraph URL: https://github.com/SocketDev/socket-python-cli/pull/206
X: @github
Domain: redirect.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4782e69e-f18a-637a-4cbb-d6459889a243 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 81D2:9E5FA:10C55C8:173CECF:6A4E9376 |
| html-safe-nonce | f93ac5cd68ae414505ee63fb130ede3e4bb903d7cb699190e238b7d286ad451e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUQyOjlFNUZBOjEwQzU1Qzg6MTczQ0VDRjo2QTRFOTM3NiIsInZpc2l0b3JfaWQiOiI1MzQ3MDg3NTQzNDUwODk5MzE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4580ae16d9306a7a139d4d8c32b4952370a8acf7e5800971b7e3711226d75927 |
| hovercard-subject-tag | pull_request:3763432919 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/SocketDev/socket-python-cli/pull/206/files |
| twitter:image | https://avatars.githubusercontent.com/u/1621370?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1621370?s=400&v=4 |
| og:image:alt | Summary Adds socketsecurity/core/scm/bitbucket.py with BitbucketConfig + Bitbucket SCM that posts/updates Dependency Overview and Security Issue comments on Bitbucket Cloud PRs, mirroring the GitH... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/SocketDev/socket-python-cli git https://github.com/SocketDev/socket-python-cli.git |
| octolytics-dimension-user_id | 69326764 |
| octolytics-dimension-user_login | SocketDev |
| octolytics-dimension-repository_id | 802230750 |
| octolytics-dimension-repository_nwo | SocketDev/socket-python-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 802230750 |
| octolytics-dimension-repository_network_root_nwo | SocketDev/socket-python-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width