Connect to GitLab from onboarding and the host picker #141

Closed
opened 2026-10-12 07:51:40 -05:00 by deadstyle · 6 comments
Owner

Problem

Even with the adapter built, nobody can pick GitLab: onboarding lists it as "coming soon", connecting rejects the type, and the sign-in screen has no GitLab token page or scopes. Parent: #137. Depends on #138; pick this up after #138 merges.

Acceptance criteria

  • Onboarding's Forge type step lets you select GitLab, and no type is left "coming soon" (design.md → Onboarding step 2).
  • The Address step is pre-filled with https://gitlab.com for GitLab and accepts a self-managed address (design.md → Onboarding step 3, as for GitHub; #137).
  • The Address step checks that the server is reachable and really is GitLab; a mismatch gets "That server runs X, not Y", and an address with no forge API names the chosen type (design.md → Onboarding step 3).
  • The Sign in step for GitLab links to <web root>/-/user_settings/personal_access_tokens?name=lazyforge&scopes=api and lists the one scope needed: api (repos, MRs, pipelines, merging, approving, closing, issues, comments, labels, Renovate dashboard ticks, running Renovate). read_api is not enough. Failure messages name GitLab's scope (design.md → Onboarding step 4).
  • A host with type = "gitlab" connects from the picker, --host and Settings → add host (design.md → Settings).
  • MRs are called "MR" wherever the UI says "PR" for the other forges (architecture.md → HostInfo.ChangeRequestTerm). Check every user-facing "PR" string reads the term.
  • docs/design.md records the GitLab token page and scope under Onboarding step 4, moves the GitLab adapter out of "After v1" (the PM's call on 2026-10-12, #137), and the README lists GitLab as supported.

Plan

  • cmd/lazyforge/main.go: connect sends gitlab to gitlab.New (default URL https://gitlab.com when the config omits it, as github does). Add gitlab.Probe to the probe list after gitea and github.
  • internal/ui/onboarding.go: raise selectableForges to 4. Add a gitlabHelp entry to the per-kind help table and pre-fill the address for GitLab. Update the onboarding test that expects GitLab to be "coming soon".
  • Audit user-facing "PR" strings in internal/ui against ChangeRequestTerm.
  • Tests: onboarding Update/View for the GitLab path, cmd test that connect routes gitlab. Verify in tmux at 80x24.

Context

  • Precedent: #86 (GitHub). Onboarding: internal/ui/onboarding.go (forgeRows, selectableForges, forgeHelp, helpFor, signInError). Connect: cmd/lazyforge/main.go:125-152.
  • glab auth token can serve as a token_cmd.

Out of scope

The [3] box title on GitLab (#145). The adapter itself (#138–#140).

## Problem Even with the adapter built, nobody can pick GitLab: onboarding lists it as "coming soon", connecting rejects the type, and the sign-in screen has no GitLab token page or scopes. Parent: #137. **Depends on #138**; pick this up after #138 merges. ## Acceptance criteria - Onboarding's Forge type step lets you select GitLab, and no type is left "coming soon" *(design.md → Onboarding step 2)*. - The Address step is pre-filled with `https://gitlab.com` for GitLab and accepts a self-managed address *(design.md → Onboarding step 3, as for GitHub; #137)*. - The Address step checks that the server is reachable and really is GitLab; a mismatch gets "That server runs X, not Y", and an address with no forge API names the chosen type *(design.md → Onboarding step 3)*. - The Sign in step for GitLab links to `<web root>/-/user_settings/personal_access_tokens?name=lazyforge&scopes=api` and lists the one scope needed: `api` (repos, MRs, pipelines, merging, approving, closing, issues, comments, labels, Renovate dashboard ticks, running Renovate). `read_api` is not enough. Failure messages name GitLab's scope *(design.md → Onboarding step 4)*. - A host with `type = "gitlab"` connects from the picker, `--host` and Settings → add host *(design.md → Settings)*. - MRs are called "MR" wherever the UI says "PR" for the other forges *(architecture.md → `HostInfo.ChangeRequestTerm`)*. Check every user-facing "PR" string reads the term. - `docs/design.md` records the GitLab token page and scope under Onboarding step 4, moves the GitLab adapter out of "After v1" (the PM's call on 2026-10-12, #137), and the README lists GitLab as supported. ## Plan - `cmd/lazyforge/main.go`: `connect` sends `gitlab` to `gitlab.New` (default URL `https://gitlab.com` when the config omits it, as github does). Add `gitlab.Probe` to the probe list after gitea and github. - `internal/ui/onboarding.go`: raise `selectableForges` to 4. Add a `gitlabHelp` entry to the per-kind help table and pre-fill the address for GitLab. Update the onboarding test that expects GitLab to be "coming soon". - Audit user-facing "PR" strings in `internal/ui` against `ChangeRequestTerm`. - Tests: onboarding `Update`/`View` for the GitLab path, cmd test that `connect` routes `gitlab`. Verify in tmux at 80x24. ## Context - Precedent: #86 (GitHub). Onboarding: `internal/ui/onboarding.go` (`forgeRows`, `selectableForges`, `forgeHelp`, `helpFor`, `signInError`). Connect: `cmd/lazyforge/main.go:125-152`. - `glab auth token` can serve as a `token_cmd`. ## Out of scope The `[3]` box title on GitLab (#145). The adapter itself (#138–#140).
Author
Owner

🤖 Decision needed: what should box [3] be called on a GitLab host? design.md names it "Actions", which is Forgejo's and GitHub's word. GitLab calls the same thing "Pipelines".

  1. "Pipelines" on GitLab, "Actions" elsewhere. The box uses the word GitLab users see on gitlab.com, the same way "PR" becomes "MR" on GitLab. Cost: none. It's one string chosen by forge type.
  2. "Actions" everywhere. Every host looks the same. Cost: on GitLab the title doesn't match what the forge calls it.

Recommendation: 1. It follows the PR/MR precedent, and GitLab users won't go looking for an "Actions" box.

The rest of this ticket doesn't depend on the answer. It's parked only so this gets settled before it ships.

🤖 **Decision needed:** what should box `[3]` be called on a GitLab host? design.md names it "Actions", which is Forgejo's and GitHub's word. GitLab calls the same thing "Pipelines". 1. **"Pipelines" on GitLab, "Actions" elsewhere.** The box uses the word GitLab users see on gitlab.com, the same way "PR" becomes "MR" on GitLab. Cost: none. It's one string chosen by forge type. 2. **"Actions" everywhere.** Every host looks the same. Cost: on GitLab the title doesn't match what the forge calls it. **Recommendation:** 1. It follows the PR/MR precedent, and GitLab users won't go looking for an "Actions" box. The rest of this ticket doesn't depend on the answer. It's parked only so this gets settled before it ships.
Author
Owner

🤖 The box [3] naming question moved to #145, so this ticket is unparked.

🤖 The box `[3]` naming question moved to #145, so this ticket is unparked.
Author
Owner

🤖 Picked up through composer-lite on branch feature/141-gitlab-connect; the plan is this ticket body.

🤖 Picked up through composer-lite on branch `feature/141-gitlab-connect`; the plan is this ticket body.
Author
Owner

🤖 Amended in delivery: the Sign in link drops the ?name=lazyforge&scopes=api prefill, because the full URL clips at 80 columns. The api scope is still listed under the link.

🤖 Amended in delivery: the Sign in link drops the `?name=lazyforge&scopes=api` prefill, because the full URL clips at 80 columns. The `api` scope is still listed under the link.
Author
Owner

🤖 MR open: #146

🤖 MR open: https://git.bobparsons.dev/deadstyle/lazyforge/pulls/146
Author
Owner

🤖 merged: #146

🤖 merged: https://git.bobparsons.dev/deadstyle/lazyforge/pulls/146
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
deadstyle/lazyforge#141
No description provided.