fix: use correct PAT URL based on GitLab instance version

What does this MR do and why?

Fixes #8377 (closed).

getAccessTokenTip was printing the URL /-/user_settings/personal_access_tokens/legacy/new for all GitLab instances. This URL was introduced in GitLab 19 and returns a 404 on GitLab < 19.

This MR fetches the GitLab instance version via the Metadata API before showing the token prompt. If the major version is < 19, it falls back to the correct URL /-/user_settings/personal_access_tokens. If the version cannot be fetched, it defaults to the /legacy/new URL (safe for GitLab 19+).

MR acceptance checklist

  • This MR does not break existing tests
  • New test added for getAccessTokenTip covering both version branches
  • No documentation changes needed (no new flags or commands)

How has this been tested?

  • Unit tests added for getAccessTokenTip covering three cases:
    • GitLab >= 19: uses /legacy/new path
    • GitLab < 19 (e.g. 18.8): uses /personal_access_tokens path
    • Empty version (fetch failed): falls back to /legacy/new path
  • Ran go test ./internal/commands/auth/login/... — all tests pass
  • Ran make lint — 0 issues

Merge request reports

Loading
Loading