Skip to content

Fix bug and PR report crash on PRs from deleted forks - #55292

Merged
lukeheath merged 1 commit into
mainfrom
fix-bug-pr-report-deleted-fork
Oct 9, 2026
Merged

lukeheath merged 1 commit into
mainfrom
fix-bug-pr-report-deleted-fork

Conversation

@lukeheath

@lukeheath lukeheath commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

sails run get-bug-and-pr-report crashed with TypeError: Cannot read properties of null (reading 'name'). GitHub returns head.repo: null for a PR whose source fork was deleted (currently #55127, a #handbook PR merged Oct 8), and the verbose log line in the handbook PR open-time calculation read pr.head.repo.name. Switched to pr.base.repo.name, which is always present and is the repo the PR was merged into.

Checklist for submitter

Testing

  • QA'd all new/changed functionality manually

Reproduced the crash locally, applied the fix, and confirmed the script completes and prints the KPI CSV.

AI

AI: Claude Code (claude-opus-5-5)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Handbook pull request logs now identify the base repository.

GitHub returns head.repo as null when a PR's source fork has been
deleted, which crashed the #handbook open-time calculation. Use
base.repo instead, which is always present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 21:57
@fleet-release
fleet-release requested a review from eashaw October 9, 2026 21:57

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.

🟢 Approval recommended

The targeted change safely handles deleted forks and matches the GitHub API response shape.

0 open findings

What changed in this PR

Prevents the KPI report from crashing when a pull request’s source fork has been deleted.

Changes:

  • Logs the always-present base repository name instead of the nullable head repository name.
File Description
website/​scripts/​get-bug-and-pr-report.js Uses the destination repository when logging handbook PR processing.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: fleetdm/fleet/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fae307e0-85e5-4bb3-bf85-990b60ea9655

📥 Commits

Reviewing files that changed from the base of the PR and between ef5fb3c and 504bb64.


📒 Files selected for processing (1)
  • website/scripts/get-bug-and-pr-report.js

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.



Walkthrough

The handbook PR processing log now identifies the repository with pr.base.repo.name instead of pr.head.repo.name.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 504bb

The change avoids the reported deleted-fork crash in the handbook PR logging path. No material merge risk is established.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the crash and its cause: deleted forks in the bug and PR report.
Description check Passed The description clearly explains the failure, root cause, code change, manual testing, and AI usage. It is mostly complete for this small script change, although it does not include a related issue en…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@lukeheath
lukeheath merged commit 057ba94 into main Oct 9, 2026
13 checks passed
@lukeheath
lukeheath deleted the fix-bug-pr-report-deleted-fork branch October 9, 2026 22:59
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