Adopt httpware decoder paths in GitLabProvider#3
Merged
Conversation
Follow-on to the 2026-06-07 migration: switch GitLabProvider's three GETs onto httpware's response_model=/send_with_response decoder paths, delete the six in-tree _validate_* helpers, extend translate_gitlab with a DecodeError branch. Requires httpware>=0.8.2 (DecodeError + send_with_response). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Four-task plan derived from the 2026-06-08-httpware-decoder-adoption design spec. Order: floor httpware>=0.8.2, TDD the DecodeError branch in translate_gitlab, rewrite the 3 GETs onto decoder paths + update 9 test assertions, final validation. Resolves all three spec open items inline (RootModel availability, exact assertion count + line numbers, unused imports). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-tree validators Co-Authored-By: Claude Sonnet 4.6 <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
Closes the loop on the httpware migration: switches
GitLabProvider's three GET methods to use httpware 0.8.2'sresponse_model=/send_with_responsedecoder paths and deletes the six in-tree validator helpers that existed only because the initial migration bypassed the decoder.get_default_branch→client.get(url, response_model=_ProjectResponse)get_latest_commit_on_default_branch→client.get(url, response_model=_CommitList)where_CommitList = RootModel[list[_CommitItem]]list_tags→client.send_with_response(req, response_model=_TagList)(needs the response back too for theLinkheader)create_tagunchanged (POST, no body to decode)_errors.translate_gitlabgains aDecodeError → ProviderAPIErrorbranch in_translate_gitlab_transporthttpware[pydantic]>=0.8.2(requiresDecodeError+send_with_response, both added upstream as part of this work)Net: 6 validator helpers + 1 TypeVar deleted from
gitlab.py, 2RootModelwrappers added, 9 integration test assertions retargeted to the new translated wording.Design spec:
planning/specs/2026-06-08-httpware-decoder-adoption-design.mdImplementation plan:
planning/plans/2026-06-08-httpware-decoder-adoption.mdTest plan
just lint-ci— clean (ruff format + ruff check + ty)just test— 333 passed, 100% statement+branch coveragemkdocs build --strict— cleanDecodeErrorandClient.send_with_responseboth importable from the resolved 0.8.2PydanticDecoderraises →DecodeError→except httpware.ClientError→translate_gitlab→_translate_gitlab_transport→ProviderAPIError("GitLab _ProjectResponse response could not be decoded: ..."))🤖 Generated with Claude Code