Skip to content

Add the automation and bot set from get_MNV - #2

Merged
Paururo merged 6 commits into
mainfrom
automation
Aug 22, 2026
Merged

Paururo merged 6 commits into
mainfrom
automation

Conversation

@Paururo

@Paururo Paururo commented Aug 22, 2026

Copy link
Copy Markdown
Member

Ports the automation set from get_MNV, adapted where this repository is
different. The CI there is built around a scenario suite, a Tauri GUI and a
frontend, none of which exist here, so what carried over is the reasoning and
the comments recording it rather than the jobs.

On every pull request

Workflow What it does
ci.yml fmt, clippy with -D warnings, build, test, and cargo publish --dry-run so a packaging problem shows up here instead of after a tag is pushed. Plus a build on the 1.85 floor and the determinism job below.
codeql.yml rust, python and actions. The last one knows about unsafe pull_request_target use, which is the trigger labeler.yml runs on.
dependency-review.yml Refuses a pull request that adds a dependency with a known advisory, moderate and above.
labeler.yml Labels from the files changed, so they are there when someone wants to filter by them.

By hand, or on a timer

Workflow What it does
stale.yml The one scheduled workflow, as in get_MNV. Never touches bug, security or pinned, and leaves pull requests alone.
mutants.yml Advisory mutation testing across four shards. 355 mutants in scope; a measured shard of 45 took 1m35s locally.
release.yml Tag-driven: four platforms, checksums, build provenance, crates.io, notes derived from the tag. Refuses to announce a version CHANGELOG.md does not describe, and refuses to publish when the tag and Cargo.toml disagree.

Dependabot is monthly and grouped, majors kept apart, routine groups
auto-merging once CI is green.

The determinism job

The one written for this repository specifically. Two of the estimator fixes in
1.0.1 are invisible in a single run, and the thread-count one was measurable
only at scale, so it runs the release binary over 340k loci at five thread
counts and diffs the output.

It was built by breaking the reduction on purpose and checking it caught it,
which the first version did not: a generator walking frequencies at a fixed
arithmetic stride produces partial sums that agree in any order, and the
deliberately broken build passed. Drawing them from a seeded PRNG is what
exposes it. Verified in both directions before committing.

Three things this turned up

cargo publish --dry-run failed on its first clean run. Three files with a
colon in the name (100:T:0.9 and friends) were sitting in the repository root,
committed by accident in cfc6a94, fragments of a VCF written by a shell loop
with an unquoted redirect. A colon is not legal in a crate archive, so
cargo package refuses outright: v1.0.1 could not have been published to
crates.io at all.
Removed here.

The documented MSRV was wrong. The installation page said 1.82, reasoning
from Option::is_none_or. The floor actually comes from the dependency tree:
clap_lex needs edition 2024, so 1.85. Checked rather than reasoned about, by
installing both: 1.84 fails while resolving, 1.85 passes all 83 tests. Now
rust-version in Cargo.toml, where cargo enforces it.

Mutation testing has findings. One measured shard of 45 left 20 survivors,
concentrated in main.rs and in read_file_list, which no test covers at all.
Not addressed here: the workflow is advisory and this pull request is about
adding it, not acting on it.

Two commits that are only there to make the gates pass

cargo fmt --check and clippy -D warnings were not clean, so they are fixed
first, in their own commits, so neither diff has to be read through the other.
The clippy one is real cleanup: the test file wrapped itself in a redundant
mod tests, nesting as calculation::tests::tests.

Needs doing by hand

  • GitHub Pages is still not enabled, so the docs links continue to 404.
    Settings → Pages → Source → gh-pages / root.
  • CARGO_REGISTRY_TOKEN for the crates.io job. Without it that job says so and
    stops, rather than failing with an authentication error.
  • The 14 labels these configs reference have been created already.

All five were in src/calculation/tests.rs, and CI is about to run clippy with
-D warnings, so they have to go before the gate arrives rather than after.

The file is already the `tests` module, since calculation.rs declares it, so
the `mod tests { }` inside nested it as calculation::tests::tests. Dropping the
wrapper is what removes the lint, and takes an indentation level off the file.

The three bound assertions become range checks, which is what clippy asks for
and reads better anyway, and the fixture tuple gets a name instead of being
spelled out at the signature.

No test changes behaviour: 83 still pass.
CI is about to run `cargo fmt --check`, which nothing had enforced, so this is
the one-time reformat that makes the gate pass. Mechanical: rustfmt's output on
the existing code, no edits of my own mixed in.

Kept separate from the commit that adds the gate so neither diff has to be read
through the other. 83 tests pass unchanged.
The installation page said 1.82, reasoning from the one standard-library
method this crate uses that needed it, Option::is_none_or. That was the wrong
place to look: the floor comes from the dependency tree, and clap_lex requires
edition 2024, which needs 1.85.

