From 34febfd6c5236da601022eb2d7f0cf8e0d4fe198 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 6 Oct 2026 01:12:26 +1300 Subject: [PATCH 1/2] Align shared project conventions and release v0.3.1. --- .github/workflows/test.yml | 12 +++ Cargo.lock | 45 ++++++++--- Cargo.toml | 2 +- bake/Cargo.toml | 4 +- bake/src/main.rs | 20 +++++ context/testing.md | 158 +++++++++++-------------------------- license.md | 20 +---- readme.md | 50 ++++-------- releases.md | 16 ++-- 9 files changed, 141 insertions(+), 186 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2dabe0e..e9ca89e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,3 +29,15 @@ jobs: - run: cargo clippy --workspace --all-targets --locked -- -D warnings - name: Run tests and require complete source-region coverage run: cargo bake --locked test:coverage --all-targets true + + test-result: + if: always() + needs: [test] + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Require successful tests and coverage + env: + JOB_RESULTS: ${{ toJSON(needs) }} + run: | + echo "$JOB_RESULTS" | jq -e 'all(.[]; .result == "success")' diff --git a/Cargo.lock b/Cargo.lock index 7761b39..9c99357 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ dependencies = [ [[package]] name = "bake" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbed34a1e40a3a5893a12c47de45006de3ae53112db64c0919a6e49c1a38d7e0" +checksum = "2f96c84418680954a2d9c8fe9afffb35aafb0b7086cb3cc141d613a2f0a74b42" dependencies = [ "bake-macros", "linkme", @@ -39,7 +39,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml_ng", - "socketry-markdown", + "socketry-markdown 0.1.1", ] [[package]] @@ -53,7 +53,7 @@ dependencies = [ "bake-releases", "serde", "serde_json", - "socketry-markdown", + "socketry-markdown 0.1.1", "tempfile", "toml_edit", "ureq", @@ -66,21 +66,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4877b435fe237311d88e546e8fb2b4a9021aff3550b625b8286e27da0ec693fd" dependencies = [ "bake", - "socketry-markdown", + "socketry-markdown 0.1.1", "tempfile", ] [[package]] name = "bake-macros" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b801275922e3bbc727ecdbb809f1a82591744cad907c9e915bdfa9b28bf001f" +checksum = "696dc147efb72a305f77a058388c94e651cd3586222a0ccfe3fcf145c7143242" dependencies = [ "proc-macro2", "quote", "syn 2.0.119", ] +[[package]] +name = "bake-markdown" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be72df839f4db26a93f2fe0659e57ce7998900b9445b04ba1367d51b4ba38587" +dependencies = [ + "bake", + "socketry-markdown 0.3.0", +] + [[package]] name = "bake-readme" version = "0.2.0" @@ -89,7 +99,7 @@ checksum = "9cbf2eb3710006c27705edd4186c53bc85bcca4fa80ea927a3718660e59833f2" dependencies = [ "bake", "serde_json", - "socketry-markdown", + "socketry-markdown 0.1.1", "tempfile", ] @@ -100,13 +110,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8439a25fe3a3192a666570d3d907cfb5bff8fdb5df17c92e495bcd4132ce0283" dependencies = [ "bake", - "socketry-markdown", + "socketry-markdown 0.1.1", "tempfile", ] [[package]] name = "bake-test-rust" -version = "0.3.0" +version = "0.3.1" dependencies = [ "bake", "serde_json", @@ -652,16 +662,27 @@ dependencies = [ "unicode-id", ] +[[package]] +name = "socketry-markdown" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c02f802fe678b660dd21a6b6130bc2d0eb3423c24b9f26ebddb46514769e788" +dependencies = [ + "regex", + "unicode-id", +] + [[package]] name = "socketry-project" -version = "0.3.3" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5c5a54ff8afc1eb90dfff374dad7550205d28956993b32c1bb7ae49776e1d3c" +checksum = "c2d4af345d5695d21119455e14c348b42267bc0c18eea584b44599d24f42d33e" dependencies = [ "bake", "bake-agent-context", "bake-cargo", "bake-license", + "bake-markdown", "bake-readme", "bake-releases", "bake-test-rust", diff --git a/Cargo.toml b/Cargo.toml index eff73f2..e0e6a24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bake-test-rust" -version = "0.3.0" +version = "0.3.1" edition = "2024" license = "MIT" repository = "https://github.com/socketry/bake-test-rust" diff --git a/bake/Cargo.toml b/bake/Cargo.toml index 6c4aff9..6b5686a 100644 --- a/bake/Cargo.toml +++ b/bake/Cargo.toml @@ -5,6 +5,6 @@ edition = "2024" publish = false [dependencies] -bake = ">=0.18.0" +bake = "0.19" bake-cargo = "0.4.0" -socketry-project = ">=0.3.3" +socketry-project = ">=0.3.7" diff --git a/bake/src/main.rs b/bake/src/main.rs index 175be04..4ccd2ef 100644 --- a/bake/src/main.rs +++ b/bake/src/main.rs @@ -47,6 +47,14 @@ mod tests { Ok(Value::Null) } + fn normalize_markdown(context: &mut Context, arguments: &Arguments) -> Result { + let paths = arguments.repeated::("paths")?; + assert!(context.root().join("readme-called").exists()); + fs::write(context.root().join("markdown-paths"), paths.join("\n")) + .expect("write Markdown paths"); + Ok(Value::Null) + } + #[test] fn updates_release_files_in_order_with_the_bumped_version() { let unique = std::time::SystemTime::now() @@ -73,6 +81,14 @@ mod tests { registry .register(Task::new("readme:update", "", Vec::new(), readme_update)) .expect("register readme task"); + registry + .register(Task::new( + "markdown:normalize", + "", + vec![Parameter::new::("paths").variadic()], + normalize_markdown, + )) + .expect("register Markdown task"); let mut context = registry.context(&root); after_version_bump(&mut context, "1.2.3".to_owned()).expect("run release update tasks"); @@ -89,6 +105,10 @@ mod tests { fs::read_to_string(root.join("readme-called")).unwrap(), "yes" ); + assert_eq!( + fs::read_to_string(root.join("markdown-paths")).unwrap(), + "license.md\nreadme.md\nreleases.md" + ); drop(context); fs::remove_dir_all(root).expect("remove temporary Bake project"); } diff --git a/context/testing.md b/context/testing.md index f7c2fc9..1014b6e 100644 --- a/context/testing.md +++ b/context/testing.md @@ -1,21 +1,17 @@ # Rust Testing Tasks -Add `bake-test-rust` as a dependency of the private `bake/` package and link it -from `bake/src/main.rs`: +Add `bake-test-rust` as a dependency of the private `bake/` package and link it from `bake/src/main.rs`: ```toml [dependencies] -bake-test-rust = "0.2" +bake-test-rust = "0.3" ``` ```rust,ignore use bake_test_rust as _; ``` -The package registers `test`, `test:coverage`, and `test:external` tasks. -`test` runs `cargo test --workspace --locked`; `test:external` runs Cargo tests -in the selected downstream repositories without `--locked`, because the -lockfiles need to resolve local path patches. +The package registers `test`, `test:coverage`, and `test:external` tasks. `test` runs `cargo test --workspace --locked`; `test:external` runs Cargo tests in the selected downstream repositories without `--locked`, because the lockfiles need to resolve local path patches. ## Coverage @@ -27,74 +23,33 @@ cargo +stable install cargo-llvm-cov --locked rustup run stable cargo bake test:coverage ``` -Run the task with the same toolchain that has `llvm-tools-preview`. If another -Rust installation such as Homebrew's `cargo` comes first on `PATH`, plain -`cargo bake` may use that compiler and fail to find the Rustup component. - -The task calls the optional `test:before` hook once, runs documentation tests -with Cargo, then runs workspace tests under `cargo-llvm-cov`. It reports each -uncovered source region and fails if any measured region remains uncovered. -Regions with identical source spans are merged across function instantiations; -distinct source spans remain separate, including spans on the same line. The -task covers the whole workspace by default; use `--package name` to limit -coverage to one package. Coverage uses the default feature set unless -`--all-features true` or one or more repeatable `--features name` arguments are -supplied. Choose one feature configuration per invocation; the task rejects -combining `--all-features` and `--features`. +Run the task with the same toolchain that has `llvm-tools-preview`. If another Rust installation such as Homebrew's `cargo` comes first on `PATH`, plain `cargo bake` may use that compiler and fail to find the Rustup component. + +The task calls the optional `test:before` hook once, runs documentation tests with Cargo, then runs workspace tests under `cargo-llvm-cov`. It reports each uncovered source region and fails if any measured region remains uncovered. Regions with identical source spans are merged across function instantiations; distinct source spans remain separate, including spans on the same line. The task covers the whole workspace by default; use `--package name` to limit coverage to one package. Coverage uses the default feature set unless `--all-features true` or one or more repeatable `--features name` arguments are supplied. Choose one feature configuration per invocation; the task rejects combining `--all-features` and `--features`. ### Invariant-only `unreachable!()` calls -Rust checks local type-level impossibilities, such as exhaustive matches over -closed enums. It does not generally prove runtime invariants that depend on -relationships between values, parser behavior, or upstream code. An -`unreachable!()` is a runtime assertion that panics if that invariant is -violated; it is not proof that the branch cannot occur. +Rust checks local type-level impossibilities, such as exhaustive matches over closed enums. It does not generally prove runtime invariants that depend on relationships between values, parser behavior, or upstream code. An `unreachable!()` is a runtime assertion that panics if that invariant is violated; it is not proof that the branch cannot occur. -Regions inside an `unreachable!()` invocation are excluded from coverage, -including multiline invocations. This exclusion is automatic and does not need -a marker. It applies only to Rust source regions contained within the macro -call; other uncovered code on the same line remains measured. The source scan -ignores strings and comments. +Regions inside an `unreachable!()` invocation are excluded from coverage, including multiline invocations. This exclusion is automatic and does not need a marker. It applies only to Rust source regions contained within the macro call; other uncovered code on the same line remains measured. The source scan ignores strings and comments. -Coverage uses the source regions reported by LLVM without classifying regions -by their source text. A reported region remains measured even if its span -contains only a delimiter or a macro name: LLVM can map executable behavior to -such a span, including a branch outcome mapped to a closing brace. Inspect an -uncovered region and the behavior represented by its mapping; do not exclude it -solely because its span looks syntactic. +Coverage uses the source regions reported by LLVM without classifying regions by their source text. A reported region remains measured even if its span contains only a delimiter or a macro name: LLVM can map executable behavior to such a span, including a branch outcome mapped to a closing brace. Inspect an uncovered region and the behavior represented by its mapping; do not exclude it solely because its span looks syntactic. -If `cargo-llvm-cov` reports a genuinely invariant-only `unreachable!()` call, -include its reason in the panic message: +If `cargo-llvm-cov` reports a genuinely invariant-only `unreachable!()` call, include its reason in the panic message: ```rust _ => unreachable!("Only JSX events can be mismatched here") ``` -The macro asserts that the path should not be reached; it does not prove that -the invariant is correct. Use `unreachable!()` only after checking the -invariant against supported inputs. Test valid inputs and the boundary that -establishes the invariant; do not manufacture an impossible private state -solely to execute the panic. All other source-backed regions must reach 100% -coverage. - -The canonical GitHub Actions workflow below installs the required Rust -components and coverage tool. The task measures the runner's target and feature -configuration. If a crate contains architecture-specific code, run the same -gate on each supported architecture; each run checks the code compiled for its -target. - -The coverage task runs documentation tests but does not include them in the -coverage report; LLVM doctest coverage is still unstable. It uses the JSON -function-region data to enforce 100% of measured source regions. This task -measures source regions, not LLVM's separate experimental branch-coverage -metric. +The macro asserts that the path should not be reached; it does not prove that the invariant is correct. Use `unreachable!()` only after checking the invariant against supported inputs. Test valid inputs and the boundary that establishes the invariant; do not manufacture an impossible private state solely to execute the panic. All other source-backed regions must reach 100% coverage. + +The canonical GitHub Actions workflow below installs the required Rust components and coverage tool. The task measures the runner's target and feature configuration. If a crate contains architecture-specific code, run the same gate on each supported architecture; each run checks the code compiled for its target. + +The coverage task runs documentation tests but does not include them in the coverage report; LLVM doctest coverage is still unstable. It uses the JSON function-region data to enforce 100% of measured source regions. This task measures source regions, not LLVM's separate experimental branch-coverage metric. ## Before-test hook -The `test`, `test:coverage`, and `test:external` tasks call the optional project -task `test:before` once before running tests. Use it for resources that need to -be prepared for either local or downstream tests, such as downloading fixtures -or generating assets: +The `test`, `test:coverage`, and `test:external` tasks call the optional project task `test:before` once before running tests. Use it for resources that need to be prepared for either local or downstream tests, such as downloading fixtures or generating assets: ```rust,ignore #[bake::task(name = "test:before")] @@ -108,10 +63,7 @@ fn before_test(context: &mut bake::Context) -> bake::Result<()> { } ``` -The hook is optional. If it is not registered, the test tasks continue without -calling it. External checkout and patch preparation happens before the hook; -the hook runs once before Cargo tests begin. If no downstream repositories are -configured, `test:external` returns a message without running the hook. +The hook is optional. If it is not registered, the test tasks continue without calling it. External checkout and patch preparation happens before the hook; the hook runs once before Cargo tests begin. If no downstream repositories are configured, `test:external` returns a message without running the hook. ## External repositories @@ -123,47 +75,19 @@ repository = "https://github.com/socketry/downstream-project" branch = "main" ``` -For a single-package project, use -`[[package.metadata.bake.test.external]]`. `branch` defaults to `main`. Add -`name = "checkout-name"` when you want the local checkout directory to use a -specific name or avoid a name collision. If the list is empty or absent, -`test:external` reports that no downstream repositories are configured. - -The task clones each repository into `external//` on first use. It keeps -existing Git checkouts and does not fetch, reset, switch branches, or discard -local edits. To update a checkout, run Git commands inside it. If the metadata -repository no longer matches the checkout, choose a new `name` or move the old -directory yourself. - -The task adds this workspace's crates.io-publishable packages to the cloned -repository's `[patch.crates-io]` table, using relative paths back to the local -workspace. Existing unrelated manifest content is preserved, and the same -patches are not inserted a second time. If a conflicting patch already exists, -the task stops and asks you to resolve that entry. The patch remains in the -checkout so you can enter it and run `cargo test --workspace` manually to -investigate a failure. Add `/external/` to the consumer repository's -`.gitignore`, as this repository does. - -Cargo still checks the downstream dependency's version requirement. If the -local workspace version does not satisfy it, update that requirement in the -checkout before rerunning external tests. The task checks Cargo's resolved -dependency graph and stops if a downstream dependency silently resolves to the -registry version instead of the local patch. +For a single-package project, use `[[package.metadata.bake.test.external]]`. `branch` defaults to `main`. Add `name = "checkout-name"` when you want the local checkout directory to use a specific name or avoid a name collision. If the list is empty or absent, `test:external` reports that no downstream repositories are configured. + +The task clones each repository into `external//` on first use. It keeps existing Git checkouts and does not fetch, reset, switch branches, or discard local edits. To update a checkout, run Git commands inside it. If the metadata repository no longer matches the checkout, choose a new `name` or move the old directory yourself. + +The task adds this workspace's crates.io-publishable packages to the cloned repository's `[patch.crates-io]` table, using relative paths back to the local workspace. Existing unrelated manifest content is preserved, and the same patches are not inserted a second time. If a conflicting patch already exists, the task stops and asks you to resolve that entry. The patch remains in the checkout so you can enter it and run `cargo test --workspace` manually to investigate a failure. Add `/external/` to the consumer repository's `.gitignore`, as this repository does. + +Cargo still checks the downstream dependency's version requirement. If the local workspace version does not satisfy it, update that requirement in the checkout before rerunning external tests. The task checks Cargo's resolved dependency graph and stops if a downstream dependency silently resolves to the registry version instead of the local patch. ## Canonical GitHub workflows -Use this `test.yml` for Socketry Rust repositories. It runs formatting, -Clippy, documentation tests, and workspace coverage. The coverage task invokes -the optional `test:before` hook and requires 100% coverage of measured source -regions. Passing -`--all-targets true` includes examples and benchmarks in the coverage run. Do -not add a separate `cargo bake test` step to this job; the coverage task runs -the tests itself. +Use this `test.yml` for Socketry Rust repositories. It runs formatting, Clippy, documentation tests, and workspace coverage. The coverage task invokes the optional `test:before` hook and requires 100% coverage of measured source regions. Passing `--all-targets true` includes examples and benchmarks in the coverage run. Do not add a separate `cargo bake test` step to this job; the coverage task runs the tests itself. -Filter both `push` and `pull_request` to `main`. Pull request updates then run -through `pull_request`, without a duplicate run from the feature-branch push; -merging to `main` still runs the workflow after the merge. Keep -`workflow_dispatch` for manual runs. +Filter both `push` and `pull_request` to `main`. Pull request updates then run through `pull_request`, without a duplicate run from the feature-branch push; merging to `main` still runs the workflow after the merge. Keep `workflow_dispatch` for manual runs. ```yaml name: Test @@ -197,19 +121,27 @@ jobs: - run: cargo clippy --workspace --all-targets --locked -- -D warnings - name: Run tests and require complete source-region coverage run: cargo bake --locked test:coverage --all-targets true + + test-result: + if: always() + needs: [test] + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Require successful tests and coverage + env: + JOB_RESULTS: ${{ toJSON(needs) }} + run: | + echo "$JOB_RESULTS" | jq -e 'all(.[]; .result == "success")' ``` -The standard `test` task remains useful for quick local runs without a coverage -report. CI uses `test:coverage` so it enforces the organization-wide -source-region coverage requirement. +Require `test-result` alongside the publishing workflow's `check` job in the main-branch ruleset. For a matrix or several required test jobs, list every required job in `needs`. The aggregate runs even when a prerequisite fails, and succeeds only when every listed job succeeds. Keep experimental or diagnostic jobs outside that required gate. + +The standard `test` task remains useful for quick local runs without a coverage report. CI uses `test:coverage` so it enforces the organization-wide source-region coverage requirement. -External compatibility testing is optional. Add -`.github/workflows/external.yml` only when the Cargo metadata list contains one -or more selected downstream repositories: +External compatibility testing is optional. Add `.github/workflows/external.yml` only when the Cargo metadata list contains one or more selected downstream repositories: -Use the same event filters as `test.yml`: pull requests targeting `main` and -pushes to `main`. This prevents duplicate downstream test runs for a pull -request branch while still checking the merged default branch. +Use the same event filters as `test.yml`: pull requests targeting `main` and pushes to `main`. This prevents duplicate downstream test runs for a pull request branch while still checking the merged default branch. ```yaml name: External Tests @@ -237,6 +169,4 @@ jobs: run: cargo bake --locked test:external ``` -The external task creates fresh checkouts in the workflow's temporary runner -and applies the local patches before testing. Remove this workflow when the -metadata list becomes empty. +The external task creates fresh checkouts in the workflow's temporary runner and applies the local patches before testing. Remove this workflow when the metadata list becomes empty. diff --git a/license.md b/license.md index e589fcc..17fbb94 100644 --- a/license.md +++ b/license.md @@ -1,21 +1,9 @@ # MIT License -Copyright, 2026, by Samuel Williams. +Copyright, 2026, by Samuel Williams. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/readme.md b/readme.md index aec643e..d00e1ff 100644 --- a/readme.md +++ b/readme.md @@ -1,15 +1,10 @@ # `bake-test-rust` -Reusable Bake tasks for running Rust tests and testing downstream repositories -against local Cargo workspace packages. +Reusable Bake tasks for running Rust tests and testing downstream repositories against local Cargo workspace packages. ## Motivation -Rust provides a good test runner through Cargo, but it does not provide a shared -way to prepare project resources or exercise selected downstream crates. This -package gives Rust projects a consistent `bake test`, `bake test:coverage`, -and `bake test:external` interface while keeping Cargo and cargo-llvm-cov as -the test runners. +Rust provides a good test runner through Cargo, but it does not provide a shared way to prepare project resources or exercise selected downstream crates. This package gives Rust projects a consistent `bake test`, `bake test:coverage`, and `bake test:external` interface while keeping Cargo and cargo-llvm-cov as the test runners. ## Usage @@ -17,7 +12,7 @@ Add the task crate to the private `bake/` package: ```toml [dependencies] -bake-test-rust = "0.2" +bake-test-rust = "0.3" ``` Link its tasks from `bake/src/main.rs`: @@ -34,13 +29,7 @@ cargo bake test:coverage cargo bake test:external ``` -The coverage task runs documentation tests and requires 100% measured -source-region coverage for the selected workspace test configuration. -Regions inside `unreachable!()` calls are excluded automatically. It reports -uncovered source locations when the gate fails. -Install `cargo-llvm-cov` first; see the -[Rust Testing guide](context/testing.md) for feature selection and architecture notes. -Use `--package name` to limit a workspace run to one package. +The coverage task runs documentation tests and requires 100% measured source-region coverage for the selected workspace test configuration. Regions inside `unreachable!()` calls are excluded automatically. It reports uncovered source locations when the gate fails. Install `cargo-llvm-cov` first; see the [Rust Testing guide](context/testing.md) for feature selection and architecture notes. Use `--package name` to limit a workspace run to one package. Configure downstream repositories in the root `Cargo.toml`: @@ -50,39 +39,32 @@ repository = "https://github.com/socketry/downstream-project" branch = "main" ``` -See the [Rust Testing guide](context/testing.md) for the `test:before` hook, -checkout reuse, Cargo patching, and canonical GitHub Actions workflows. +See the [Rust Testing guide](context/testing.md) for the `test:before` hook, checkout reuse, Cargo patching, and canonical GitHub Actions workflows. ## Releasing -Prepare a release with `cargo bake cargo:version:patch` (or `minor`, `major`, -or `bump --version X.Y.Z`), then run `cargo bake cargo:release` and open a -pull request. After review and merge, GitHub Actions publishes the release -when the configured `crates-io` environment approves it. Follow the shared -[Releasing skill](https://github.com/socketry/socketry-project-rust/blob/main/context/releasing.md) -for the standard process. +Prepare a release with `cargo bake cargo:version:patch` (or `minor`, `major`, or `bump --version X.Y.Z`), then run `cargo bake cargo:release` and open a pull request. After review and merge, GitHub Actions publishes the release when the configured `crates-io` environment approves it. Follow the shared [Releasing skill](https://github.com/socketry/socketry-project-rust/blob/main/context/releasing.md) for the standard process. ## Releases + See [releases.md](releases.md) for the full release history. +### v0.3.1 + +- Adopt `socketry-project` 0.3.7 for shared project tasks and Markdown normalization. +- Require the aggregate test and coverage result for pull request merges. +- Document the canonical aggregate test gate and current coverage dependency. + ### v0.3.0 -- Enforce complete source-region coverage, excluding regions inside - invariant-only `unreachable!()` calls. +- Enforce complete source-region coverage, excluding regions inside invariant-only `unreachable!()` calls. ### v0.2.3 - Exclude uncovered, single-line `unreachable!("reason")` expressions from measured coverage automatically. -### v0.2.2 - -- Declare compatibility with the Bake 0.x API so task libraries can share one task registry - when upgrading to crate-derived task namespaces. - -- Document how to install and discover dependency context and skills. -- Assert external test runs refresh each checkout's Cargo lockfile. ## See Also @@ -96,6 +78,4 @@ Please open an issue or pull request on [GitHub](https://github.com/socketry/bak ### Agent Context -Before contributing, run `cargo bake agent:context:install` to install context -and skills from package dependencies. Read `.agents/context/index.md` to find -available guidance and the relevant skills under `.agents/skills/`. +Run `cargo bake agent:context:install` to install shared context and skills. Read `.agents/context/index.md` to find relevant guides, follow `agents.md` if present, and apply skills under `.agents/skills/`. The installer preserves repository-owned `agents.md`; it does not create or regenerate that file. diff --git a/releases.md b/releases.md index 85f5ebf..6319454 100644 --- a/releases.md +++ b/releases.md @@ -1,9 +1,14 @@ # Releases +## v0.3.1 + +- Adopt `socketry-project` 0.3.7 for shared project tasks and Markdown normalization. +- Require the aggregate test and coverage result for pull request merges. +- Document the canonical aggregate test gate and current coverage dependency. + ## v0.3.0 -- Enforce complete source-region coverage, excluding regions inside - invariant-only `unreachable!()` calls. +- Enforce complete source-region coverage, excluding regions inside invariant-only `unreachable!()` calls. ## v0.2.3 @@ -11,16 +16,15 @@ ## v0.2.2 -- Declare compatibility with the Bake 0.x API so task libraries can share one task registry - when upgrading to crate-derived task namespaces. +- Declare compatibility with the Bake 0.x API so task libraries can share one task registry when upgrading to crate-derived task namespaces. - Document how to install and discover dependency context and skills. + - Assert external test runs refresh each checkout's Cargo lockfile. ## v0.2.1 -- Use the shared `socketry-project` Releasing skill for the standard release - process and remove references to the duplicate Bake Cargo publishing context. +- Use the shared `socketry-project` Releasing skill for the standard release process and remove references to the duplicate Bake Cargo publishing context. ## v0.2.0 From 878fffb772b11649c8d56b55fd95dd736ca04031 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 6 Oct 2026 01:15:32 +1300 Subject: [PATCH 2/2] Keep validated release-hook fixture paths infallible. --- bake/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bake/src/main.rs b/bake/src/main.rs index 4ccd2ef..be6c365 100644 --- a/bake/src/main.rs +++ b/bake/src/main.rs @@ -48,7 +48,9 @@ mod tests { } fn normalize_markdown(context: &mut Context, arguments: &Arguments) -> Result { - let paths = arguments.repeated::("paths")?; + let paths = arguments + .repeated::("paths") + .expect("valid Markdown paths"); assert!(context.root().join("readme-called").exists()); fs::write(context.root().join("markdown-paths"), paths.join("\n")) .expect("write Markdown paths");