feat(cli): add lib/gitlab.axl HTTP client (ENG-1648)#1079
Merged
Conversation
Mirrors the lib/github.axl shape so the upcoming GitLab features
(ENG-1651) can call into the right backend with the same call-site
ergonomics as the GitHub path.
Surfaces:
- commit_status.{post,pending,running,success,failed,canceled,skipped}
(POST /projects/:id/statuses/:sha — free tier on every GitLab plan)
- external_status_checks.{respond,list}
(POST /projects/:id/merge_requests/:iid/status_check_responses —
Premium/Ultimate tier, registered checks)
- notes.{list,create,update,delete}
(MR comments — the GitLab equivalent of GitHub issue comments)
- merge_requests.{get,list_changes}
- encode_project_path / extract_host / extract_project_path
Auth is intentionally not implemented here. Callers pass a token they
obtained however they like; `auth_kind` toggles between PRIVATE-TOKEN
(PATs, group/project access tokens) and Authorization: Bearer (OAuth /
Aspect GitLab App once ENG-1650 lands).
Smoke task wired via .aspect/config.axl:
aspect dev test-gitlab-client
ENG-1648
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✨ Aspect Workflows Tasks📅 Wed May 13 23:18:18 UTC 2026 ✅ 16 successful tasks
Powered by Aspect Build · GitHub · X · LinkedIn · YouTube |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb0e0cc542
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Two fixes from codex PR review: - `_extract_host` now strips `user:password@` userinfo before locating the host boundary. GitLab CI populates `CI_REPOSITORY_URL` as `https://gitlab-ci-token:<job-token>@<host>/...`; the prior shape returned `gitlab-ci-token:<token>@<host>`, leaking the token into log lines and any derived API endpoint. Mirrors the userinfo-strip step already present in `lib/github.axl::_extract_host`. - `encode_project_path` now coerces its argument to string before iterating, so numeric project IDs (e.g. `CI_PROJECT_ID`) — which the docstring promised to support — round-trip unchanged instead of crashing on `int.elems()`. Smoke (`aspect dev test-gitlab-client`) extended with 6 new assertions covering both fixes: gitlab-ci-token, oauth2 PAT, bare user, an `@` in path (must not be treated as userinfo), numeric int ID, numeric string ID. All 18 assertions pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
lib/gitlab.axl— a GitLab REST client mirroring the call-site shape oflib/github.axl. Step 1 of the GitLab Marvin Implementation project.Surfaces
commit_status.{post,pending,running,success,failed,canceled,skipped}—POST /projects/:id/statuses/:sha(free tier, every GitLab plan)external_status_checks.{respond,list}—POST /projects/:id/merge_requests/:iid/status_check_responses(Premium/Ultimate)notes.{list,create,update,delete}— MR comments (GitLab equivalent of GitHub issue comments)merge_requests.{get,list_changes}encode_project_path/extract_host/extract_project_pathAuth
Intentionally not implemented here. Callers pass a token they obtained however;
auth_kindtoggles betweenPRIVATE-TOKEN(PATs, group/project access tokens — the MVP path) andAuthorization: Bearer(OAuth / Aspect GitLab App once ENG-1650 lands).Verification
Smoke task wired via
.aspect/config.axl:12 assertions covering URL helpers + input-validation branches on
commit_status.post/external_status_checks.respond(network paths deferred to ENG-1651 features + ENG-1652 dogfood). Existing GitHub regression smokes (test-template-snapshots,test-pr-comment-snapshots) re-run green.Test plan
aspect dev test-gitlab-clientpasses locallylib/github.axlWhy no HTTP unit tests
lib/github.axlhas no unit tests for its HTTP layer — the runtime doesn't expose an HTTP mock. Network paths are validated at the feature level (feature/github_status_comments_test.axletc.) once features wire in. Same pattern applied here: this PR's smoke covers the testable pure-fn + early-return surfaces; ENG-1651 + ENG-1652 cover the rest.ENG-1648