Repository navigation
refactor(audit): move campus.common.http to campus.audit.http - #976
Merged
ngjunsiang merged 1 commit intoOct 27, 2026
Merged
Conversation
The HTTP client's only production consumers were the audit service (audit.client, audit.web.auth) plus the cross-service test harness seam, making it audit domain rather than shared infrastructure. With the move, requests leaves campus.common's dependency list entirely: campus-common's only third-party dep is now bcrypt (via utils.secret). Mechanical move (git mv), import-path updates in audit client/web, the flask_test harness (monkeypatch target moves with the seam), unit tests, and the TESTING-GUIDE / audit-tracing docs. campus.common drops the http shim and __getattr__.
nycomp
force-pushed
the
refactor/audit-http-move
branch
from
October 27, 2026 15:52
2881b74 to
bea1f4e
Compare
3 tasks
nycomp
pushed a commit
that referenced
this pull request
Oct 27, 2026
Repo-wide check of all 172 campus modules: every module docstring's first line must be the module's dotted path. Fixes 18 stale ones (legacy pre-reorg paths like campus.apps.api.routes.* and campus.auth.routes.* that survived the oauth_proxy/resources moves, singular/plural drift like routes.booking -> routes.bookings and routes.api_keys -> routes.apikeys, a missing campus. prefix, and a stray .py suffix), normalizes two descriptive-first docstrings (audit.helpers.audit_events, logging_config), and adds the two missing module docstrings (flask_campus.utils, model.booking). Docs module-reference sweep found no stale module paths: the campus.common.http mentions are deliberate history notes on the #976 move, and campus.test / campus.with_user_session in the guides are a test URL and the Campus-client instance method respectively, not modules.
nycomp
pushed a commit
that referenced
this pull request
Oct 27, 2026
Repo-wide check of all 172 campus modules: every module docstring's first line must be the module's dotted path. Fixes 18 stale ones (legacy pre-reorg paths like campus.apps.api.routes.* and campus.auth.routes.* that survived the oauth_proxy/resources moves, singular/plural drift like routes.booking -> routes.bookings and routes.api_keys -> routes.apikeys, a missing campus. prefix, and a stray .py suffix), normalizes two descriptive-first docstrings (audit.helpers.audit_events, logging_config), and adds the two missing module docstrings (flask_campus.utils, model.booking). Docs module-reference sweep found no stale module paths: the campus.common.http mentions are deliberate history notes on the #976 move, and campus.test / campus.with_user_session in the guides are a test URL and the Campus-client instance method respectively, not modules.
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.
Closes the http-move line of #970 (phase 1). Stack: 2/3 — needs #975 (harness sdk-#119 fix) below it; followed by the boundary-contract tests.
Change
campus/common/http→campus/audit/http(git mv, tracked as renames). The client's only production consumers were the audit service (audit.client,audit.web.auth) plus the cross-service test harness seam — audit domain, not shared infrastructure. The harness's monkeypatch target moves with the seam (tests/flask_test/json_client.pypatchescampus.audit.http.DefaultClient), and the TESTING-GUIDE / audit-tracing docs are updated.campus.common.__init__dropshttpfrom__all__and the PEP 562__getattr__shim — no consumer usedfrom campus.common import http; everyone imports the submodule path directly, so nothing breaks.Effect
requestsleaves campus.common's dependency list entirely — the only remaining third-party import at module level in the whole namespace is bcrypt (utils/secret.py, kept per #969). Measured at the tip of the stack (fresh interpreter):import campus.commonimport campus.storageimport campus.audit.http(on demand)Test updates
tests/unit/common/test_import_weight.py: keeps the lean-import guard; replaces the getattr test with an attribute-access assertion (campus.common.httpmust raiseAttributeError). Import-based assertions are fragile here: an import succeeds as an empty namespace package whenever a leftovercampus/common/httpdirectory exists on the path (untracked__pycache__does this after branch switches) — learned the hard way, documented in the test.Verification
Unit (842), contract, integration, and
ruff check .all green at the tip of the stacked series; contract exercises the moved harness seam end-to-end.