Skip to content

Reject missing repository mappings - #1528

Merged
skyfallwastaken merged 1 commit into
mainfrom
fix/reject-missing-repository-mappings
Aug 6, 2026
Merged

Reject missing repository mappings#1528
skyfallwastaken merged 1 commit into
mainfrom
fix/reject-missing-repository-mappings

Conversation

@skyfallwastaken

@skyfallwastaken skyfallwastaken commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary of the problem

GitHub returns 404 for both nonexistent repositories and private repositories hidden from a limited OAuth token. The repository mapping verifier treated limited-scope 404 responses as ambiguous and failed open, so typos such as https://github.com/hackcl/hackatime were accepted :(

Describe your changes

Treat every GitHub repository API 404 as nonexistent or inaccessible

Screenshots / Media

N/A

Copilot AI review requested due to automatic review settings August 6, 2026 09:22

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes repository mapping validation reject every GitHub API 404 while continuing to fail open for other API and network failures.

  • Removes OAuth-scope-dependent handling of GitHub 404 responses.
  • Adds regression coverage for rejecting the reported hackcl/hackatime typo.
  • Removes coverage preserving mappings for private repositories hidden from limited tokens.

Confidence Score: 5/5

The PR appears safe to merge because the stricter handling matches the stated accessibility requirement and includes focused regression coverage.

GitHub 404 responses now deterministically block mappings, while transient, authentication, rate-limit, and server failures retain their existing fail-open behavior.

Important Files Changed

Filename Overview
app/services/repo_host/github_service.rb Treats every repository lookup returning 404 as nonexistent or inaccessible and removes the obsolete OAuth-scope helper.
test/models/project_repo_mapping_test.rb Updates model coverage to verify that the reported nonexistent GitHub repository is rejected.

Reviews (1): Last reviewed commit: "Reject inaccessible repository URLs" | Re-trigger Greptile

@skyfallwastaken
skyfallwastaken merged commit a062528 into main Aug 6, 2026
20 checks passed
@skyfallwastaken
skyfallwastaken deleted the fix/reject-missing-repository-mappings branch August 6, 2026 09:28
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.

2 participants