Skip to content

Connect GitHub Rock to its Ktor backend - #144

Merged
SayanthRock merged 20 commits into
mainfrom
integration/backend-v1
Jul 23, 2026
Merged

Connect GitHub Rock to its Ktor backend#144
SayanthRock merged 20 commits into
mainfrom
integration/backend-v1

Conversation

@SayanthRock

@SayanthRock SayanthRock commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

User description

End-to-end backend connection

  • adds a Retrofit contract for backend health, config, Device Flow start/poll, and token refresh
  • adds a runtime HTTPS endpoint store with build-time GITHUB_ROCK_BACKEND_URL support
  • adds a native Backend connection centre under App information
  • tests /v1 compatibility before saving the endpoint
  • enforces API version, maintenance mode, minimum app version, and OAuth feature flags
  • shows dependency health, API version, maintenance state, and feature availability

Authentication

  • prefers the backend for Device Flow and token refresh
  • preserves access-token and refresh-token expiry metadata
  • keeps direct GitHub Device Flow as a fail-safe when the backend is unavailable or incompatible
  • never embeds the OAuth client secret in Android

Security

  • accepts HTTPS endpoints only
  • rejects URLs containing credentials, queries, or fragments
  • keeps normal repository, issue, PR, Actions, release, and download operations directly authorized by GitHub

CI and documentation

  • supports the GITHUB_ROCK_BACKEND_URL Actions variable in CI and signed release builds
  • adds endpoint, compatibility, token mapping, and exact HTTP path tests
  • updates App information Compose coverage
  • documents deployment and production readiness checks

Coordinated backend

Companion backend PR: Sayanthrock-Developer/GitHub-Rock-Backend#24

Supersedes stale PR #143, whose GitHub metadata did not advance to the branch's final commits.

Validation required

  • unit tests
  • Compose UI-test compilation
  • Android lint
  • debug APK
  • release APK
  • verification artifact upload

CodeAnt-AI Description

Connect GitHub Rock to an optional backend for login and app status checks

What Changed

  • GitHub Rock can now save and test a backend URL from App information, then show backend health, version, maintenance state, and available features
  • Device Flow login and token refresh use the backend when connected, with direct GitHub login kept as a fallback if the backend is unavailable
  • Only secure HTTPS backend URLs are accepted, and unsafe URLs with credentials, queries, or fragments are rejected
  • The app now checks backend compatibility before saving or using it, including API version, minimum app version, maintenance mode, and required feature flags
  • Release builds, CI, and docs now support configuring the backend URL at build time

Impact

✅ Faster sign-in when the backend is available
✅ Fewer login failures during backend maintenance
✅ Clearer backend connection status in the app

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Copilot AI review requested due to automatic review settings July 23, 2026 08:41
@codeant-ai

codeant-ai Bot commented Jul 23, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR bf3a592 Jul 23, 2026 · 08:41 08:49

Updated in place by CodeAnt AI · last 5 reviews

Copilot AI 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.

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

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@SayanthRock, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c0ff0a57-6375-44e0-8361-9712f1ca5d72

📥 Commits

Reviewing files that changed from the base of the PR and between a274d95 and 73eab1a.

📒 Files selected for processing (13)
  • .github/workflows/android-ci.yml
  • .github/workflows/release.yml
  • app/build.gradle.kts
  • app/src/androidTest/java/com/sayanthrock/githubrock/AppInformationScreenTest.kt
  • app/src/main/java/com/sayanthrock/githubrock/core/network/GitHubRockBackendApi.kt
  • app/src/main/java/com/sayanthrock/githubrock/data/auth/DeviceFlowAuthRepository.kt
  • app/src/main/java/com/sayanthrock/githubrock/data/backend/BackendGateway.kt
  • app/src/main/java/com/sayanthrock/githubrock/ui/screens/AppInformationScreen.kt
  • app/src/main/java/com/sayanthrock/githubrock/ui/screens/BackendConnectionScreen.kt
  • app/src/test/java/com/sayanthrock/githubrock/BackendApiPathTest.kt
  • app/src/test/java/com/sayanthrock/githubrock/BackendContractTest.kt
  • docs/BACKEND_CONNECTION.md
  • local.properties.example
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch integration/backend-v1

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Jul 23, 2026
Copilot AI review requested due to automatic review settings July 23, 2026 08:42

@ai-coding-guardrails ai-coding-guardrails 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.

I've got 3 comments for you to consider

Risk: 🟢 Low

Risk analysis

The highest scoring dimensions are blast_radius, security_impact, and operational_risk. The PR introduces a new backend connection feature affecting authentication flows across the app, with changes in DeviceFlowAuthRepository and BackendGateway that handle sensitive token operations — increasing security and operational risk. The blast_radius is elevated due to modifications across 13 files including core network logic, UI screens, build configurations, and documentation, impacting multiple components. While test coverage for the new functionality appears reasonable with added unit and contract tests, the presence of race condition bugs in critical auth and backend gateway components contributes to moderate scores in security_impact and operational_risk.

Reviewed with 🤟 by Zenable

Copilot AI 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.

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

@ai-coding-guardrails ai-coding-guardrails Bot added the zenable/risk:low Zenable assessed this PR as LOW risk. label Jul 23, 2026
Copilot AI review requested due to automatic review settings July 23, 2026 08:44

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 08:47

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 08:49

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 08:50

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 08:50

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 08:54

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 08:55

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 08:56

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 09:00

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 09:03

Copilot AI 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.

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

Copilot AI review requested due to automatic review settings July 23, 2026 09:04

Copilot AI 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.

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

@SayanthRock
SayanthRock merged commit 65bce7a into main Jul 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files zenable/risk:low Zenable assessed this PR as LOW risk.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants