Conversation
Let users link GitLab accounts and use GitLab repositories anywhere the app previously required GitHub so project mapping, metadata sync, and leaderboard eligibility work across both hosts.
Greptile SummaryThis PR integrates GitLab as a second supported OAuth provider and repo host — adding account linking/unlinking, project-repo mapping validation, metadata sync via the new All remaining findings are minor P2 suggestions. Confidence Score: 5/5Safe to merge — implementation is correct and consistent with existing patterns. Both remaining findings are P2: one is a one-word blurb fix, the other is a note about deferred auto-scan functionality that is already acknowledged via commented-out code elsewhere in the repo. No blocking defects were found. app/models/concerns/oauth_authentication.rb (no GitLab scan job on link) and app/javascript/pages/Users/Settings/types.ts (stale blurb text). Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant App as Hackatime
participant GL as GitLab OAuth
U->>App: GET /auth/gitlab
App->>App: Generate nonce, store in session
App->>GL: Redirect to /oauth/authorize
GL->>U: Show authorization page
U->>GL: Approve
GL->>App: GET /auth/gitlab/callback?code=&state=
App->>App: Validate state nonce
App->>GL: POST /oauth/token
GL->>App: access_token
App->>GL: GET /api/v4/user
GL->>App: id, username, avatar_url
App->>App: Clear other users with same gitlab_uid
App->>App: Save gitlab_uid/username/token to current_user
App->>U: Redirect to settings with success notice
Prompt To Fix All With AIThis is a comment left during a code review.
Path: app/javascript/pages/Users/Settings/types.ts
Line: 283
Comment:
**Stale sidebar blurb**
The `integrations` section blurb still reads `"Slack status, GitHub link, and email sign-in addresses."` — it doesn't mention GitLab, which is now a first-class integration on this page.
```suggestion
blurb: "Slack status, GitHub and GitLab links, and email sign-in addresses.",
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: app/models/concerns/oauth_authentication.rb
Line: 228-229
Comment:
**No GitLab repo auto-scan on link**
`from_github_token` calls `ScanGithubReposJob.perform_later(current_user.id)` after linking, which auto-discovers project-repo mappings for the user's existing heartbeat projects. `from_gitlab_token` has no equivalent, so users who link GitLab won't get automatic mapping suggestions for their GitLab projects. The commented-out GitLab cases in `sync_user_events_job.rb` indicate this is deferred work — a brief comment here would clarify the intentional omission.
How can I resolve this? If you propose a fix, please make it concise.Greploops — Automatically fix all review issues by running Reviews (2): Last reviewed commit: "Address GitLab review feedback" | Re-trigger Greptile |
Reuse a shared Inertia unlink modal for OAuth providers and memoize the parsed GitLab user payload so the response body is only consumed once.
|
@greptileai review |
Summary
Validation