Repository navigation
ci: run tests and tag-only publish through the shared workflows - #139
singlerider wants to merge 9 commits into
Conversation
Move PyPI (maturin) and crates.io publishing out of python-tests.yml and rust-tests.yml into publish.yml, triggered only by v* tags. - version job fails unless the tag equals v + the Cargo.toml version - test workflows run via workflow_call; every build job gates every registry upload so a release is never partial - drop --skip-existing and registry already-published probes - pyproject reads its version from Cargo via dynamic = ["version"] - concurrency groups use a fixed per-file prefix since github.workflow is the caller's name under workflow_call - pin every action to a full SHA, replace -latest runners Part of blacklanternsecurity/bbot-enterprise#139 Part of blacklanternsecurity/bbot-enterprise#149 Part of blacklanternsecurity/bbot-enterprise#156
The publish workflow refuses any tag that is not vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-rc.N before comparing it to Cargo.toml. PyPI upload drops PYPI_API_TOKEN for trusted publishing. Registry jobs run in the release environment so the publish gate applies. A final job creates the GitHub Release in the same tag run with an SPDX JSON SBOM attached, so a tag and its release always exist together. CLA calls the shared reusable workflow.
Governance declares one gated environment named pypi across published repos. crates and docker jobs stay in release.
Rust 1.95 deprecates AtomicU64::fetch_update in favor of try_update, and the repo denies warnings, so every CI job failed to compile. A compare_exchange_weak loop has the same semantics and builds on both the MSRV and current stable.
DNS Resolver BenchmarkThroughput is reported, never gated: it moves with hardware. The stable ceiling/1-resolver
pool/32-resolvers
pool/32-persistent
impaired/10%-loss
impaired/20%-REFUSED
impaired/50ms-latency
|
dev carries no required checks (#139), so gh pr merge --auto would merge immediately rather than on green. The shared workflow now waits for every other check on the head commit, refuses on failure or cancel, and merges with --match-head-commit. The caller grants checks: read so it can read check state.
rust-tests.yml, python-tests.yml and the inline wheel matrix, crates upload and release steps were copies of what every PyO3 repo carries. tests.yml now calls rust-tests.yml and python-tests.yml from blacklanternsecurity/CLA, so the Python matrix follows requires-python and the toolchain follows rust-toolchain. publish.yml calls release-check.yml (tag shape and manifest version), maturin-wheels.yml, crates.yml and publish.yml; only the PyPI upload stays top level because trusted publishing does not match reusable workflows. The dnsmasq and AXFR fixtures move into scripts/ci-setup.sh and scripts/ci-teardown.sh so tests and the benchmark share one copy. CLI tests run in the python job. MassDNS is cloned at a tag.
Releases are a pushed tag cut with the shared release.sh, which checks the tag against the manifest. State that here instead of copying the script.
en0f
left a comment
There was a problem hiding this comment.
required status checks on dev point at checks that will never run. Branch protection on dev still requires python-tests (3.9) through (3.14) and rust-tests. This PR deletes the workflows that report those checks, so all 7 sit at "Expected - Waiting for status to be reported" and the PR can't merge even after you approve it. An admin needs to change the required checks to Tests / rust / passed and Tests / python / passed, which is what the PR description asks for. If stable has the same rule, it needs the same change.
CLA#3 merged. Repin rust-tests, python-tests, release-check, maturin-wheels, crates and publish from the feat/shared-workflows commit to CLA main de82726. Workflow blob shas are identical at both refs.
The shared rust-tests workflow runs clippy with --all --locked only. The old repo workflow linted --all-features, which covers the pyo3 bindings. Tests cannot link with extension-module enabled, so lint the feature in a repo-local job instead of widening cargo-args.
The shared workflow pins pointed at de82726 (and the CLA caller at 4f85d3c where it still lagged). CLA main is now 40c6e18, which adds the optional registry login for image SBOMs. Every CLA reference, including the release.sh link, now resolves on CLA main at one commit. Refs blacklanternsecurity/bbot-enterprise#139
liquidsec
left a comment
There was a problem hiding this comment.
This will mean anyone with write access can publish. This needs to be discussed.
Summary
Moves blastdns CI onto the org's shared workflows and publishes only on a human-pushed version tag.
Shared workflows
Calls the reusable workflows in blacklanternsecurity/CLA, pinned to CLA main 40c6e18c0a6e32116eea4f89fc826f53c70889dc, including
cla.ymland the READMErelease.shlink. No repo-local copies of test, wheel, crates, release, or SBOM steps remain.tests.yml(pull_request, push tostable, workflow_call) callsrust-tests.yml(fmt, clippy, cargo test with--include-ignoredon the rust-toolchain channel) andpython-tests.yml(ruff, then pytest on every CPython minor satisfyingrequires-python, maturin develop detected from the build backend).publish.yml(v*tags only) callsrelease-check.yml(refuses anything butvMAJOR.MINOR.PATCH/vMAJOR.MINOR.PATCH-rc.Nand any tag differing from the Cargo.toml version),tests.yml,maturin-wheels.yml(interpreters fromrequires-python),crates.yml, thenpublish.yml(GitHub release, SPDX SBOM, wheels attached,--prereleasefor rc tags, same run). PyPI stays a top-level job because trusted publishing does not match reusable workflows.git tag.## Releasingdocuments the procedure and links the sharedrelease.sh.scripts/ci-setup.sh/scripts/ci-teardown.sh, shared by tests and the benchmark. CLI tests run in the python job. MassDNS is cloned at tag v1.1.0.ResolverHealth::decay_errorsuses a compare-exchange loop instead of the deprecatedfetch_update.pyproject.tomlreads its version from Cargo.toml (dynamic = ["version"]).Required checks for governance:
rust / passed,python / passed.Admin steps
publish.yml, environmentpypi, then deletePYPI_API_TOKEN.Validation
Refs blacklanternsecurity/bbot-enterprise#139, blacklanternsecurity/bbot-enterprise#140, blacklanternsecurity/bbot-enterprise#149, blacklanternsecurity/bbot-enterprise#155, blacklanternsecurity/bbot-enterprise#156 (blastdns part)