Skip to content

feat(cli): add lib/gitlab.axl HTTP client (ENG-1648)#1079

Merged
jeffpignataro merged 2 commits into
mainfrom
jeff/feat/eng-1648-gitlab-axl-http-client
May 14, 2026
Merged

feat(cli): add lib/gitlab.axl HTTP client (ENG-1648)#1079
jeffpignataro merged 2 commits into
mainfrom
jeff/feat/eng-1648-gitlab-axl-http-client

Conversation

@jeffpignataro
Copy link
Copy Markdown
Contributor

Summary

Adds lib/gitlab.axl — a GitLab REST client mirroring the call-site shape of lib/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_path

Auth

Intentionally not implemented here. Callers pass a token they obtained however; auth_kind toggles between PRIVATE-TOKEN (PATs, group/project access tokens — the MVP path) and Authorization: Bearer (OAuth / Aspect GitLab App once ENG-1650 lands).

Verification

Smoke task wired via .aspect/config.axl:

aspect dev test-gitlab-client

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-client passes locally
  • GitHub regression smokes still pass
  • CI build green
  • Reviewer with Marvin/code-review context confirms shape matches lib/github.axl

Why no HTTP unit tests

lib/github.axl has 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.axl etc.) 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

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
Copy link
Copy Markdown

aspect-workflows Bot commented May 13, 2026

✨ Aspect Workflows Tasks

📅 Wed May 13 23:18:18 UTC 2026

✅ 16 successful tasks

  • ✅ build (build-gha) · ⏱ 1m 12s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (161 built)
  • ✅ build (build-gha-debug) · ⏱ 1m 57s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (161 built)
  • ✅ format (buildifier-gha) · ⏱ 1m 33s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format (buildifier-gha-debug) · ⏱ 1m 21s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ delivery (delivery-gha) · ⏱ 1m 47s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered)
  • ✅ delivery (delivery-gha-debug) · ⏱ 1m 58s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered)
  • ✅ format (format-gha) · ⏱ 1m 20s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format (format-gha-debug) · ⏱ 1m 18s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle (gazelle-from-source-gha) · ⏱ 1m 25s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-from-source-gha-debug) · ⏱ 1m 21s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-gha) · ⏱ 1m 20s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-gha-debug) · ⏱ 1m 11s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ lint (lint-gha) · ⏱ 1m 29s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ lint (lint-gha-debug) · ⏱ 1m 21s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ test (test-gha) · ⏱ 1m 19s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)
  • ✅ test (test-gha-debug) · ⏱ 2m 3s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)

Powered by Aspect Build · GitHub · X · LinkedIn · YouTube

@jeffpignataro jeffpignataro marked this pull request as ready for review May 13, 2026 23:06
@jeffpignataro jeffpignataro requested a review from gregmagolan May 13, 2026 23:06
@jeffpignataro jeffpignataro self-assigned this May 13, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/aspect-cli/src/builtins/aspect/lib/gitlab.axl
Comment thread crates/aspect-cli/src/builtins/aspect/lib/gitlab.axl
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>
@jeffpignataro jeffpignataro merged commit e8303a1 into main May 14, 2026
45 checks passed
@jeffpignataro jeffpignataro deleted the jeff/feat/eng-1648-gitlab-axl-http-client branch May 14, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant