Skip to content

Github Auth Checks Failed#687

Merged
arul28 merged 2 commits into
mainfrom
ade/ok-start-skill-ade-desktop-c2abd496
Jul 2, 2026
Merged

Github Auth Checks Failed#687
arul28 merged 2 commits into
mainfrom
ade/ok-start-skill-ade-desktop-c2abd496

Conversation

@arul28

@arul28 arul28 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Describe the change.

What Changed

Key files and behaviors.

Validation

How you tested.

Risks

Anything to watch.

ADE   Open in ADE  ·  ade/ok-start-skill-ade-desktop-c2abd496 branch  ·  PR #687

Summary by CodeRabbit

  • New Features

    • Added a new “Checking access” state while GitHub repository access is being verified after authorization.
    • Refresh and authorization actions now better handle the short delay before access becomes available.
  • Bug Fixes

    • Improved handling of transient GitHub access errors so the panel shows clearer status updates instead of immediately failing.
    • Prevented outdated status updates from overwriting newer results, making the install panel more reliable.

Greptile Summary

This PR improves the GitHub App authorization status flow. The main changes are:

  • Adds a short retry window after device authorization succeeds.
  • Treats GitHub repo-access 404 responses as a temporary Checking access state.
  • Prevents stale status requests from overwriting newer results.
  • Adds focused tests for the new status helper behavior.
  • Updates onboarding and settings documentation for the new flow.

Confidence Score: 5/5

Safe to merge with minimal risk.

Changes are localized to UI status handling and helper logic, with targeted tests for the new behavior.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Compared the before and after runs for the github-checking-access-state tests and confirmed the after run passes all four status-helper scenarios, including the new pending repo-access 404 state.
  • Analyzed the github-auth-retry-workflow tests and observed that the post-auth call count increased from 1 to 3 in the after run, all calls used forceRefresh, the Configured status is displayed after retries, and the harness source for the test is saved at trex-artifacts/github-auth-retry-workflow-test.tsx.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.tsx Adds post-authorization retry handling, stale request guards, and a pending repo-access status for transient GitHub 404 responses.
apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.test.ts Adds unit coverage for pending repo-access classification and status view behavior.
docs/features/onboarding-and-settings/README.md Documents the new post-device-auth retry window and temporary Checking access state.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant Panel as GitHubAppInstallPanel
participant GitHub as GitHub device auth
participant Relay as Hosted relay status

User->>Panel: Authorize ADE
Panel->>GitHub: start/poll device auth
GitHub-->>Panel: authorized
Panel->>Relay: getAppInstallationStatus(forceRefresh)
Relay-->>Panel: repo access 404
Panel->>Panel: show Checking access
loop Retry window
    Panel->>Relay: getAppInstallationStatus(forceRefresh)
    Relay-->>Panel: status result
end
Panel->>Panel: ignore stale responses via request sequence
Panel-->>User: Configured, Checking access, or Check failed
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant Panel as GitHubAppInstallPanel
participant GitHub as GitHub device auth
participant Relay as Hosted relay status

User->>Panel: Authorize ADE
Panel->>GitHub: start/poll device auth
GitHub-->>Panel: authorized
Panel->>Relay: getAppInstallationStatus(forceRefresh)
Relay-->>Panel: repo access 404
Panel->>Panel: show Checking access
loop Retry window
    Panel->>Relay: getAppInstallationStatus(forceRefresh)
    Relay-->>Panel: status result
end
Panel->>Panel: ignore stale responses via request sequence
Panel-->>User: Configured, Checking access, or Check failed
Loading

Reviews (2): Last reviewed commit: "Address GitHub App status review feedbac..." | Re-trigger Greptile

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Jul 2, 2026 7:48pm

@arul28

arul28 commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@mintlify

mintlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ade-ac1c6011 🟢 Ready View Preview Jul 2, 2026, 7:34 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

GitHubAppInstallPanel adds a bounded retry mechanism after GitHub device authorization to detect delayed repository access, introducing an exported isGitHubAppRepoAccessPending helper, request sequencing to prevent stale updates, a new "Checking access" UI state, and corresponding unit tests.

Changes

Repo Access Retry After Authorization

Layer / File(s) Summary
Pending-access detection helper
apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.tsx
Adds retry delay constants, a sleepMs helper, and exported isGitHubAppRepoAccessPending to detect not-found/repository-error signatures indicating pending repo access.
loadStatus retry loop and request sequencing
apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.tsx
loadStatus accepts a retryAfterAuthorization option, uses a request sequence ref to invalidate stale calls, retries getAppInstallationStatus with forceRefresh, updates auth state, and sets/clears warming-up messaging; unmount cleanup invalidates in-flight requests.
Panel wiring and Checking access UI
apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.tsx
Derives repoAccessPending, suppresses the authorize button during pending access, updates the Refresh button and authorized-state handler to trigger retries, and adds a "Checking access" branch to statusView.
Status helper tests
apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.test.ts
Adds tests with a makeStatus builder validating pending-repo-access and check-failed status interpretations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: desktop

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the GitHub authorization status changes, though it emphasizes failures more than the broader UX retry and pending-access improvements.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/ok-start-skill-ade-desktop-c2abd496

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.test.ts (1)

5-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider broadening coverage of isGitHubAppRepoAccessPending branches.

Current tests exercise only the exact "not found" match and a non-matching error. The helper (per upstream GitHubAppInstallPanel.tsx) also has substring branches ("repository not found", "could not resolve to a repository") and guard conditions (relayConfigured: false, installed: true, non-"error" state) that return false early — none of these are covered.

♻️ Example additional test cases
   it("keeps non-propagation relay failures as check failures after authorization", () => {
     const status = makeStatus({ error: "GitHub App relay status check failed (500)" });
     const view = statusView(status, false, true);

     expect(isGitHubAppRepoAccessPending(status)).toBe(false);
     expect(view.label).toBe("Check failed");
     expect(view.description("arul28/ADE")).toBe("GitHub App relay status check failed (500)");
   });
+
+  it("detects repository-not-found substring variants", () => {
+    expect(isGitHubAppRepoAccessPending(makeStatus({ error: "Repository not found." }))).toBe(true);
+    expect(isGitHubAppRepoAccessPending(makeStatus({ error: "Could not resolve to a Repository." }))).toBe(true);
+  });
+
+  it("does not treat pending access when relay is not configured or already installed", () => {
+    expect(isGitHubAppRepoAccessPending(makeStatus({ relayConfigured: false }))).toBe(false);
+    expect(isGitHubAppRepoAccessPending(makeStatus({ installed: true }))).toBe(false);
+  });
 });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.test.ts`
around lines 5 - 47, Expand the GitHubAppInstallPanel test coverage for
isGitHubAppRepoAccessPending by adding cases for the other error-string branches
in GitHubAppInstallPanel.tsx, including “repository not found” and “could not
resolve to a repository,” plus the early-return guards for relayConfigured
false, installed true, and a non-"error" state. Use makeStatus,
isGitHubAppRepoAccessPending, and statusView to verify each branch returns the
expected false or pending behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.tsx`:
- Around line 82-95: The async cleanup in GitHubAppInstallPanel’s status refresh
logic should not use early returns from the finally path because Biome flags
this as noUnsafeFinally. Refactor the control flow around the mountedRef.current
and statusRequestSeqRef.current checks so the finally block only performs
guarded state updates (including setLoading(false)) without returning, while
keeping the existing behavior in the status-fetching routine and its
retryAfterAuthorization handling intact.

---

Nitpick comments:
In `@apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.test.ts`:
- Around line 5-47: Expand the GitHubAppInstallPanel test coverage for
isGitHubAppRepoAccessPending by adding cases for the other error-string branches
in GitHubAppInstallPanel.tsx, including “repository not found” and “could not
resolve to a repository,” plus the early-return guards for relayConfigured
false, installed true, and a non-"error" state. Use makeStatus,
isGitHubAppRepoAccessPending, and statusView to verify each branch returns the
expected false or pending behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dd8e3720-78f1-416a-aa70-50352c5fa34a

📥 Commits

Reviewing files that changed from the base of the PR and between 5e95ed6 and 0be7dbb.

⛔ Files ignored due to path filters (1)
  • docs/features/onboarding-and-settings/README.md is excluded by !docs/**
📒 Files selected for processing (2)
  • apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.test.ts
  • apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.tsx

Comment thread apps/desktop/src/renderer/components/github/GitHubAppInstallPanel.tsx Outdated
@arul28

arul28 commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 2c9943b39b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@arul28 arul28 merged commit 8b753e2 into main Jul 2, 2026
29 checks passed
@arul28 arul28 added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Jul 2, 2026
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.

1 participant