fix(webui): migrate Starlette TestClient to httpx2 (Closes #682) #884

Merged
sysadmin merged 2 commits from fix/issue-682-starlette-httpx2 into master 2026-07-24 18:11:02 -05:00
Owner

Summary

Starlette 1.3.x emits StarletteDeprecationWarning when starlette.testclient.TestClient falls back to plain httpx. Install and pin httpx2 so Web UI tests use the supported client path without warning filters.

Dependency versions

Package Before After
starlette 1.3.1 1.3.1 (unchanged)
httpx 0.28.1 0.28.1 (kept for MCP/runtime)
httpx2 not installed 2.9.1

Changes

  • Pin httpx2==2.9.1 in requirements.txt with a short note that runtime MCP still uses httpx.
  • Add tests/webui_testclient.py as the single intentional Web UI TestClient import surface.
  • Point all tests/test_webui_*.py modules at that helper.
  • Add tests/test_issue_682_starlette_httpx2.py proving import no longer warns and the helper client works.

Test plan

  • pytest tests/test_issue_682_starlette_httpx2.py tests/test_webui_audit.py -q → 12 passed
  • scripts/test-webui -q → 460 tests OK
  • No warning filter used to hide the deprecation

Closes #682

## Summary Starlette 1.3.x emits `StarletteDeprecationWarning` when `starlette.testclient.TestClient` falls back to plain `httpx`. Install and pin `httpx2` so Web UI tests use the supported client path without warning filters. ## Dependency versions | Package | Before | After | |---------|--------|-------| | starlette | 1.3.1 | 1.3.1 (unchanged) | | httpx | 0.28.1 | 0.28.1 (kept for MCP/runtime) | | httpx2 | not installed | **2.9.1** | ## Changes - Pin `httpx2==2.9.1` in `requirements.txt` with a short note that runtime MCP still uses `httpx`. - Add `tests/webui_testclient.py` as the single intentional Web UI `TestClient` import surface. - Point all `tests/test_webui_*.py` modules at that helper. - Add `tests/test_issue_682_starlette_httpx2.py` proving import no longer warns and the helper client works. ## Test plan - [x] `pytest tests/test_issue_682_starlette_httpx2.py tests/test_webui_audit.py -q` → 12 passed - [x] `scripts/test-webui -q` → 460 tests OK - [x] No warning filter used to hide the deprecation Closes #682
jcwalker3 added 1 commit 2026-07-24 16:30:40 -05:00
Starlette 1.3.x prefers httpx2 for starlette.testclient.TestClient; plain
httpx still works but emits StarletteDeprecationWarning.

- Pin httpx2==2.9.1 (keep httpx for MCP/runtime)
- Centralize Web UI TestClient import via tests/webui_testclient.py
- Point all test_webui_* modules at the helper
- Add regression tests that the deprecation warning is gone

Closes #682
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #884
issue: #682
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 85239-4f4db84a6d07
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884
phase: claimed
candidate_head: 5deb66c7f6
target_branch: master
target_branch_sha: 870843f999
last_activity: 2026-07-24T22:14:03Z
expires_at: 2026-07-24T22:24:03Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #884 issue: #682 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 85239-4f4db84a6d07 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884 phase: claimed candidate_head: 5deb66c7f66fc7b99ff017920161944f6f65ba7a target_branch: master target_branch_sha: 870843f999fb4bb8fc8c15ff7ede730448cdb3d4 last_activity: 2026-07-24T22:14:03Z expires_at: 2026-07-24T22:24:03Z blocker: none
sysadmin requested changes 2026-07-24 17:15:32 -05:00
Dismissed
sysadmin left a comment
Owner

Canonical PR State

STATE:
changes-requested

WHO_IS_NEXT:
author

NEXT_ACTION:
Package-qualify the webui_testclient import in the 18 rewritten tests/test_webui_*.py modules and in tests/test_issue_682_starlette_httpx2.py, drop the now-unneeded sys.path.insert in the latter, then re-request review at the new head.

NEXT_PROMPT:

Role: AUTHOR
Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools
Issue: #682 / PR #884

1. gitea_whoami + gitea_resolve_task_capability (prgs-author).
2. Bind the issue-682 branches/ worktree; never mutate the control root.
3. Apply:
   sed -i '' 's/^from webui_testclient import TestClient$/from tests.webui_testclient import TestClient/' tests/test_webui_*.py
   Apply the same rewrite in tests/test_issue_682_starlette_httpx2.py and delete its
   sys.path.insert(0, str(Path(__file__).resolve().parent)) line.
4. Prove isolation, not just aggregate green. All four must pass:
   pytest tests/test_webui_audit.py -q
   pytest tests/test_webui_audit.py tests/test_issue_682_starlette_httpx2.py -q
   scripts/test-webui
   python -m unittest tests.test_webui_audit
5. Push and re-request review. Do not rely on full-suite or scripts/test-webui green alone;
   neither exercises the failing path.

WHAT_HAPPENED:
Reviewed at head 5deb66c7f6 against base master 870843f999 in worktree branches/review-pr884. The dependency migration is correct and well-evidenced. The new shared import surface is not: tests/__init__.py exists, so tests/ is a package and pytest / unittest discover place the repo root on sys.path, never tests/. The helper is therefore only importable as tests.webui_testclient, but all 18 rewritten modules use the bare top-level name webui_testclient. Each of those modules now fails to import when run on its own.

The PR's three green signals all miss this. tests/test_issue_682_starlette_httpx2.py does sys.path.insert(0, ...parent) at import time, so whichever module imports first leaks tests/ onto the path for the rest of the process:

pytest tests/test_issue_682_...py tests/test_webui_audit.py   -> 12 passed   (the cited command)
pytest tests/test_webui_audit.py tests/test_issue_682_...py   -> ModuleNotFoundError

Same two files, reversed. scripts/test-webui passes for an unrelated reason (unittest discover -s tests inserts tests/ itself, and its test_webui_*.py pattern never loads the #682 module). Full pytest tests/ passes only because test_issue_682... sorts alphabetically ahead of test_webui_*.

Observed at this head:

pytest tests/test_webui_audit.py -q
  E   ModuleNotFoundError: No module named 'webui_testclient'
  !!! Interrupted: 1 error during collection !!!

python -m unittest tests.test_webui_audit
  ModuleNotFoundError: No module named 'webui_testclient'   FAILED (errors=1)

Fix verified in a scratch worktree (reverted, nothing pushed) — after package-qualifying the import: pytest tests/test_webui_audit.py 9 passed; reversed-order pair 12 passed; scripts/test-webui 460 OK; unittest tests.test_webui_audit 9 OK.

Also LOW / non-blocking: test_starlette_testclient_import_does_not_warn deletes starlette.testclient from sys.modules and re-imports without restoring, leaving a different class object in sys.modules while earlier importers still hold the original. Harmless today, but it is unrestored global state in a suite whose conftest.py otherwise resets aggressively. Consider unittest.mock.patch.dict(sys.modules).

WHY:
The stated goal is a single canonical Web UI TestClient import surface. As written that surface is unreachable under the project's own package layout for every consumer except one ordering accident, so the change makes 18 previously self-runnable test modules un-runnable in isolation. The fix is one mechanical rewrite and preserves every property the PR set out to achieve.

ISSUE:
#682

HEAD_SHA:
5deb66c7f6

REVIEW_STATUS:
request_changes

MERGE_READY:
no

BLOCKERS:
from webui_testclient import TestClient does not resolve under pytest or unittest discover because tests/ is a package (tests/__init__.py present); all 18 rewritten tests/test_webui_*.py modules fail to import in isolation. Blocking; fix is to import as tests.webui_testclient.

VALIDATION:

  • Scope confirmed: 21 files, +106/-18, matches the PR description; base 870843f, 0 commits behind, mergeable, no conflicts.
  • Premise verified against installed code: starlette 1.3.1 testclient.py:42 instructs pip install httpx2 and :48 emits the deprecation this PR removes. Package is github.com/pydantic/httpx2; starlette's full extra declares httpx2>=2.0.0, satisfied by the ==2.9.1 pin. pip check reports no broken requirements. Keeping httpx==0.28.1 for MCP/runtime is correct (separate top-level modules).
  • Regression check, full suite at both ends: base 870843f = 23 failed / 5099 passed; head 5deb66c = 23 failed / 5102 passed. Failure sets identical (comm diff empty both directions). Zero new failures; +3 are this PR's new tests.
  • Migration coverage complete: the four unconverted test_webui_* modules (architecture_docs, ci_gate, sanctioned_restart, worker_registry) do not use TestClient at all. Only remaining direct starlette.testclient imports are inside the helper and the deliberate deprecation probe.
  • No warning filter is used to suppress the deprecation, as claimed.
  • Blocking defect reproduced and the proposed fix re-verified across all four invocation paths, as recorded above.

LAST_UPDATED_BY:
sysadmin / prgs-reviewer / 2026-07-24

## Canonical PR State STATE: changes-requested WHO_IS_NEXT: author NEXT_ACTION: Package-qualify the `webui_testclient` import in the 18 rewritten `tests/test_webui_*.py` modules and in `tests/test_issue_682_starlette_httpx2.py`, drop the now-unneeded `sys.path.insert` in the latter, then re-request review at the new head. NEXT_PROMPT: ```text Role: AUTHOR Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools Issue: #682 / PR #884 1. gitea_whoami + gitea_resolve_task_capability (prgs-author). 2. Bind the issue-682 branches/ worktree; never mutate the control root. 3. Apply: sed -i '' 's/^from webui_testclient import TestClient$/from tests.webui_testclient import TestClient/' tests/test_webui_*.py Apply the same rewrite in tests/test_issue_682_starlette_httpx2.py and delete its sys.path.insert(0, str(Path(__file__).resolve().parent)) line. 4. Prove isolation, not just aggregate green. All four must pass: pytest tests/test_webui_audit.py -q pytest tests/test_webui_audit.py tests/test_issue_682_starlette_httpx2.py -q scripts/test-webui python -m unittest tests.test_webui_audit 5. Push and re-request review. Do not rely on full-suite or scripts/test-webui green alone; neither exercises the failing path. ``` WHAT_HAPPENED: Reviewed at head 5deb66c7f66fc7b99ff017920161944f6f65ba7a against base master 870843f999fb4bb8fc8c15ff7ede730448cdb3d4 in worktree branches/review-pr884. The dependency migration is correct and well-evidenced. The new shared import surface is not: `tests/__init__.py` exists, so `tests/` is a package and pytest / `unittest discover` place the repo root on `sys.path`, never `tests/`. The helper is therefore only importable as `tests.webui_testclient`, but all 18 rewritten modules use the bare top-level name `webui_testclient`. Each of those modules now fails to import when run on its own. The PR's three green signals all miss this. `tests/test_issue_682_starlette_httpx2.py` does `sys.path.insert(0, ...parent)` at import time, so whichever module imports first leaks `tests/` onto the path for the rest of the process: pytest tests/test_issue_682_...py tests/test_webui_audit.py -> 12 passed (the cited command) pytest tests/test_webui_audit.py tests/test_issue_682_...py -> ModuleNotFoundError Same two files, reversed. `scripts/test-webui` passes for an unrelated reason (`unittest discover -s tests` inserts `tests/` itself, and its `test_webui_*.py` pattern never loads the #682 module). Full `pytest tests/` passes only because `test_issue_682...` sorts alphabetically ahead of `test_webui_*`. Observed at this head: pytest tests/test_webui_audit.py -q E ModuleNotFoundError: No module named 'webui_testclient' !!! Interrupted: 1 error during collection !!! python -m unittest tests.test_webui_audit ModuleNotFoundError: No module named 'webui_testclient' FAILED (errors=1) Fix verified in a scratch worktree (reverted, nothing pushed) — after package-qualifying the import: `pytest tests/test_webui_audit.py` 9 passed; reversed-order pair 12 passed; `scripts/test-webui` 460 OK; `unittest tests.test_webui_audit` 9 OK. Also LOW / non-blocking: `test_starlette_testclient_import_does_not_warn` deletes `starlette.testclient` from `sys.modules` and re-imports without restoring, leaving a different class object in `sys.modules` while earlier importers still hold the original. Harmless today, but it is unrestored global state in a suite whose `conftest.py` otherwise resets aggressively. Consider `unittest.mock.patch.dict(sys.modules)`. WHY: The stated goal is a single canonical Web UI TestClient import surface. As written that surface is unreachable under the project's own package layout for every consumer except one ordering accident, so the change makes 18 previously self-runnable test modules un-runnable in isolation. The fix is one mechanical rewrite and preserves every property the PR set out to achieve. ISSUE: #682 HEAD_SHA: 5deb66c7f66fc7b99ff017920161944f6f65ba7a REVIEW_STATUS: request_changes MERGE_READY: no BLOCKERS: `from webui_testclient import TestClient` does not resolve under pytest or `unittest discover` because `tests/` is a package (`tests/__init__.py` present); all 18 rewritten `tests/test_webui_*.py` modules fail to import in isolation. Blocking; fix is to import as `tests.webui_testclient`. VALIDATION: - Scope confirmed: 21 files, +106/-18, matches the PR description; base 870843f, 0 commits behind, mergeable, no conflicts. - Premise verified against installed code: starlette 1.3.1 `testclient.py:42` instructs `pip install httpx2` and `:48` emits the deprecation this PR removes. Package is github.com/pydantic/httpx2; starlette's `full` extra declares `httpx2>=2.0.0`, satisfied by the `==2.9.1` pin. `pip check` reports no broken requirements. Keeping `httpx==0.28.1` for MCP/runtime is correct (separate top-level modules). - Regression check, full suite at both ends: base 870843f = 23 failed / 5099 passed; head 5deb66c = 23 failed / 5102 passed. Failure sets identical (`comm` diff empty both directions). Zero new failures; +3 are this PR's new tests. - Migration coverage complete: the four unconverted `test_webui_*` modules (architecture_docs, ci_gate, sanctioned_restart, worker_registry) do not use TestClient at all. Only remaining direct `starlette.testclient` imports are inside the helper and the deliberate deprecation probe. - No warning filter is used to suppress the deprecation, as claimed. - Blocking defect reproduced and the proposed fix re-verified across all four invocation paths, as recorded above. LAST_UPDATED_BY: sysadmin / prgs-reviewer / 2026-07-24
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #884
issue: #682
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 85239-4f4db84a6d07
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884
phase: released
candidate_head: 5deb66c7f6
target_branch: master
target_branch_sha: 870843f999
last_activity: 2026-07-24T22:15:56Z
expires_at: 2026-07-24T22:25:56Z
blocker: manual-release

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #884 issue: #682 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 85239-4f4db84a6d07 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884 phase: released candidate_head: 5deb66c7f66fc7b99ff017920161944f6f65ba7a target_branch: master target_branch_sha: 870843f999fb4bb8fc8c15ff7ede730448cdb3d4 last_activity: 2026-07-24T22:15:56Z expires_at: 2026-07-24T22:25:56Z blocker: manual-release
jcwalker3 added 1 commit 2026-07-24 17:18:14 -05:00
Author
Owner

Re-requested review at updated head c74b8da.

  • Package-qualified webui_testclient import as from tests.webui_testclient import TestClient across all 18 tests/test_webui_*.py modules and tests/test_issue_682_starlette_httpx2.py.
  • Removed sys.path.insert(0, ...parent) for tests/ in test_issue_682_starlette_httpx2.py.
  • Added sys.modules cleanup/restoration in test_starlette_testclient_import_does_not_warn.

Verified across all four isolation targets:

  • pytest tests/test_webui_audit.py -q → 9 passed
  • pytest tests/test_webui_audit.py tests/test_issue_682_starlette_httpx2.py -q → 12 passed
  • WEBUI_TEST_OFFLINE=1 scripts/test-webui -q → 460 tests OK
  • python3 -m unittest tests.test_webui_audit → 9 passed
Re-requested review at updated head `c74b8da`. - Package-qualified `webui_testclient` import as `from tests.webui_testclient import TestClient` across all 18 `tests/test_webui_*.py` modules and `tests/test_issue_682_starlette_httpx2.py`. - Removed `sys.path.insert(0, ...parent)` for `tests/` in `test_issue_682_starlette_httpx2.py`. - Added `sys.modules` cleanup/restoration in `test_starlette_testclient_import_does_not_warn`. Verified across all four isolation targets: - `pytest tests/test_webui_audit.py -q` → 9 passed - `pytest tests/test_webui_audit.py tests/test_issue_682_starlette_httpx2.py -q` → 12 passed - `WEBUI_TEST_OFFLINE=1 scripts/test-webui -q` → 460 tests OK - `python3 -m unittest tests.test_webui_audit` → 9 passed
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #884
issue: #682
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 85239-e074658df5a1
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884
phase: claimed
candidate_head: c74b8da400
target_branch: master
target_branch_sha: 870843f999
last_activity: 2026-07-24T22:31:06Z
expires_at: 2026-07-24T22:41:06Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #884 issue: #682 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 85239-e074658df5a1 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884 phase: claimed candidate_head: c74b8da40057349e6eabb12040bda4abe442a826 target_branch: master target_branch_sha: 870843f999fb4bb8fc8c15ff7ede730448cdb3d4 last_activity: 2026-07-24T22:31:06Z expires_at: 2026-07-24T22:41:06Z blocker: none
sysadmin approved these changes 2026-07-24 17:32:32 -05:00
sysadmin left a comment
Owner

Canonical PR State

NATIVE_REVIEW_PROOF: native prgs-reviewer MCP review mutation via gitea_submit_pr_review, profile prgs-reviewer, identity sysadmin, session 85239-e074658df5a1, reviewer lease comment 16189, workflow hash 263d0a6cb8a6, head c74b8da400 pinned via gitea_mark_final_review_decision.

STATE:
approved

WHO_IS_NEXT:
merger

NEXT_ACTION:
Merge PR #884 at head c74b8da400. Base is current (0 commits behind master 870843f), mergeable, no conflicts, no required checks.

NEXT_PROMPT:

Role: MERGER
Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools
PR: #884 (Closes #682)

1. gitea_whoami (prgs) + gitea_assess_master_parity.
2. gitea_view_pr 884; gitea_assess_pr_sync_status with prepared_verdict_head_sha
   c74b8da40057349e6eabb12040bda4abe442a826 — confirm merge_now and
   approval_at_current_head before acting.
3. gitea_load_review_workflow, then resolve(adopt_merger_pr_lease) -> adopt/acquire lease.
4. resolve(merge_pr) -> gitea_merge_pr with confirmation "MERGE PR 884" and
   expected_head_sha c74b8da40057349e6eabb12040bda4abe442a826 pinned.
5. Merge auto-closes #682 and strips status:pr-open. Re-verify the head has not
   advanced before merging; this branch moved once already during review.

WHAT_HAPPENED:
Re-review at head c74b8da400 against base master 870843f999, in worktree branches/review-pr884. Both findings from the REQUEST_CHANGES at 5deb66c7 are fixed in commit c74b8da.

Blocking finding (import surface unreachable) — resolved. All 18 tests/test_webui_*.py modules now use from tests.webui_testclient import TestClient, and tests/test_issue_682_starlette_httpx2.py both package-qualifies its own import and drops the sys.path.insert(0, str(Path(__file__).resolve().parent)) line that was masking the defect by leaking tests/ onto sys.path for whatever imported after it. The fix is the package-qualified form rather than more path manipulation, which is the right direction: tests/__init__.py exists, so tests/ is a package and conftest.py already places the repo root on sys.path.

LOW finding (unrestored sys.modules) — resolved. test_starlette_testclient_import_does_not_warn now snapshots the starlette.testclient entries into saved, deletes them inside a try, and restores via sys.modules.update(saved) in a finally. Global state is no longer left mutated for subsequent tests.

Every invocation path that previously failed now passes, including the ones the original test plan did not exercise:

pytest tests/test_webui_audit.py -q                                  9 passed   (was collection ERROR)
pytest tests/test_webui_audit.py tests/test_issue_682_...py -q      12 passed   (was ERROR, reversed order)
pytest tests/test_issue_682_starlette_httpx2.py -q                   3 passed
scripts/test-webui                                                 460 OK
python -m unittest tests.test_webui_audit                            9 OK       (was FAILED)

WHY:
The dependency migration was correct from the outset — verified directly against the installed starlette 1.3.1 source rather than the PR narrative. The only blocker was that the new shared import surface could not resolve under the project's own package layout, so 18 previously self-runnable test modules became un-runnable in isolation and the PR's green signals were an artifact of module import ordering. That is now fixed at the root, without warning filters, path hacks, or weakened assertions, and with no change to the production client path.

ISSUE:
#682

HEAD_SHA:
c74b8da400

REVIEW_STATUS:
approve

MERGE_READY:
yes

BLOCKERS:
none

VALIDATION:

  • Head re-pinned live before verdict: PR head advanced 5deb66c7 -> c74b8da4 during review; every claim here is measured at c74b8da4, not carried over. Base current at 870843f, 0 commits behind, mergeable, has_conflicts false, checks not required.
  • Premise re-verified against installed code: starlette 1.3.1 testclient.py:42 instructs pip install httpx2; :48 emits the deprecation this PR removes. Package is github.com/pydantic/httpx2; starlette's full extra declares httpx2>=2.0.0, satisfied by the ==2.9.1 pin. pip check reports no broken requirements. httpx==0.28.1 correctly retained for MCP/runtime (separate top-level module).
  • Regression check, full suite at both ends: base 870843f = 23 failed / 5099 passed / 6 skipped; head c74b8da = 23 failed / 5102 passed / 6 skipped. Failure sets identical (comm diff empty in both directions). Zero new failures; the +3 are this PR's own new tests. The 23 are pre-existing on master and unrelated to this change.
  • Fix confirmed complete, not partial: all 18 rewritten modules carry the package-qualified import; the four unconverted test_webui_* modules (architecture_docs, ci_gate, sanctioned_restart, worker_registry) do not use TestClient at all, so coverage is exhaustive.
  • Import-surface claim holds: the only remaining direct starlette.testclient imports are inside the helper itself and the deliberate deprecation probe.
  • No warning filter is used to suppress the deprecation, as claimed.

LAST_UPDATED_BY:
sysadmin / prgs-reviewer / 2026-07-24

## Canonical PR State NATIVE_REVIEW_PROOF: native prgs-reviewer MCP review mutation via gitea_submit_pr_review, profile prgs-reviewer, identity sysadmin, session 85239-e074658df5a1, reviewer lease comment 16189, workflow hash 263d0a6cb8a6, head c74b8da40057349e6eabb12040bda4abe442a826 pinned via gitea_mark_final_review_decision. STATE: approved WHO_IS_NEXT: merger NEXT_ACTION: Merge PR #884 at head c74b8da40057349e6eabb12040bda4abe442a826. Base is current (0 commits behind master 870843f), mergeable, no conflicts, no required checks. NEXT_PROMPT: ```text Role: MERGER Repo: prgs / Scaled-Tech-Consulting / Gitea-Tools PR: #884 (Closes #682) 1. gitea_whoami (prgs) + gitea_assess_master_parity. 2. gitea_view_pr 884; gitea_assess_pr_sync_status with prepared_verdict_head_sha c74b8da40057349e6eabb12040bda4abe442a826 — confirm merge_now and approval_at_current_head before acting. 3. gitea_load_review_workflow, then resolve(adopt_merger_pr_lease) -> adopt/acquire lease. 4. resolve(merge_pr) -> gitea_merge_pr with confirmation "MERGE PR 884" and expected_head_sha c74b8da40057349e6eabb12040bda4abe442a826 pinned. 5. Merge auto-closes #682 and strips status:pr-open. Re-verify the head has not advanced before merging; this branch moved once already during review. ``` WHAT_HAPPENED: Re-review at head c74b8da40057349e6eabb12040bda4abe442a826 against base master 870843f999fb4bb8fc8c15ff7ede730448cdb3d4, in worktree branches/review-pr884. Both findings from the REQUEST_CHANGES at 5deb66c7 are fixed in commit c74b8da. Blocking finding (import surface unreachable) — resolved. All 18 `tests/test_webui_*.py` modules now use `from tests.webui_testclient import TestClient`, and `tests/test_issue_682_starlette_httpx2.py` both package-qualifies its own import and drops the `sys.path.insert(0, str(Path(__file__).resolve().parent))` line that was masking the defect by leaking `tests/` onto `sys.path` for whatever imported after it. The fix is the package-qualified form rather than more path manipulation, which is the right direction: `tests/__init__.py` exists, so `tests/` is a package and `conftest.py` already places the repo root on `sys.path`. LOW finding (unrestored `sys.modules`) — resolved. `test_starlette_testclient_import_does_not_warn` now snapshots the `starlette.testclient` entries into `saved`, deletes them inside a `try`, and restores via `sys.modules.update(saved)` in a `finally`. Global state is no longer left mutated for subsequent tests. Every invocation path that previously failed now passes, including the ones the original test plan did not exercise: pytest tests/test_webui_audit.py -q 9 passed (was collection ERROR) pytest tests/test_webui_audit.py tests/test_issue_682_...py -q 12 passed (was ERROR, reversed order) pytest tests/test_issue_682_starlette_httpx2.py -q 3 passed scripts/test-webui 460 OK python -m unittest tests.test_webui_audit 9 OK (was FAILED) WHY: The dependency migration was correct from the outset — verified directly against the installed starlette 1.3.1 source rather than the PR narrative. The only blocker was that the new shared import surface could not resolve under the project's own package layout, so 18 previously self-runnable test modules became un-runnable in isolation and the PR's green signals were an artifact of module import ordering. That is now fixed at the root, without warning filters, path hacks, or weakened assertions, and with no change to the production client path. ISSUE: #682 HEAD_SHA: c74b8da40057349e6eabb12040bda4abe442a826 REVIEW_STATUS: approve MERGE_READY: yes BLOCKERS: none VALIDATION: - Head re-pinned live before verdict: PR head advanced 5deb66c7 -> c74b8da4 during review; every claim here is measured at c74b8da4, not carried over. Base current at 870843f, 0 commits behind, mergeable, has_conflicts false, checks not required. - Premise re-verified against installed code: starlette 1.3.1 `testclient.py:42` instructs `pip install httpx2`; `:48` emits the deprecation this PR removes. Package is github.com/pydantic/httpx2; starlette's `full` extra declares `httpx2>=2.0.0`, satisfied by the `==2.9.1` pin. `pip check` reports no broken requirements. `httpx==0.28.1` correctly retained for MCP/runtime (separate top-level module). - Regression check, full suite at both ends: base 870843f = 23 failed / 5099 passed / 6 skipped; head c74b8da = 23 failed / 5102 passed / 6 skipped. Failure sets identical (`comm` diff empty in both directions). Zero new failures; the +3 are this PR's own new tests. The 23 are pre-existing on master and unrelated to this change. - Fix confirmed complete, not partial: all 18 rewritten modules carry the package-qualified import; the four unconverted `test_webui_*` modules (architecture_docs, ci_gate, sanctioned_restart, worker_registry) do not use TestClient at all, so coverage is exhaustive. - Import-surface claim holds: the only remaining direct `starlette.testclient` imports are inside the helper itself and the deliberate deprecation probe. - No warning filter is used to suppress the deprecation, as claimed. LAST_UPDATED_BY: sysadmin / prgs-reviewer / 2026-07-24
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #884
issue: #682
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 85239-e074658df5a1
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884
phase: released
candidate_head: c74b8da400
target_branch: master
target_branch_sha: 870843f999
last_activity: 2026-07-24T22:32:43Z
expires_at: 2026-07-24T22:42:43Z
blocker: manual-release

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #884 issue: #682 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 85239-e074658df5a1 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884 phase: released candidate_head: c74b8da40057349e6eabb12040bda4abe442a826 target_branch: master target_branch_sha: 870843f999fb4bb8fc8c15ff7ede730448cdb3d4 last_activity: 2026-07-24T22:32:43Z expires_at: 2026-07-24T22:42:43Z blocker: manual-release
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #884
issue: #682
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 84870-90dd5a811ae5
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884
phase: claimed
candidate_head: c74b8da400
target_branch: master
target_branch_sha: 870843f999
last_activity: 2026-07-24T23:10:45Z
expires_at: 2026-07-24T23:20:45Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #884 issue: #682 reviewer_identity: sysadmin profile: prgs-merger session_id: 84870-90dd5a811ae5 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr884 phase: claimed candidate_head: c74b8da40057349e6eabb12040bda4abe442a826 target_branch: master target_branch_sha: 870843f999fb4bb8fc8c15ff7ede730448cdb3d4 last_activity: 2026-07-24T23:10:45Z expires_at: 2026-07-24T23:20:45Z blocker: none
sysadmin merged commit ccde9e8f11 into master 2026-07-24 18:11:02 -05:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#884