Repository navigation
fix: skip organizations that restrict what GitHub shows, instead of failing every lookup - #1327
Conversation
…low list, instead of failing every lookup
… retry every other refusal
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Handle restricted organization lookups app/Actions/UpdateMentionedOrganizations.php, tests/Unit/Jobs/LookUpUserOrganizationsTest.php, tests/Unit/Actions/UpdateCommitTopicsTest.php |
The action skips lookups when a forbidden response identifies an IP allow list, SAML SSO, or OAuth App restriction. It rethrows other request errors. Tests cover continued lookups, unchanged data for inaccessible organizations, and rate-limit and other error responses. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- dev-null-sh/dev-null.sh#1266: Introduced the organization lookup action whose error handling this PR changes.
- dev-null-sh/dev-null.sh#1316: Changes the organization lookup action and its organization update contract.
- dev-null-sh/dev-null.sh#1273: Handles organization-level GitHub restrictions in the organization claims flow.
Suggested reviewers: nunomaduro
Merge Risk: 
Minimal · up to 900ed
-
The change appears ready to merge with normal checks.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files.
-
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
Comment @coderabbitai help to get the list of available commands.
Summary
Looking up the organizations a user's bio mentions failed as soon as one of them restricted what GitHub shows our OAuth app: GitHub answered 403 ("the organization has an IP allow list enabled"), the lookup threw, and the user's other mentioned organizations were never looked up. The job then failed after its retries.
Such an organization is now skipped, and the other lookups go on.
Changes
UpdateMentionedOrganizationsskips a lookup only for the org-level refusalsHttpGitHubProvider::organizationMembership()already recognizes: theX-GitHub-SSOheader, or a message about an IP allow list or OAuth App access restrictions.Validation
Local, on 900ed36 with an isolated PostgreSQL:
production(and the rate-limit cases on the first, header-based version of this fix) and pass now.composer test:lint,composer test:types: passed (existing oxlint warnings in untouched JS tests).composer test:type-coverage: 100%.bun run test:unit: 212 passed.Independent review
Independent agent review: FAIL on a7718ba (secondary rate limits without headers were skipped instead of retried, and other 403s were swallowed). Fixed in 900ed36 with the allow-list above. PASS on 900ed36 against
production9767878.Limitations
HttpGitHubProviderbehind a dedicated exception would be cleaner, at the cost of a new exception class.Summary by CodeRabbit