Checked rather than reasoned about this time. On 1.84 the build fails while
resolving, before it compiles a line; on 1.85 all 83 tests pass. So the floor
is 1.85, and it is now `rust-version` in Cargo.toml, where cargo enforces it
instead of a docs page asserting it.
Ported from get_MNV and adapted, rather than copied: the CI there is built
around a scenario suite, a Tauri GUI and a frontend, none of which exist here.
What carried over unchanged is the reasoning, and the comments that record it.

Checks on every pull request:

  ci.yml            fmt, clippy with -D warnings, build, test, and a
                    `cargo publish --dry-run` so a packaging problem is found
                    on the pull request rather than after the tag is pushed.
                    Plus a build on the 1.85 floor, and a determinism job.
  codeql.yml        rust, python and actions. That last one knows about unsafe
                    `pull_request_target` use, which is what labeler.yml runs on.
  dependency-review Refuses a pull request adding a dependency with a known
                    advisory, at moderate and above.
  labeler.yml       Labels from the files changed, so the labels are there when
                    someone wants to filter by them.

On a schedule or by hand:

  stale.yml         The one scheduled workflow, as in get_MNV. Never touches
                    anything labelled bug, security or pinned, and leaves pull
                    requests alone entirely.
  mutants.yml       Advisory mutation testing, four shards. 355 mutants in
                    scope; a measured shard of 45 took 1m35s locally.
  release.yml       Tag-driven: four platforms, checksums, build provenance,
                    crates.io, and notes derived from the tag. Refuses to
                    announce a version CHANGELOG.md does not describe, and
                    refuses to publish when the tag and Cargo.toml disagree.

The determinism job is the one written for this repository specifically. Two
of the estimator fixes in 1.0.1 are invisible in a single run, and the
thread-count one was measurable only at scale, so it runs the release binary
over 340k loci at five thread counts and diffs the output. It was built by
breaking the reduction on purpose and checking it caught it, which the first
version did not: a generator walking frequencies at a fixed stride produced
partial sums that agree in any order, and the deliberately broken build passed
it. Drawing them from a seeded PRNG is what exposes it.

Dependabot is monthly and grouped, with majors kept apart, and the routine
groups auto-merge once CI is green. Its github-actions section carries the one
trap worth writing down: the MSRV is passed as a `toolchain:` input rather than
pinned as `rust-toolchain@1.85`, because written the second way Dependabot
reads it as a version to keep current and bumps it, and the job then goes on
passing while verifying a compiler that is no longer the floor.

Also the issue and discussion forms, a pull request template whose main
question is whether any numbers change, SECURITY.md and CODE_OF_CONDUCT.md.
The 14 labels these reference now exist in the repository.

The docs build dependencies move to docs/requirements.txt so Dependabot finds
them next to what they build, and are excluded from the published site.
`100:T:0.9`, `200:G:0.9` and `300:C:0.9`: fragments of a VCF written by a
shell loop whose redirect target was not quoted, committed by accident in
cfc6a94 and never noticed because nothing looks at the root.

They are not harmless. A colon is not a legal character in a crate archive, so
`cargo package` refuses outright, which means v1.0.1 could not have been
published to crates.io at all. The new `cargo publish --dry-run` step in CI is
what surfaced them, on its first run against a clean tree.
@Paururo Paururo added documentation Improvements or additions to documentation estimators The distance estimators io VCF, table and FASTA readers, and output writing cli Command-line interface and orchestration tests Test suite packaging Cargo metadata, release workflow ci Workflows, automation and repository config labels Aug 22, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

The new `cargo audit` step found it on its first run: an invalid pointer
dereference in the `fmt::Pointer` impl for `Atomic` and `Shared`, reachable
only when the underlying pointer is already invalid. It arrives transitively
through rayon, and 0.9.20 fixes it with no other movement in the tree.

What is left is two warnings rather than vulnerabilities, both transitive and
neither with a fix available: number_prefix is unmaintained (RUSTSEC-2025-0119,
via indicatif) and anyhow has an unsoundness in `Error::downcast_mut`
(RUSTSEC-2026-0190). The audit step is advisory precisely so those are read
rather than blocking a merge.
@Paururo
Paururo merged commit c2a031f into main Aug 22, 2026
12 of 13 checks passed
@Paururo
Paururo deleted the automation branch August 22, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Workflows, automation and repository config cli Command-line interface and orchestration documentation Improvements or additions to documentation estimators The distance estimators io VCF, table and FASTA readers, and output writing packaging Cargo metadata, release workflow tests Test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants