open-code-review/examples/codeup_ci/codeup-flow.yml
Ritvik K dc1e346316
Add CodeUp CI integration (#570)
* Add CodeUp CI integration (issue #517)

Adds examples/codeup_ci with:
- post_review.py: runs ocr review --format json and posts a
  GLOBAL_COMMENT summary via CodeUp's CreateChangeRequestComment API
- post_review_test.py: unit tests (27 passing)
- codeup-flow.yml: example Yunxiao Flow pipeline
- README.md: setup docs and known limitations (v1 = summary
  comment only, inline comments as a follow-up)

* chore: ignore Python cache files

* Add actual file contents for CodeUp CI integration

* Use generic placeholder for OCR_LLM_MODEL example

* Address review: remove local .gitignore, add trailing newlines, simplify testing docs
2026-07-29 22:37:29 +08:00

56 lines
1.8 KiB
YAML

name: open-code-review
# Triggered whenever a merge request is opened or updated against any branch.
sources:
repo:
type: codeup
name: repo-source
endpoint: <your-codeup-repository-url>
branch: master
triggerEvents:
- mergeRequestOpen
- mergeRequestUpdate
certificate:
type: serviceConnection
serviceConnection: <your-service-connection-id>
stages:
code_review_stage:
name: Code Review
jobs:
code_review_job:
name: open-code-review
runsOn: public/cn-hangzhou
steps:
install_node_step:
step: NodeInstall
name: Install Node.js
with:
version: "20"
install_ocr_step:
step: Shell
name: Install open-code-review CLI
with:
run: npm install -g @alibaba-group/open-code-review
run_review_step:
step: Shell
name: Run review and post comment
with:
# These CODEUP_* variables are populated by Flow from the
# merge-request trigger context. CODEUP_TOKEN should be stored
# as a protected/secret pipeline variable, not committed here.
env:
CODEUP_DOMAIN: codeup.aliyun.com
CODEUP_TOKEN: ${CODEUP_TOKEN}
CODEUP_ORG_ID: ${CODEUP_ORG_ID}
CODEUP_REPO_ID: ${CODEUP_REPO_ID}
CODEUP_MR_LOCAL_ID: ${CODEUP_MERGE_REQUEST_LOCAL_ID}
CODEUP_TARGET_BRANCH: ${CODEUP_MERGE_REQUEST_TARGET_BRANCH}
CODEUP_SOURCE_BRANCH: ${CODEUP_MERGE_REQUEST_SOURCE_BRANCH}
OCR_LLM_URL: ${OCR_LLM_URL}
OCR_LLM_TOKEN: ${OCR_LLM_TOKEN}
OCR_LLM_MODEL: ${OCR_LLM_MODEL}
OCR_USE_ANTHROPIC: ${OCR_USE_ANTHROPIC}
run: python3 post_review.py