Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions examples/bitbucket_pipelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,10 @@ access the current repository and comment on its pull requests.

### OCR review produced no output

Verify `OCR_LLM_URL`, `OCR_LLM_AUTH_TOKEN`, and `OCR_LLM_MODEL`. Also confirm
that the destination branch was fetched and that the PR changes contain file
types supported by OCR.
The pipeline prints OCR stderr before failing. Use those diagnostics to verify
`OCR_LLM_URL`, `OCR_LLM_AUTH_TOKEN`, and `OCR_LLM_MODEL`. Also confirm that the
destination branch was fetched and that the PR changes contain file types
supported by OCR.

### Cannot find a merge base

Expand Down
13 changes: 12 additions & 1 deletion examples/bitbucket_pipelines/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,23 @@ definitions:
"+refs/heads/${BITBUCKET_PR_DESTINATION_BRANCH}:refs/remotes/origin/${BITBUCKET_PR_DESTINATION_BRANCH}"

- |
OCR_EXIT_CODE=0
ocr review \
--from "origin/${BITBUCKET_PR_DESTINATION_BRANCH}" \
--to "${BITBUCKET_COMMIT}" \
--format json \
--audience agent \
> /tmp/ocr-result.json || true
> /tmp/ocr-result.json 2> /tmp/ocr-stderr.log || OCR_EXIT_CODE=$?

if [ -s /tmp/ocr-stderr.log ]; then
echo "=== OCR stderr ==="
cat /tmp/ocr-stderr.log
fi

if [ "$OCR_EXIT_CODE" -ne 0 ]; then
echo "OCR review failed with exit code ${OCR_EXIT_CODE}."
exit "$OCR_EXIT_CODE"
fi

if [ ! -s /tmp/ocr-result.json ]; then
echo "OCR review produced no output."
Expand Down
Loading