Skip to content

Enhancement: Enable Public Repo Tracking Without Personal Access Token (PAT)#238

Open
Julliet-Mohanta wants to merge 2 commits into
GitMetricsLab:mainfrom
Julliet-Mohanta:main
Open

Enhancement: Enable Public Repo Tracking Without Personal Access Token (PAT)#238
Julliet-Mohanta wants to merge 2 commits into
GitMetricsLab:mainfrom
Julliet-Mohanta:main

Conversation

@Julliet-Mohanta
Copy link
Copy Markdown

@Julliet-Mohanta Julliet-Mohanta commented May 14, 2026

Related Issue

  • Closes: #<224>
    Issue 224:Enhancement: Enable Public Repo Tracking Without Personal Access Token (PAT)

Description

---Changes:
1.Optional PAT: Make the PAT input field optional in the layout.
2.Unauthenticated Fetch: When a repository URL is entered, attempt to fetch data using a standard GET request to without an authorization header.
3.Fallback/Rate Limit Handling:If the request succeeds, render the tracking data immediately.
4.If the request fails due to a 403 (Rate Limit Exceeded), then prompt the user to provide a PAT("GitHub API rate limit exceeded. Please provide a PAT to continue.")
5..If the repository is private, show a specific message: "Private repository detected. Please input PAT".
6.If username is wrong,display('User not found. Please check the spelling of the GitHub username.').

How Has This Been Tested?

Run locally as well as in network

Screenshots (if applicable)

Screenshot 2026-05-15 010210

Screenshot 2026-05-15 010053 ## Type of Change
  • Bug fix
  • [ X] New feature
  • Code style update
  • Breaking change
  • Documentation update

Summary by CodeRabbit

  • New Features

    • Authentication now works with username alone; Personal Access Token is optional.
  • Bug Fixes

    • Improved error handling with more specific messages for API failures, including rate-limit and permission issues.
  • Chores

    • Updated icon library dependency.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit fe00793
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a06246c0271d3000ab73daa
😎 Deploy Preview https://deploy-preview-238--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6a0d1a46-132b-4f44-b8bd-adbeb04fd9f4

📥 Commits

Reviewing files that changed from the base of the PR and between 56e17a3 and fe00793.

📒 Files selected for processing (4)
  • package.json
  • src/hooks/useGitHubAuth.ts
  • src/hooks/useGitHubData.ts
  • src/pages/Tracker/Tracker.tsx
💤 Files with no reviewable changes (1)
  • src/pages/Tracker/Tracker.tsx

📝 Walkthrough

Walkthrough

This PR enables optional Personal Access Token (PAT) authentication by making the token input optional, allowing Octokit to initialize without a token for unauthenticated API access, and improving error handling to distinguish between rate-limit, permission, and not-found failures. The octicons library dependency is also updated.

Changes

Optional PAT and Unauthenticated API Support

Layer / File(s) Summary
Unauthenticated Octokit initialization
src/hooks/useGitHubAuth.ts
octokit memoization now depends only on username presence, returning an unauthenticated Octokit instance when token is absent instead of requiring both username and token.
Improved error handling and fetch retry logic
src/hooks/useGitHubData.ts
Early-return guard on fetchData no longer checks rateLimited, allowing retries when already rate-limited; success path explicitly resets rateLimited; error handler maps 403/401/404 status codes and message text patterns to specific error messages distinguishing rate-limit, permission, private repository, and not-found cases.
Optional token form field
src/pages/Tracker/Tracker.tsx
Removed required prop from Personal Access Token TextField, allowing form submission without providing a token.
Dependency updates
package.json
Bumped @primer/octicons-react from ^19.15.5 to ^19.25.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Suggested labels

gssoc25, level1

Poem

🐰 A token optional, now flows so free,
Unauthenticated data for you and me,
Rate limits handled with graceful care,
Error messages clear, the burden less rare! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main objective of the pull request: enabling public repository tracking without requiring a Personal Access Token.
Description check ✅ Passed The description includes related issue, detailed changes, testing approach, and type of change classification. While formatting could be cleaner and some sections are sparse, the core required information is present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant