httpware 0.12 + opt-in patch bump for non-merge commits (branch-prefix) by lesnik512 · Pull Request #24 · modern-python/semvertag · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions CLAUDE.md
5 changes: 5 additions & 0 deletions architecture/strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ of the message (via `subject_line`, below) and applies, in order:
request"`, so an ordinary GitHub PR merge-commit subject
(`Merge pull request #N from owner/feature/...`) and a GitLab merge-commit
subject both qualify under the defaults; a plain non-merge commit does not.
When `config.patch_on_non_merge_commit` is `True` (default `False`), this
non-merge case returns `Bump.PATCH` instead of `Bump.NONE`, so a direct push
to the default branch auto-tags a patch release. The flag governs only this
exit — a merge commit with an unrecognized prefix (step 4) still returns
`Bump.NONE`.
2. If any string in `config.minor` appears in the subject, return `Bump.MINOR`.
Default: `("feature/",)`.
3. If any string in `config.patch` appears, return `Bump.PATCH`. Default:
Expand Down
9 changes: 8 additions & 1 deletion docs/strategies/branch-prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ means:

- Standard `git merge feature/foo` → subject `Merge branch 'feature/foo' into main` → bump = minor ✓
- GitHub's `Merge pull request #N from user/feature/foo` → bump = minor ✓
- Direct pushes to the default branch → bump = none.
- Direct pushes to the default branch → bump = none, unless
`patch_on_non_merge_commit` is enabled (see below), in which case
bump = patch.

The `merge_mark_texts` tuple is configurable (defaults to
`("Merge branch", "Merge pull request")`); adapt it for non-default
Expand All @@ -46,6 +48,11 @@ The strategy reads its prefixes from the application's settings layer:
`("bugfix/", "hotfix/")`).
- `merge_mark_texts` — tuple of substrings that mark a subject as a
merge commit (default `("Merge branch", "Merge pull request")`).
- `patch_on_non_merge_commit` — when `true`, a plain (non-merge) commit on
the default branch bumps patch instead of producing no bump (default
`false`). Set via `SEMVERTAG_BRANCH_PREFIX__PATCH_ON_NON_MERGE_COMMIT=true`.
Affects only the non-merge case; a merge commit with an unrecognized prefix
still produces no bump.

These are set via the same pydantic-settings env-var mechanism used
for tokens / endpoints — see the provider docs for the variable
Expand Down
6 changes: 6 additions & 0 deletions planning/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ _None._

### Archived (shipped)

- **[branch-prefix-patch-on-non-merge](changes/archive/2026-06-16.02-branch-prefix-patch-on-non-merge/design.md)**
(#24, 2026-06-16) — Opt-in `patch_on_non_merge_commit` flag: a non-merge HEAD
commit bumps patch instead of nothing.
- **[httpware-0.12-get-with-response](changes/archive/2026-06-16.01-httpware-0.12-get-with-response/change.md)**
(#24, 2026-06-16) — Bump httpware to 0.12.0; adopt `get_with_response` at the
pagination call sites.
- **[portable-planning-convention](changes/archive/2026-06-13.01-portable-planning-convention/design.md)**
(#21, 2026-06-13) — Adopt the portable two-axis convention: `architecture/`
truth home + `changes/` bundles, migrate the 15 spec/plan pairs, fresh Index.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
status: shipped
date: 2026-06-16
slug: httpware-0.12-get-with-response
supersedes: null
superseded_by: null
pr: 24
outcome: Shipped. httpware floor raised to >=0.12.0; both Link-header pagination
call sites now use get_with_response. No behavior change; no architecture
contract moved.
---

# Change: Bump httpware to 0.12.0 and adopt get_with_response in pagination

**Lane:** lightweight — net change is a dependency-floor bump plus a two-line
mechanical refactor at the two pagination call sites. Four files touched, but
`pyproject.toml` + `uv.lock` are dependency config and the code delta is a
straight 1:1 method swap with no behavior change. No public-API change.

## Goal

We pin `httpware[pydantic]>=0.8.2` (lock 0.8.2) while latest is 0.12.0 — every
intervening release is additive/no-break. Raise the floor to `>=0.12.0` and
adopt 0.12.0's `get_with_response`, which collapses the
`send_with_response(build_request("GET", ...))` pair used for Link-header
pagination into a single call. Picks up 0.11.0's security/correctness hardening
(URL secret redaction, RetryBudget fix) for free via the version move.

## Approach

`get_with_response(url, *, params=..., response_model=...) -> tuple[Response, T]`
is the ergonomic shortcut for "raw response + typed body in one call" — exactly
the pagination shape in both providers. Swap the two call sites; behavior is
identical (same request, same returned `(response, page)` tuple), so existing
pagination tests stay green. No `architecture/` contract moves — the providers'
external behavior is unchanged; the HTTP-client prose in `providers.md` does not
name `send_with_response`/`build_request`, so no doc edit is required.

Deferred (not in this bundle): adopting `max_error_body_bytes` /
`ResponseTooLargeError` from 0.11.0 — that's a real behavior/config decision.

## Files

- `pyproject.toml` — `httpware[pydantic]>=0.8.2` → `>=0.12.0`
- `uv.lock` — relock via `uv lock`
- `semvertag/providers/gitlab.py` — `list_tags` call site → `get_with_response`
- `semvertag/providers/github.py` — `list_tags` call site → `get_with_response`

## Verification

- [x] `uv lock` resolves httpware to 0.12.0.
- [x] Refactor both call sites to `get_with_response`.
- [x] `just test` — 428 passed (existing pagination tests cover behavior).
- [x] `just lint-ci` — clean (ruff format, ruff check, ty all pass).
Loading