chore(examples): add explicit --audience agent to codeup_ci and action.yml (#1004)
Some checks are pending
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Pages / build (push) Waiting to run

Since PR #929 made 'human' the default audience and redirected [ocr] progress lines to stderr, the two non-interactive CI call sites that omitted --audience now emit progress noise on stderr. Add --audience agent to match the other four examples.

- examples/codeup_ci/post_review.py: add --audience agent to cmd
- action.yml: add --audience agent to ARGS (also covers github_actions)
- examples/codeup_ci/post_review_test.py: update exact cmd assertion

Exit-code handling, JSON parsing, and comment-posting logic are unchanged.

Closes #1003
This commit is contained in:
xujiejie 2026-08-19 21:34:16 +08:00 committed by GitHub
parent f6e5e98564
commit d8fc4cd2af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -276,7 +276,7 @@ runs:
OCR_RULE: ${{ inputs.rule }}
shell: bash
run: |
ARGS=(--from "${MERGE_BASE}" --to "${HEAD_SHA}" --format json)
ARGS=(--from "${MERGE_BASE}" --to "${HEAD_SHA}" --audience agent --format json)
[ -n "$OCR_REVIEW_CONCURRENCY" ] && ARGS+=(--concurrency "$OCR_REVIEW_CONCURRENCY")
[ -n "$OCR_BACKGROUND" ] && ARGS+=(--background "$OCR_BACKGROUND")
[ -n "$OCR_RULE" ] && ARGS+=(--rule "$OCR_RULE")

View file

@ -70,7 +70,7 @@ def run_ocr_review(from_ref: str | None = None, to_ref: str | None = None,
extra_args: list[str] | None = None,
timeout: int = 1800) -> dict:
"""Run `ocr review --format json` and return the parsed JSON output."""
cmd = ["ocr", "review", "--format", "json"]
cmd = ["ocr", "review", "--audience", "agent", "--format", "json"]
if from_ref and to_ref:
cmd += ["--from", from_ref, "--to", to_ref]
if extra_args:

View file

@ -26,7 +26,7 @@ class RunOcrReviewTests(unittest.TestCase):
self.assertEqual(result, {"comments": []})
run_mock.assert_called_once()
cmd = run_mock.call_args[0][0]
self.assertEqual(cmd, ["ocr", "review", "--format", "json"])
self.assertEqual(cmd, ["ocr", "review", "--audience", "agent", "--format", "json"])
def test_from_to_ref_are_passed_through(self):
fake_proc = mock.Mock(returncode=0, stdout='{"comments": []}', stderr="")