Skip to content

ci(repo): scope per-package tox tests to single workspace member#578

Merged
Hoeze merged 6 commits into
mainfrom
ci/scope-per-package-tox
May 16, 2026
Merged

ci(repo): scope per-package tox tests to single workspace member#578
Hoeze merged 6 commits into
mainfrom
ci/scope-per-package-tox

Conversation

@Hoeze

@Hoeze Hoeze commented May 15, 2026

Copy link
Copy Markdown
Collaborator

Previously the per-package test matrix installed the full workspace
via uv sync --all-extras --all-groups, which masked missing-dep
regressions in individual package pyprojects (a wheel of grz-cli
built from current source would fail to import because grz-common
referenced grz_db without declaring it).
Drive uv sync through a single workspace member via tox-uv's
uv_sync_flags and a GRZ_TOX_PACKAGE env var so each package's tests
run against only its declared deps.
The transitive-import regression that this guard surfaced is fixed in
the same PR, alongside several follow-up cleanups.

fix(grz-common,grz-db,grzctl): move populate logic into SubmissionDb

feat(grz-db,grz-common): clean up SubmissionDb.populate API surface

refactor(grz-db,grz-common,grzctl): extract shared metadata + redaction helpers

fix(grzctl): correct stale grz-cli hint in submission-not-found errors

fix(grz-pydantic-models,grz-db): align inconsistent version pins

Hoeze added 4 commits May 15, 2026 11:10
Previously, the per-package test matrix installed the full workspace via
`uv sync --all-extras --all-groups`, masking missing-dep regressions in
individual package pyprojects. A wheel of grz-cli built from the current
source would fail to import at module load because grz-common imports
`grz_db` without grz-db being declared anywhere in the grz-cli /
grz-common dependency chains, yet CI stayed green because grz-db got
installed via the wider workspace sync.

Drive `uv sync` through a single workspace member when the new
`GRZ_TOX_PACKAGE` env var is set, using tox-uv's `uv_sync_flags`
(`--package {env:GRZ_TOX_PACKAGE:grz-tools}`). The default value keeps
the existing behavior for local `tox` runs.

Add per-package `[dependency-groups] test` to grz-cli, grz-common, and
grz-db so the scoped sync still pulls pytest et al. Add a minimal
`tests/test_smoke.py` for grz-cli so it enters the changed-package
matrix (the dependency-change detector requires a `tests/` directory).
…ndencies

Each package's `[dependency-groups] test` used to restate version ranges
for pytest, pytest-cov, moto, etc. Move those constraints to the
workspace root's `[tool.uv] constraint-dependencies`, which uv applies
to every member during `uv lock` / `uv sync`. Per-package test groups
now list bare names only.

Also drops grzctl's self-reference from its own test group.
`grz-pydantic-models` declared `pydantic >=2.9.2,<3` even though the
rest of the workspace required `>=2.12` since #425. Bump to match.

`grz-db` declared `cryptography >=45.0.3` without an upper bound while
`grz-common` capped it at `<49`. Add the same upper bound for
consistency.
@Hoeze Hoeze requested a review from tedil May 15, 2026 11:22

@tedil tedil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failure is expected, fix will be done separately I assume?

@Hoeze

Hoeze commented May 15, 2026

Copy link
Copy Markdown
Collaborator Author

failure is expected, fix will be done separately I assume?

That's the plan! 👍

tedil
tedil previously approved these changes May 15, 2026
Previously gated on `branches: [main]`, which silently skipped CI for
stacked PRs (e.g. PRs targeting another feature branch). Drop the filter
so stacked PRs get the same coverage as PRs targeting main.
@Hoeze Hoeze changed the title ci(repo): scope per-package tox to single workspace member ci(repo): scope per-package tox tests to single workspace member May 15, 2026
…580)

`grz-common/workers/worker.py` imported `grz_db` at module top without
declaring it as a dependency, breaking isolated installs of `grz-cli`.
The fix in the title moves the offending code into `grz-db`.
The follow-up commits consolidate the resulting populate API and clean
up a few unrelated smells in `grzctl` encountered along the way.

feat(grz-db,grz-common): clean up SubmissionDb.populate API surface

refactor(grz-db,grz-common,grzctl): extract shared metadata + redaction
helpers

fix(grzctl): correct stale grz-cli hint in submission-not-found errors
@Hoeze Hoeze enabled auto-merge May 15, 2026 19:14
@Hoeze Hoeze requested a review from tedil May 15, 2026 19:15
@Hoeze Hoeze added this pull request to the merge queue May 16, 2026
Merged via the queue into main with commit a0fc796 May 16, 2026
17 checks passed
@Hoeze Hoeze deleted the ci/scope-per-package-tox branch May 16, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants