Skip to content

fix: limit scheduler review dispatch fanout - #160

Closed
seonghobae wants to merge 1 commit into
mainfrom
codex/limit-review-dispatch-fanout
Closed

fix: limit scheduler review dispatch fanout#160
seonghobae wants to merge 1 commit into
mainfrom
codex/limit-review-dispatch-fanout

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

  • cap scheduler-created Strix/OpenCode review dispatches to one per run by default
  • expose max_review_dispatches for workflow_call/workflow_dispatch and env overrides
  • keep scanning later PRs after the cap, but stop creating additional review workflow runs

Verification

  • py -3.12 -m pytest tests/test_pr_review_merge_scheduler.py -q
  • py -3.12 scripts/ci/pr_review_merge_scheduler.py --self-test
  • git diff --check

@opencode-agent

opencode-agent Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 67eaf3bba5eed672bc5194cb35a2e7459991decf
  • Workflow run: 28401199178
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode reviewed the current-head mergeability evidence and changed-file flow before approval, then found merge conflicts on the affected path.

Findings

1. HIGH Merge Conflict Guidance - Resolve the PR branch against the latest base branch

  • Problem: GitHub reports mergeStateStatus DIRTY for this pull request.
  • Root cause: Branch codex/limit-review-dispatch-fanout cannot be merged cleanly into main; the changed-file flow below shows which review/runtime path is blocked by the conflict.
  • Fix: Merge or rebase the latest main into codex/limit-review-dispatch-fanout, resolve conflict markers in the PR branch, rerun the focused checks, and push the same branch.
  • Repair commands:
gh pr checkout 160 --repo ContextualWisdomLab/.github
git fetch origin main
git merge --no-ff origin/main  # or: git rebase origin/main
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:codex/limit-review-dispatch-fanout
# rebase path only: git push --force-with-lease origin HEAD:codex/limit-review-dispatch-fanout
  • Regression test: Keep OpenCode approval gated on mergeability so model-output failures cannot approve a conflicted PR.

Change Flow DAG

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: pr-review-merge-scheduler.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (2 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_pr_review_merge_scheduler.py"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading
  • Result: REQUEST_CHANGES
  • Reason: mergeStateStatus is DIRTY; mergeable is CONFLICTING.
  • Head SHA: 67eaf3bba5eed672bc5194cb35a2e7459991decf
  • Workflow run: 28401199178
  • Workflow attempt: 1

Merge Conflict Guidance

  • Current merge state: DIRTY
  • Base branch: main
  • Head branch: codex/limit-review-dispatch-fanout
  • Fix direction: merge or rebase origin/main into codex/limit-review-dispatch-fanout, resolve conflict markers in the changed files, rerun the focused checks, then push the same branch.
  • Repair commands:
gh pr checkout 160 --repo ContextualWisdomLab/.github
git fetch origin main
git merge --no-ff origin/main  # or: git rebase origin/main
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:codex/limit-review-dispatch-fanout
# rebase path only: git push --force-with-lease origin HEAD:codex/limit-review-dispatch-fanout

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode reviewed the current-head mergeability evidence and changed-file flow before approval, then found merge conflicts on the affected path.

Findings

1. HIGH Merge Conflict Guidance - Resolve the PR branch against the latest base branch

  • Problem: GitHub reports mergeStateStatus DIRTY for this pull request.
  • Root cause: Branch codex/limit-review-dispatch-fanout cannot be merged cleanly into main; the changed-file flow below shows which review/runtime path is blocked by the conflict.
  • Fix: Merge or rebase the latest main into codex/limit-review-dispatch-fanout, resolve conflict markers in the PR branch, rerun the focused checks, and push the same branch.
  • Repair commands:
gh pr checkout 160 --repo ContextualWisdomLab/.github
git fetch origin main
git merge --no-ff origin/main  # or: git rebase origin/main
git status --short
# resolve files, then git add <resolved-files>
# merge path: git commit
# rebase path: git rebase --continue
git push origin HEAD:codex/limit-review-dispatch-fanout
# rebase path only: git push --force-with-lease origin HEAD:codex/limit-review-dispatch-fanout
  • Regression test: Keep OpenCode approval gated on mergeability so model-output failures cannot approve a conflicted PR.

Change Flow DAG

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: pr-review-merge-scheduler.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V1["actionlint plus required checks"]
  Evidence --> S2["CI script (2 files)"]
  S2 --> I2["review and security gate shell path"]
  I2 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_pr_review_merge_scheduler.py"]
  S3 --> I3["regression suite"]
  I3 --> Conflict["Merge conflict blocks this path"]
  Conflict --> V3["targeted test run"]
Loading
  • Result: REQUEST_CHANGES
  • Reason: mergeStateStatus is DIRTY; mergeable is CONFLICTING.
  • Head SHA: 67eaf3bba5eed672bc5194cb35a2e7459991decf
  • Workflow run: 28401199178
  • Workflow attempt: 1

@seonghobae

Copy link
Copy Markdown
Contributor Author

Closing as superseded. The latest main branch now contains the scheduler fanout control under the canonical review_dispatch_limit path: schedule/workflow_dispatch/workflow_run get a bounded follow-up dispatch budget and push events use zero, with workflow forwarding and scheduler tests already present. This PR's older max_review_dispatches implementation now conflicts with that newer main implementation rather than adding a separate needed fix.

@seonghobae seonghobae closed this Jun 30, 2026
seonghobae added a commit that referenced this pull request Jul 16, 2026
* fix(review): honor workspace coverage and synced Python envs

Problem:
Required OpenCode coverage could not validate fast-mlsirm even after its Rust suite compiled and passed. The Python evidence command collected 21 import errors for dependencies already installed by uv, and the Rust gate forced the 100% central default because the target is a virtual Cargo workspace.

Reproduction/Evidence:
fast-mlsirm PR #160 coverage-evidence job 87244269792 installed the optional dev environment, then executed configured pytest outside .venv and failed to import numpy. Its root Cargo.toml has only [workspace], while rust_coverage_fail_under_lines inspected only [package.metadata] and therefore ran cargo llvm-cov with --fail-under-lines 100 despite the repository-owned baseline facility.

Root cause:
The trusted pytest executor preserved the system PATH after uv sync created <project>/.venv, so direct pytest/python argv did not resolve in the synchronized environment. The inline TOML parser modeled package manifests only and omitted the valid metadata namespace for virtual workspaces.

Change:
- Prepend an existing project .venv/bin to PATH while preserving shell=False and validated argv execution.
- Move Rust threshold resolution into a trusted, tested parser.
- Resolve package metadata first and workspace metadata as the virtual-workspace fallback.
- Keep invalid booleans, types, and values outside 0..100 fail-closed.
- Extend workflow, security-boundary, and quick-gate contracts for both paths.

Validation:
- python3 -m pytest -q: 622 passed
- targeted security/coverage/agent contracts: 72 passed
- parser against fast-mlsirm virtual workspace Cargo.toml: emitted 90
- git diff --check: passed
- long Strix quick-gate launched and continued through its expected negative fixtures; repository CI remains the authoritative complete shell-gate run

Security:
No PR-controlled shell is introduced. Commands remain allowlisted pytest argv executed with shell=False, and coverage metadata is parsed by trusted default-branch code with numeric range validation.

* test(review): cover Rust threshold CLI contract

Problem:
The central repository enforces 100% Python coverage. PR #565 first ran under the previous trusted workflow and reported rust_coverage_threshold.py at 76%, leaving its argparse, error-reporting, and __main__ paths unproven even though the parser logic tests passed.

Evidence:
Required coverage-evidence job 87247543719 reported 5,533 statements, 11 missed statements, 99% total coverage, with all misses at rust_coverage_threshold.py lines 55-64 and 68.

Change:
Add end-to-end tests for normalized CLI output, invalid metadata diagnostics and exit status, and the executable __main__ entrypoint when no repository baseline is declared.

Validation:
- parser test module: 10 passed
- python3 -m coverage run -m pytest -q: 625 passed
- python3 -m coverage report --show-missing: 5,533 statements, 0 missed, 100%
- git diff --check: 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.

1 participant