Skip to content

fix(fleet-monitor): drop broken paginate mapFn crashing the daily auto-close - #1242

Merged
don-petry merged 2 commits into
mainfrom
fix/fleet-monitor-paginate-mapfn
Jul 14, 2026
Merged

fix(fleet-monitor): drop broken paginate mapFn crashing the daily auto-close#1242
don-petry merged 2 commits into
mainfrom
fix/fleet-monitor-paginate-mapfn

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Production fix — the daily Actions Fleet Monitor has been failing (08:18 + 21:45 UTC runs both failure) at the 'Close resolved fleet-tracker issues' step with:

TypeError: Cannot read properties of undefined (reading 'repository_url')

Cause: a response => response.data.items mapFn was added to the github.paginate(search.issuesAndPullRequests, …) call during #1204's review. octokit already flattens search responses to .items natively, so the extra mapFn produced undefined array entries → the loop crashed → the whole monitor failed → the fleet-tracker + health-digest backlog stopped auto-closing (open issues rose 301→312).

Fix: remove the redundant mapFn; add a defensive .filter(Boolean). Validated: YAML parses, node --check clean.

Once merged, the next monitor run clears the ~109 recovered fleet-tracker + health issues as #1204 intended. Please fast-track — it's a broken daily job.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Juznz5V6su81ffSND8fg7s

…close

A `response => response.data.items` mapFn added to the fleet-tracker auto-close
paginate call (during #1204 review) produced undefined entries, so the step threw
'TypeError: Cannot read properties of undefined (reading repository_url)' and
failed the entire daily monitor — the fleet-tracker/health backlog stopped
clearing. octokit already flattens search results to .items natively; remove the
redundant mapFn and add a defensive .filter(Boolean).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Juznz5V6su81ffSND8fg7s
Copilot AI review requested due to automatic review settings July 14, 2026 22:09
@don-petry
don-petry requested a review from a team as a code owner July 14, 2026 22:09
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@donpetry-bot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9d7a6bb9-58eb-4ce1-ae02-5be5965623b9

📥 Commits

Reviewing files that changed from the base of the PR and between 86d8ffe and 83d7a05.

📒 Files selected for processing (1)
  • .github/workflows/actions-fleet-monitor.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/fleet-monitor-paginate-mapfn

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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

Fixes the Actions Fleet Monitor daily workflow failure by correcting how Octokit pagination results are handled in the “Close resolved fleet-tracker issues” step, restoring auto-closure of recovered/deleted workflow tracker issues.

Changes:

  • Removes the redundant github.paginate(..., mapFn) mapping that introduced undefined entries for search pagination results.
  • Adds a defensive .filter(Boolean) to ensure the loop only processes valid issue objects.
  • Documents the root cause and the rationale inline to prevent regression.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) July 14, 2026 22:11

@donpetry-bot donpetry-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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 143a0417d3627bbf2da4a14ffc15a305c6f1853d
Review mode: triage-approved (single reviewer)

Summary

One-file fix to .github/workflows/actions-fleet-monitor.yml removing a redundant paginate mapFn that crashed the daily monitor's fleet-tracker auto-close step. octokit's paginate already flattens search responses to .items, so the mapFn (response => response.data.items) returned undefined per page, producing undefined array entries and the reported TypeError on issue.repository_url. The fix removes the mapFn and adds a defensive .filter(Boolean). Root cause and fix verified against the full workflow source at the head SHA. Triage assessment confirmed.

Linked issue analysis

No formally linked issues. The PR body references #1204 (where the broken mapFn was introduced during review) and a concrete production failure (daily monitor runs failing at the 'Close resolved fleet-tracker issues' step). The change substantively addresses the described failure.

Findings

  • No blocking findings.
  • Fix correctness verified: octokit paginate normalizes search responses so response.data is already the items array; the removed mapFn returned undefined per page, matching the reported TypeError. The .filter(Boolean) guard is harmless.
  • No security-relevant changes: no workflow trigger/permission/token changes; GH_PAT_WORKFLOWS usage is pre-existing.
  • Secret scan: run_secret_scanning MCP tool not available in this run; gitleaks CI check passed and the diff contains no secret material.

CI status

All checks green: CodeQL (actions, python), gitleaks secret scan, AgentShield, SonarCloud (quality gate passed, 0 new issues), ShellCheck, Lint suite, unit-tests, bats, holdout-guard, test-deletion guard all SUCCESS; remaining checks SKIPPED (not applicable).


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit ffe94a7 into main Jul 14, 2026
30 of 32 checks passed
@don-petry
don-petry deleted the fix/fleet-monitor-paginate-mapfn branch July 14, 2026 22:20

@donpetry-bot donpetry-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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 83d7a0500dd756521a415b374ed774efbe45e501
Review mode: triage-approved (single reviewer)

Summary

One-file production fix to .github/workflows/actions-fleet-monitor.yml (+6/−2). Removes a redundant mapFn (response => response.data.items) from the github.paginate(search.issuesAndPullRequests, ...) call in the 'Close resolved fleet-tracker issues' step and adds a defensive .filter(Boolean). octokit's paginate plugin already normalizes search responses to their .items array, so the mapFn returned undefined per page, filling the results with undefined entries and crashing the loop with 'TypeError: Cannot read properties of undefined (reading repository_url)' — failing the entire daily monitor. Fix verified against the full workflow source at the head SHA. Since the prior review (143a041), the head advanced only via a merge of main bringing #1241's LICENSE and SECURITY.md — unrelated to this PR's content. Triage assessment confirmed.

Linked issue analysis

No formally linked issues. The PR body references #1204 (where the broken mapFn was introduced during review) and a concrete production failure: both daily monitor runs failing at the auto-close step, causing the fleet-tracker/health-digest backlog to stop clearing (open issues 301→312). The change substantively addresses the described failure.

Findings

  • No blocking findings.
  • Fix correctness verified: octokit's paginate normalizes search responses so response.data is already the flattened items array; the removed mapFn (response.data.items) returned undefined per page, matching the reported TypeError. The .filter(Boolean) guard is harmless.
  • No security-relevant changes: no workflow trigger, permission, or token changes; GH_PAT_WORKFLOWS usage is pre-existing and unchanged.
  • Secret scan: run_secret_scanning MCP tool not available in this run; gitleaks CI check passed and the diff contains no secret material.

CI status

All checks green: CodeQL (actions, python), gitleaks secret scan, AgentShield, SonarCloud (quality gate passed, 0 new issues), ShellCheck, Lint suite (shellcheck, bats, template-drift, validate-personas, validate-agent-profiles, gh-aw-compile, validate-workflow-schedules), unit-tests, holdout-guard, test-deletion guard, Agent Security Scan, Compile agentic workflows — all SUCCESS. Dependency-audit sub-jobs SKIPPED (no matching ecosystems). Two dev-lead orchestration jobs CANCELLED (superseded; dev-lead reported no-changes) — non-blocking. 'review / review' IN_PROGRESS is this run.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@donpetry-bot donpetry-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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 83d7a0500dd756521a415b374ed774efbe45e501
Review mode: triage-approved (single reviewer)

Summary

One-file fix (+6/-2) to .github/workflows/actions-fleet-monitor.yml removing a redundant paginate mapFn that crashed the daily monitor's 'Close resolved fleet-tracker issues' step. octokit's paginate normalizes search responses so response.data is already the flattened items array; the mapFn (response => response.data.items) therefore returned undefined per page, producing undefined array entries and the reported TypeError on issue.repository_url. The fix removes the mapFn and adds a defensive .filter(Boolean). Verified against the full workflow source at the head SHA. The only change since the prior approval is a clean merge of main. Triage assessment confirmed.

Linked issue analysis

No formally linked issues. The PR body references #1204 (where the broken mapFn was introduced during review) and a concrete production failure (both daily monitor runs failing at this step, fleet-tracker backlog no longer auto-closing). The change substantively addresses the described failure.

Findings

  • No blocking findings.
  • Fix correctness verified in full context at the head SHA: the downstream loop reads issue.repository_url and issue.body with existing guards; removing the mapFn restores valid issue objects, and .filter(Boolean) is a harmless extra guard.
  • No security-relevant changes: no workflow trigger, permission, or token changes; GH_PAT_WORKFLOWS usage is pre-existing. Not a protected thin-caller stub per repo guidelines.
  • No unresolved review threads; Copilot's prior review was a descriptive overview with no inline comments.
  • Secret scan: run_secret_scanning MCP tool not available in this run; gitleaks CI passed and the diff contains no secret material.

CI status

All substantive checks green: CodeQL (actions, python), gitleaks secret scan, AgentShield, SonarCloud (quality gate passed, 0 new issues), ShellCheck, Lint suite (shellcheck, bats, template-drift, validate-personas, validate-agent-profiles, gh-aw-compile, validate-workflow-schedules), unit-tests, holdout-guard, test-deletion guard, Agent Security Scan, Compile agentic workflows — all SUCCESS. Dependency-audit sub-jobs SKIPPED (no applicable ecosystems). Two Dev-Lead Agent orchestration jobs show CANCELLED (superseded; dev-lead reported no-changes) — not correctness checks. The IN_PROGRESS 'review / review' check is this review run itself.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

don-petry added a commit that referenced this pull request Jul 14, 2026
The 'Summarize token usage by workflow' step fetches/unzips every token-usage
artifact and hit an API rate-limit (HTTP 403), failing the whole daily monitor
BEFORE the load-bearing steps ran — issue tracking + the fleet-tracker auto-close
(#1204) never executed, so the backlog didn't clear even after the paginate fix
(#1242). This step is best-effort observability; mark it continue-on-error so a
transient rate-limit can never again abort the monitor and block the auto-close.


Claude-Session: https://claude.ai/code/session_01Juznz5V6su81ffSND8fg7s

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

3 participants