fix: repair shared sync gate failures - #2722
Conversation
📝 WalkthroughWalkthroughUpdates ChangesWorkflow retry fallback, sparse-checkout, and type annotation fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Automated Status SummaryHead SHA: 03dbb4f
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Low Coverage Files (<50.0%)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7e67f5bb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| paginateWithRetry: (method, params) => github.paginate(method, params) | ||
| paginateWithRetry: async (method, params) => { | ||
| const response = await method({ ...params, per_page: params?.per_page || 100 }); | ||
| return response.data || []; |
There was a problem hiding this comment.
Preserve the paginated array contract
When this fallback is used, such as in a consumer checkout that does not materialize .github/scripts/github-api-with-retry.js, github.rest.actions.listWorkflowRuns returns a response whose data is an object containing workflow_runs, not the flattened array returned by the previous github.paginate(...) call. The later runs[0] lookup therefore never finds the latest Gate run and records gate_result_after as not-found even when a run exists; the fallback needs to keep returning the same paginated array shape as the real helper.
Useful? React with 👍 / 👎.
|
Runner dispatch state for autofix on PR #2722. Do not edit. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@templates/consumer-repo/.github/workflows/agents-81-gate-followups.yml`:
- Around line 1374-1376: The `paginateWithRetry` fallback for `listWorkflowRuns`
is returning the wrong shape because `github.rest.actions.listWorkflowRuns(...)`
returns a response object, not a plain array. Update the fallback so it matches
the retry helper’s paginated-array contract before any `runs[0]` access, using
the existing `paginateWithRetry` helper and the `listWorkflowRuns` call site to
keep the fallback consistent with the rest of the code.
- Around line 1283-1286: This change should not be applied locally in
agents-*.yml workflows; it needs to be made in the upstream source of truth in
stranske/Workflows and then synced back. Update the relevant workflow there,
using the synced workflow path and the .github/sync-manifest.yml-managed
process, then pull the generated change into
templates/consumer-repo/.github/workflows/agents-81-gate-followups.yml rather
than patching this consumer file directly.
- Around line 1579-1582: The current paginateWithRetry fallback only returns the
first API page, so the workflow can miss items when used by issues.listForRepo
and pulls.listFiles. Update the paginateWithRetry helper to actually iterate
through all pages (or delegate to the client’s pagination support) instead of
calling the method once, and make sure the call sites in the agent job continue
to receive the full aggregated results for automerge PRs and changed files.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b89fbb7b-8249-4786-abae-0b0e4cfd34ce
📒 Files selected for processing (3)
scripts/autopilot_step_timer.pytemplates/consumer-repo/.github/workflows/agents-81-gate-followups.ymltests/workflows/test_github_api_retry_standard.py
| paginateWithRetry: async (method, params) => { | ||
| const response = await method({ ...params, per_page: params?.per_page || 100 }); | ||
| return response.data || []; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
listWorkflowRuns fallback returns the wrong shape here.
github.rest.actions.listWorkflowRuns(...) does not yield a bare array, so return response.data || [] makes runs[0] come back undefined in the fallback path and forces gate_result_after to not-found even when runs exist. Keep this fallback aligned with the retry helper’s “paginated array” contract before indexing it.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@templates/consumer-repo/.github/workflows/agents-81-gate-followups.yml`
around lines 1374 - 1376, The `paginateWithRetry` fallback for
`listWorkflowRuns` is returning the wrong shape because
`github.rest.actions.listWorkflowRuns(...)` returns a response object, not a
plain array. Update the fallback so it matches the retry helper’s
paginated-array contract before any `runs[0]` access, using the existing
`paginateWithRetry` helper and the `listWorkflowRuns` call site to keep the
fallback consistent with the rest of the code.
Summary
error_classifier.jsinagents-81-gate-followups.ymlretry-helper sparse checkoutsagents-81-gate-followups.ymlto the retry/sparse-checkout guard testautopilot_step_timerfailure summaries to acceptSystemExitfrom argparseValidation
/opt/anaconda3/bin/python3.12 -m pytest tests/workflows/test_github_api_retry_standard.py tests/scripts/test_autopilot_step_timer.py tests/scripts/test_autopilot_step_timer_failure_handling.py -qpython3 scripts/validate_template_sync.pypython3 scripts/validate_template_completeness.pygit diff --checkRelated to sync/dependency cleanup campaign blockers on Manager-Database#1343 and trip-planner#1506.
Summary by CodeRabbit
Bug Fixes
Chores