Skip to content

0.3.2: upstream source diff, shared-dependency users, quieter check - #11

Merged
yudelevi merged 1 commit into
mainfrom
release-0.3.2
Oct 8, 2026
Merged

yudelevi merged 1 commit into
mainfrom
release-0.3.2

Conversation

@yudelevi

@yudelevi yudelevi commented Oct 8, 2026

Copy link
Copy Markdown
Owner

On a dependency-bump MR, mpat check printed every watched symbol, named drift only by status, and aborted with exit 2 when a symbol was deleted upstream. Reviewers had to dig up the upstream change by hand and could miss other patches sharing a drifted dependency.

  • Hide ok rows behind an N ok count; --all restores the full table.
  • mpat diff / mpat check --diff: ty-style diff of the upstream source between the locked and installed release. The locked side is downloaded from the configured index (UV_DEFAULT_INDEX, UV_INDEX_URL, PIP_INDEX_URL, else PyPI) and cached in MPAT_CACHE_DIR. Credentials go to the index host only, never across a redirect. Fetch failures never change the exit code.
  • Every declaration using a drifted target is listed (used_by) and gets its own GitLab finding.
  • A target deleted upstream is reported as missing instead of failing collection.
  • Changed fields (signature, value, location, kind) under each row and in the GitLab description; findings anchored at the patch()/watch() line.
  • New docstring status for docstring-only upstream edits (still exit 1). Lock gains optional code_hash; format version unchanged.

Tests: 378 passing on 3.11-3.14, ruff/ty clean, mkdocs strict build clean, fetcher smoke-tested against real PyPI.

A CI log for a dependency bump buried the one drifted patch in a table
of every watched symbol, and the drift itself said little more than
"body", so the reviewer still had to dig up the upstream change by
hand. Hide ok rows behind a count (--all restores them), print the
changed fields under each row and in the GitLab description, and anchor
GitLab findings to the declaring call rather than the first string that
happens to quote the target.

mpat diff and check --diff now render the upstream source change in the
style of a ty diagnostic. The lock keeps hashes only, so the locked side
is downloaded from the package index the environment already uses and
cached; nothing upstream gets committed. Index credentials are only ever
sent to the index host, because private registries redirect downloads to
signed object-storage URLs. Fetch failures degrade to a one-line notice
and never change the exit code.

A shared depends_on used to report its drift once, under whichever patch
declared it first. Every declaration using a drifted target is now
listed, and each gets its own GitLab finding.

A symbol deleted upstream used to abort collection with exit 2 and an
empty Code Quality report. Collection now defers the lookup and check()
reports it as missing; outside collection it still raises.

Docstring-only upstream edits get their own status so they are not
triaged like code changes. The lock gains an optional code_hash; old
locks keep reporting body until relocked, so the format version stays 1.
@yudelevi
yudelevi merged commit 2802dfb into main Oct 8, 2026
8 checks passed
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.

1 participant