Skip to content

docs(examples): add Bitbucket Pipelines CI integration example#483

Merged
lizhengfeng101 merged 1 commit into
alibaba:mainfrom
abdulm5:docs/bitbucket-pipelines-example
Jul 24, 2026
Merged

docs(examples): add Bitbucket Pipelines CI integration example#483
lizhengfeng101 merged 1 commit into
alibaba:mainfrom
abdulm5:docs/bitbucket-pipelines-example

Conversation

@abdulm5

@abdulm5 abdulm5 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a Bitbucket Pipelines example that runs OCR when pull requests are created or updated
  • configure OCR from repository variables and review the destination-to-source diff
  • post inline findings, fallback comments, and a summary through the Bitbucket Pull Request Comments API
  • document repository variables, token scopes, setup, customization, security considerations, and troubleshooting
  • add the Bitbucket example to examples/README.md

Closes #469

Validation

  • parsed bitbucket-pipelines.yml successfully
  • validated pipeline structure and shell syntax
  • syntax-checked the embedded Node.js posting script
  • tested Bearer and Basic API-token authentication with mocked Bitbucket responses
  • tested inline comments, multiline positions, general-comment fallback, and no-findings summaries
  • verified local Markdown links
  • ran git diff --check

Notes

  • documentation and configuration only; no Go code changed
  • repository access tokens are the recommended authentication method
  • App Passwords are documented as retired because Bitbucket disabled them on June 9, 2026

@CLAassistant

CLAassistant commented Jul 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: No comments generated. Looks good to me.

@lizhengfeng101
lizhengfeng101 marked this pull request as ready for review July 24, 2026 00:25

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Notes

Overall this is a high-quality documentation PR — no blocking issues. The following are optional suggestions for future improvement:

1. || true swallows OCR stderr

ocr review ... > /tmp/ocr-result.json || true

The empty-file check and JSON validation downstream handle the failure case, but OCR's stderr (which may contain useful diagnostics) is lost. Consider redirecting stderr to a log or printing it before the exit.

2. No rate-limiting between API calls

The Node.js script posts comments sequentially with no delay. For PRs with many findings, this could hit Bitbucket's rate limits (1000 requests/hour for most tokens). Consider documenting this limitation or adding a small delay for large result sets.

3. Code fence missing language identifier

function codeFence(value, language = "") {

The language parameter is always empty. Inferring the language from comment.path's file extension would improve syntax highlighting in suggestion blocks.

4. response.json() after postComment is unguarded

If Bitbucket returns 201 with malformed JSON, the unhandled parse error would crash the script. Low probability but easy to guard.

5. 200-comment limit not enforced

The README documents Bitbucket's 200-comment limit but the script doesn't cap output. A future improvement could stop posting near the limit and note the overflow in the summary.


None of the above are merge-blocking. Nice work! 👍

@lizhengfeng101 lizhengfeng101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lizhengfeng101
lizhengfeng101 merged commit 6639298 into alibaba:main Jul 24, 2026
8 checks passed
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.

docs(examples): add Bitbucket Pipelines CI integration example

3 participants