Skip to content

fix(ci): match only readcon-core entries in the version check - #146

Merged
HaoZeke merged 9 commits into
developfrom
fix/core-hygiene-r1
Dec 4, 2026
Merged

HaoZeke merged 9 commits into
developfrom
fix/core-hygiene-r1

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

language_package_versions_match_cargo fails on develop. The version lockstep scan in scripts/check_version_sot.sh flagged any token equal to VERSION. A conda pin of libintl in pixi.lock uses the same digits and belongs to another package. The scan now requires a readcon-core entry: a Cargo package record, a quoted pin, an equality pin, a conda explicit pin, or a hyphenated artifact name. tests/minimage-link/Cargo.lock is refreshed to the current version. tests/python/test_check_release_artifacts.py lists fixed tags, so it leaves the allowlist. Two new cases in tests/python/test_version_sot.py check that an unrelated pin passes and that a stray readcon-core entry in pixi.lock fails.

The scan also catches three more ways a stray readcon-core entry can be written: a version line that sits after a # [[[cog ...]]] comment, as in Cargo.toml and pixi.toml; an inline pin that lists path before version; and a [dependencies.readcon-core] table, including the dev, build and target forms, with version on a later line. Each shape still has to name readcon-core, so other packages pass. New cases append each shape to pixi.lock and expect the check to fail and name the file. The test for unrelated conda pins no longer depends on the real libintl pin. It appends a made-up libfoo pin at the current version and restores the file afterwards, so the next version bump cannot break it.

The convert cleanup test counted every path under the system temporary directory as a leak. A checkout under /tmp, or under a TMPDIR that contains it, puts build/ inside that directory, so the test failed there. It now requires the scratch directory's parent to be build/, and still compares the names in the system temporary directory before and after. Its failure message now says the scratch parent is not build/, rather than claiming the directory is in the system temporary directory.

The cross-binding rewrite tests also printed to the test log during a passing run. They return early when a tool such as gfortran or mpicxx is missing, and that path no longer prints a line. Their assertions are unchanged.

The Julia tests never ran on a pull request into develop, because the workflow pull_request trigger listed only main. It now lists develop and main, with the same path filters.

Two follow-up fixes for the version check. The marker scan in scripts/version_sot.py passes every file that holds a literal cog start marker to cogapp --check. The new docstring in scripts/check_version_sot.sh and a test fixture in tests/python/test_version_sot.py both held one, so version-source failed on them. The docstring no longer spells out the marker, and the test now builds its marker strings at run time. The [dependencies.readcon-core] pattern could also backtrack without bound on a table that has path but no version. It now matches whole lines, crosses blank lines in the table, stops at the next table header even when indented, accepts a trailing comment on the header, and no longer treats keys such as rust-version as version. New cases cover a table with blank lines and a path-only table followed by another table at the current version.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 87a4984. Configure here.

Comment thread scripts/check_version_sot.sh Resolved
The cleanup test treated every path under the system temporary directory as a leak. With `TMPDIR` unset that directory is `/tmp`, so a checkout there makes `build/` a child of it. A `TMPDIR` that already contains the checkout does the same. The scratch directory is created in `build/`, and the check now requires that parent. The before and after names in the system temporary directory are still compared.

Kitline-Change: mvvsnvpnmqxvonlwqxwzvlmwuzpnnrnm
`mpi_library` and `accepted_corpus_rewrites_are_byte_identical` return when a compiler or MPI wrapper is missing. The `eprintln!` on that path printed during a passing run. The rewrite assertions are unchanged.

Kitline-Change: ytuqkvytszvwopnxvtmklvouqlrplrok
The workflow `pull_request` trigger listed `main` and not `develop`. A pull request into `develop` never started it. Path filters stay the same list already on that trigger.

Kitline-Change: lknlnvwxrlqxlzuoxzzorslqlsvpwpvo
The lockstep scan treated every token equal to VERSION as this package.
A conda pin of libintl in `pixi.lock` uses the same digits and belongs to
another package. The scan now requires a readcon-core package entry.

`cargo update -p readcon-core` refreshes `tests/minimage-link/Cargo.lock`
to that version. `tests/python/test_check_release_artifacts.py` is a
fixture of fixed tags, so the check no longer requires it to contain the
current version.

Kitline-Change: pyrxqnxolqtvpypyurmzrklzmsyotpxz
The assert_eq! on the scratch directory's parent kept the old
assert!'s wording, which claimed the scratch was in the system
tempdir. That is wrong for any parent other than build/; reword it to
name the actual check.
test_lockstep_gate_ignores_unrelated_conda_pins asserted that pixi.lock
contains a libintl pin at VERSION, which coupled the test to that
dependency's own version. A synthetic libfoo pin at VERSION, appended
to a scratch copy of pixi.lock and restored in finally, exercises the
same gate behavior without depending on a real package's version
happening to match.
readcon_core_package_entry() missed a readcon-core package entry when:
a cog-emitted version line (as in Cargo.toml and pixi.toml) sits behind
a `# [[[cog ...]]]` comment rather than directly after `name`; an
inline-table pin orders `path` before `version`; or a
`[dependencies.readcon-core]` (also dev-/build-dependencies and
target tables) declares `version` on a later line. Extend the three
regexes to cover those shapes while still requiring the readcon-core
name on the entry, so unrelated packages are not flagged.

Add pytest cases that append each shape to a scratch copy of
pixi.lock, restored in finally, and assert the gate fails naming the
file.
version_sot.marker_files() scans the repository for literal cog start markers and hands every match to cogapp --check. Both the docstring of readcon_core_package_entry() in scripts/check_version_sot.sh and the cog-commented entry fixture in tests/python/test_version_sot.py contained literal marker brackets, causing cogapp --check to fail on both files.

Reword the docstring without bracket sequences and build the test's synthetic marker strings dynamically, matching scripts/version_sot.py.
In readcon_core_package_entry(), the [dependencies.readcon-core] pattern used (?:[^\n\[][^\n]*\n?)*?, where the optional newline lets the outer quantifier partition any non-matching line exponentially and hang on a path-only dependency table without a version key. It also failed to cross blank lines within the table, could cross indented table headers, and matched keys ending in version such as rust-version.

Match full lines ending in a mandatory newline, stop before any line starting with optional horizontal whitespace and [, allow trailing comments or whitespace on the table header, and anchor the version key to the start of its line. Add pytest cases covering blank lines in the table and a non-matching path-only table followed by another table at VERSION.
@HaoZeke
HaoZeke force-pushed the fix/core-hygiene-r1 branch from 0c560a5 to e6c74db Compare December 4, 2026 23:01
@HaoZeke
HaoZeke merged commit e561fc5 into develop Dec 4, 2026
75 of 79 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