23: Switch GitLab MR creation from CLI to REST API #188
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-23/switch-gitlab-mr-creation-from-cli-to-rest-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
23: Switch GitLab MR creation from CLI to REST API
Implements 23.
Generated in 6m 00s.
Review findings
Now let me look at how
MrClientErrorandmrClientErrorFromStatusbuild the message/context:All the pieces make sense. Now let me apply the three fixes to the test file.Now run the gates:All 17 tests pass. Now the full gates:Build and lint clean. Now full test suite:All gates green: build clean, lint clean, 1516 tests pass (up from 1511 — added 5 new tests). All three findings resolved.Review Findings — GL-23
Summary
All three findings resolved in a single pass. Build, test, and lint gates all pass (
npm run buildclean,npm run lintclean,npm test= 1516 passed / 117 files, up from 1511 after adding 5 targeted tests). Changes are test-only, consistent with the existing parametrized style ingitLabMrClient.test.ts:retry: { maxAttempts: 3, baseDelayMs: 0 }assertingfetchis called exactly once, proving non-retriable errors short-circuit the retry loop.fetchcalled twice) and a 429 retried-to-exhaustion test (fetchcalled 3 times).GitLab MR createcontext and theg/prepo.Critical
High
Medium
retry: { maxAttempts: 1 }for all cases, so it cannot verify the client's documented invariant that "Fail-fast errors (401/403/404) are not retried" (gitLabMrClient.ts:44). WithmaxAttempts: 1even a retriable 429/500 would only be called once, so the no-retry behavior for non-retriable kinds is untested. Suggested fix: add a case (or a dedicated test) withretry: { maxAttempts: 3, baseDelayMs: 0 }for a 401/403/404 that assertsexpect(fetch).toHaveBeenCalledTimes(1), proving fail-fast errors short-circuit the retry loop.Low
maxAttempts(good), but there is no complementary assertion that a 429 (alsoretriable: true) is retried, and no test that a transient status which succeeds on the 2nd attempt returns a result. Suggested fix: add a case where the fetch returns500then201withmaxAttempts: 3and assert the MR is created andfetchwas called twice, exercising the retry-then-success path.[status, kind, retriable]tuple asserts againstMrClientErrorfields but does not assert the errormessage/contextpropagation (the client passescontext: 'GitLab MR create for ...'). Suggested fix: optionally assert the thrown error message includes the repo/context so regressions in error messaging are caught.