Skip to content

Add GitHub profile integration for Developer Tools card - #80

Merged
vitorhugo-dotnet merged 1 commit into
mainfrom
claude/job-application-filtering-qbpk8g
Aug 25, 2026
Merged

Add GitHub profile integration for Developer Tools card#80
vitorhugo-dotnet merged 1 commit into
mainfrom
claude/job-application-filtering-qbpk8g

Conversation

@vitorhugo-dotnet

Copy link
Copy Markdown
Owner

Summary

Adds a new GitHub profile integration feature that allows the application to display a linked GitHub account in the Developer Tools screen. The integration resolves GitHub accounts by their stable numeric user ID rather than username, ensuring the reference remains valid even after username changes.

Key Changes

  • GitHubProfileService: New service that manages GitHub profile resolution with the following capabilities:

    • Resolves accounts by stable numeric user ID (primary) or legacy username (fallback)
    • Implements automatic migration from username-only to ID-based configuration
    • Caches profiles with configurable TTL to minimize API calls
    • Gracefully degrades to cached or configured fallback profiles when GitHub API is unreachable
    • Follows GitHub username changes automatically since lookups use the immutable numeric ID
  • GitHubProperties: Configuration component supporting:

    • app.github.user-id: Stable numeric user ID (canonical identity)
    • app.github.login: Legacy/bootstrap username for backward compatibility
    • app.github.api-base-url: GitHub API endpoint (defaults to public API)
    • app.github.token: Optional personal access token for higher rate limits
    • app.github.cache-ttl-seconds: Profile cache duration (default 1 hour)
    • app.github.timeout-ms: HTTP request timeout (default 5 seconds)
  • GitHubController: REST endpoint (GET /api/v1/github/profile) that:

    • Requires authentication
    • Returns the current GitHub profile with user ID, login, profile URL, and avatar
    • Includes a stale flag indicating whether the data is from cache/fallback
  • GitHubProfileResponse: DTO representing the resolved GitHub profile with schema documentation

  • Comprehensive test coverage:

    • Unit tests covering profile resolution, caching, legacy migration, and error handling
    • Integration test verifying the endpoint works end-to-end with fallback behavior

Notable Implementation Details

  • The service uses Spring's RestClient for GitHub API communication with configurable timeouts
  • Numeric user ID is the canonical identity; usernames are presentation data only
  • Legacy username-only configurations are automatically migrated to ID-based lookups on first resolution
  • Graceful degradation: serves stale cached profiles or configured fallback when GitHub is unreachable
  • Proper error handling: throws ResourceNotFoundException when no account is configured, ServiceUnavailableException when GitHub fails with no fallback

https://claude.ai/code/session_01ADchmECT1CRCXjKbx8BACV

The Developer Tools -> Source Code reference was built from a username, which
GitHub lets an account change at any time, silently breaking the link. Address
the account by its numeric user ID instead and expose the resolved profile to
the frontend.

- GitHubProperties: app.github.user-id is the canonical identity of the
  integration; app.github.login is kept only as a bootstrap value for legacy
  setups and as a presentation fallback.
- GitHubProfileService: resolves GET /user/{id} and returns the login and
  html_url GitHub currently reports, so a rename keeps the reference valid. A
  username-only configuration is resolved once through GET /users/{login} and
  addressed by the recovered ID from then on. Answers are cached (1h by
  default); when GitHub is unreachable the last known profile - or the
  configured login - is served flagged as stale. A numeric ID is never turned
  into a guessed profile URL.
- GET /api/v1/github/profile returns userId, login, htmlUrl, avatarUrl, stale.

Refs #77

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADchmECT1CRCXjKbx8BACV
@github-actions github-actions Bot added documentation Improvements or additions to documentation backend tests configuration labels Aug 25, 2026
@github-actions

Copy link
Copy Markdown

Qodana for JVM

3 new problems were found

Inspection name Severity Problems
Nullability and data flow problems 🔶 Warning 1
Mismatched query and update of 'StringBuilder' 🔶 Warning 1
Simplifiable conditional expression 🔶 Warning 1
View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@vitorhugo-dotnet
vitorhugo-dotnet merged commit 9e14251 into main Aug 25, 2026
6 checks passed
@vitorhugo-dotnet
vitorhugo-dotnet deleted the claude/job-application-filtering-qbpk8g branch August 25, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend configuration documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants