diff --git a/.run_status.toml b/.run_status.toml index 8291ac7..9acfa55 100644 --- a/.run_status.toml +++ b/.run_status.toml @@ -1,11 +1,11 @@ [last_run_clean] run_status = "Success" -lines_parsed = 427 +lines_parsed = 439 coverage = 92.72 [last_run_clean.run_duration] -secs = 63 -nanos = 266754653 +secs = 62 +nanos = 838606094 [last_run_incremental] run_status = "Success" diff --git a/CHANGELOG.md b/CHANGELOG.md index 9303da8..ce06e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ All notable changes to John Slop are recorded here. The format follows ## [Unreleased] +## [0.1.27-rc.4] - 2026-09-30 + +### Fixed + +- Made the release wrapper temporarily select the canonical HTTPS origin for + publication and restore the developer SSH origin whether publication succeeds + or fails. + ## [0.1.27-rc.3] - 2026-09-30 ### Changed @@ -175,7 +183,8 @@ All notable changes to John Slop are recorded here. The format follows - Stdio LSP replacement diagnostics and versioned quick fixes. - Runnable examples, reviewed fixtures, fuzz targets, benchmarks, and CI gates. -[Unreleased]: https://proxy.dandaedre.com/gitea/idle-org/john-slop/compare/v0.1.27-rc.3...HEAD +[Unreleased]: https://proxy.dandaedre.com/gitea/idle-org/john-slop/compare/v0.1.27-rc.4...HEAD +[0.1.27-rc.4]: https://proxy.dandaedre.com/gitea/idle-org/john-slop/compare/v0.1.27-rc.3...v0.1.27-rc.4 [0.1.27-rc.3]: https://proxy.dandaedre.com/gitea/idle-org/john-slop/compare/v0.1.27-rc.2...v0.1.27-rc.3 [0.1.27-rc.2]: https://proxy.dandaedre.com/gitea/idle-org/john-slop/compare/v0.1.27-rc.1...v0.1.27-rc.2 [0.1.27-rc.1]: https://proxy.dandaedre.com/gitea/idle-org/john-slop/compare/v0.1.26...v0.1.27-rc.1 diff --git a/Cargo.lock b/Cargo.lock index 5e3d603..0bc1e04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -699,7 +699,7 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "john-slop" -version = "0.1.27-rc.3" +version = "0.1.27-rc.4" dependencies = [ "clap", "criterion", @@ -724,7 +724,7 @@ dependencies = [ [[package]] name = "john-slop-core" -version = "0.1.27-rc.3" +version = "0.1.27-rc.4" dependencies = [ "directories", "figment", @@ -742,7 +742,7 @@ dependencies = [ [[package]] name = "john-slop-lsp" -version = "0.1.27-rc.3" +version = "0.1.27-rc.4" dependencies = [ "john-slop-core", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index c9f4a1b..0f327c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = [".", "crates/john-slop-core", "crates/john-slop-lsp"] resolver = "3" [workspace.package] -version = "0.1.27-rc.3" +version = "0.1.27-rc.4" edition = "2024" rust-version = "1.98.1" license = "MIT" @@ -18,8 +18,8 @@ figment = { version = "0.10.19", default-features = false, features = ["toml"] } futures = { version = "0.3.34", default-features = false, features = ["std"] } globset = { version = "0.4.20", default-features = false } insta = { version = "1.48.0", default-features = false } -john-slop-core = { version = "0.1.27-rc.3", path = "crates/john-slop-core" } -john-slop-lsp-engine = { package = "john-slop-lsp", version = "0.1.27-rc.3", path = "crates/john-slop-lsp" } +john-slop-core = { version = "0.1.27-rc.4", path = "crates/john-slop-core" } +john-slop-lsp-engine = { package = "john-slop-lsp", version = "0.1.27-rc.4", path = "crates/john-slop-lsp" } miette = { version = "7.6.0", default-features = false, features = ["derive"] } regex = "1.13.1" serde = { version = "1.0.229", features = ["derive"] } diff --git a/badges/version.svg b/badges/version.svg index 07aff91..d42ebb5 100644 --- a/badges/version.svg +++ b/badges/version.svg @@ -1 +1 @@ -version: 0.1.27-rc.3version0.1.27-rc.3 \ No newline at end of file +version: 0.1.27-rc.4version0.1.27-rc.4 \ No newline at end of file diff --git a/docs/releasing.md b/docs/releasing.md index a9e815e..d8f702e 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -52,8 +52,10 @@ then pass the path of a readable Gitea token file to the repository wrapper: The wrapper keeps the token out of command-line arguments, exports it as `GITEA_TOKEN` only to `rust_realease`, selects the `john-slop` workspace package, -and publishes raw binary artifacts. A hyphenated Cargo version such as -`0.1.27-rc.2` automatically marks the Gitea release as a prerelease. Additional +and publishes raw binary artifacts. It temporarily selects the canonical HTTPS +origin for publication, then restores the SSH development origin after both +successful and failed attempts. A hyphenated Cargo version such as +`0.1.27-rc.4` automatically marks the Gitea release as a prerelease. Additional arguments are forwarded, so use `--dry-run` before publication and `--replace-assets` only after reviewing an existing release collision. The checkout must be clean and its local and remote `vX.Y.Z` tag must match the diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 2171312..190670a 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -385,7 +385,7 @@ dependencies = [ [[package]] name = "john-slop-core" -version = "0.1.27-rc.3" +version = "0.1.27-rc.4" dependencies = [ "directories", "figment", @@ -411,7 +411,7 @@ dependencies = [ [[package]] name = "john-slop-lsp" -version = "0.1.27-rc.3" +version = "0.1.27-rc.4" dependencies = [ "john-slop-core", "serde_json", @@ -422,7 +422,7 @@ dependencies = [ [[package]] name = "john-slop" -version = "0.1.27-rc.3" +version = "0.1.27-rc.4" dependencies = [ "clap", "globset", diff --git a/release.sh b/release.sh index c647aab..c3692f0 100755 --- a/release.sh +++ b/release.sh @@ -30,6 +30,32 @@ export GITEA_TOKEN repository_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) manifest_version=$(sed -n 's/^version = "\([^"]*\)"/\1/p' "$repository_dir/Cargo.toml" | head -n 1) +release_origin=https://proxy.dandaedre.com/gitea/idle-org/john-slop +development_origin=git@git.dandaedre.com:idle-org/john-slop.git + +if ! git -C "$repository_dir" remote get-url origin >/dev/null 2>&1; then + echo "Git origin is not configured for $repository_dir" >&2 + exit 2 +fi + +origin_switched=false +restore_development_origin() { + if [ "$origin_switched" = true ]; then + if git -C "$repository_dir" remote set-url origin "$development_origin"; then + origin_switched=false + else + echo "error: failed to restore Git origin to $development_origin" >&2 + return 1 + fi + fi +} + +git -C "$repository_dir" remote set-url origin "$release_origin" +origin_switched=true +trap 'restore_development_origin || :' 0 +trap 'exit 129' 1 +trap 'exit 130' 2 +trap 'exit 143' 15 set -- \ "$repository_dir" \ @@ -40,4 +66,10 @@ case "$manifest_version" in *-*) set -- "$@" --prerelease ;; esac -exec rust_realease "$@" +release_status=0 +rust_realease "$@" || release_status=$? +if ! restore_development_origin; then + exit 2 +fi +trap - 0 1 2 15 +exit "$release_status" diff --git a/tasks.md b/tasks.md index b4abc6e..f6c99df 100644 --- a/tasks.md +++ b/tasks.md @@ -788,6 +788,25 @@ versions, and 92.72% coverage passed. Cargo metadata and release artifacts use retain underscores. The local origin is prepared for the renamed upstream, and the earlier RC tags remain unchanged. +## Release candidate 0.1.27-rc.4 + +- [x] Make `release.sh` temporarily switch `origin` to the canonical HTTPS + release repository, invoke `rust_realease`, and restore the SSH development + origin after both successful and failed invocations. +- [x] Synchronize release artifacts at `0.1.27-rc.4`, run the complete quality + and release gates, and create immutable annotated tag `v0.1.27-rc.4` without + moving any earlier release-candidate tag. + +Acceptance: an integration test observes the HTTPS origin during publication +and the restored SSH origin afterward for zero and nonzero publisher exits; all +gates pass, the release dry-run succeeds, and earlier RC tags remain unchanged. + +Accepted on 2026-09-30: the release-wrapper integration test observed HTTPS +during publication and SSH after both success and failure; formatting, Clippy, +both feature test matrices, documentation, RustSec, dependency policy, package +assembly, exact binary versions, and 92.72% clean coverage passed. Earlier RC +tags remain unchanged before RC4 is tagged. + ## Deferred by design - Statistical or model-based authorship classification. diff --git a/tests/fixtures/evaluation/signoff.toml b/tests/fixtures/evaluation/signoff.toml index 9a45006..7f54690 100644 --- a/tests/fixtures/evaluation/signoff.toml +++ b/tests/fixtures/evaluation/signoff.toml @@ -1,5 +1,5 @@ schema_version = 1 -release = "0.1.27-rc.3" +release = "0.1.27-rc.4" reviewed_on = "2026-09-30" status = "accepted-with-runtime-catalog-boundary" catalog_sha256 = "da34ce00dfd2d801e772fa440d932abb98c929f5ad08ff3ad5e47e0ed4d84d5a" diff --git a/tests/release_wrapper.rs b/tests/release_wrapper.rs new file mode 100644 index 0000000..76b55ff --- /dev/null +++ b/tests/release_wrapper.rs @@ -0,0 +1,101 @@ +#![cfg(unix)] + +use std::{ + env, fs, + os::unix::fs::PermissionsExt, + path::Path, + process::{Command, Output}, +}; + +use tempfile::TempDir; + +const RELEASE_ORIGIN: &str = "https://proxy.dandaedre.com/gitea/idle-org/john-slop"; +const DEVELOPMENT_ORIGIN: &str = "git@git.dandaedre.com:idle-org/john-slop.git"; + +fn run(command: &mut Command) -> Output { + command.output().expect("test command should start") +} + +fn git(repository: &Path, arguments: &[&str]) -> Output { + run(Command::new("git") + .arg("-C") + .arg(repository) + .args(arguments)) +} + +#[test] +fn release_wrapper_uses_https_then_restores_ssh_on_every_exit() { + for release_status in [0, 17] { + let temporary = TempDir::new().expect("temporary directory should be created"); + let repository = temporary.path().join("repository"); + let fake_bin = temporary.path().join("bin"); + fs::create_dir_all(&repository).expect("repository directory should be created"); + fs::create_dir_all(&fake_bin).expect("fake binary directory should be created"); + + fs::copy( + Path::new(env!("CARGO_MANIFEST_DIR")).join("release.sh"), + repository.join("release.sh"), + ) + .expect("release wrapper should be copied"); + fs::write( + repository.join("Cargo.toml"), + "[package]\nname = \"john-slop\"\nversion = \"0.1.27-rc.4\"\n", + ) + .expect("manifest should be written"); + fs::write(repository.join("token.txt"), "test-token\n") + .expect("token file should be written"); + + let fake_release = fake_bin.join("rust_realease"); + fs::write( + &fake_release, + "#!/bin/sh\n\ + [ \"$GITEA_TOKEN\" = test-token ] || exit 91\n\ + git -C \"$1\" remote get-url origin >\"$OBSERVED_ORIGIN\"\n\ + exit \"$FAKE_RELEASE_STATUS\"\n", + ) + .expect("fake release executable should be written"); + let mut permissions = fs::metadata(&fake_release) + .expect("fake release metadata should be readable") + .permissions(); + permissions.set_mode(0o755); + fs::set_permissions(&fake_release, permissions) + .expect("fake release executable permissions should be set"); + + assert!(git(&repository, &["init", "--quiet"]).status.success()); + assert!( + git( + &repository, + &["remote", "add", "origin", DEVELOPMENT_ORIGIN] + ) + .status + .success() + ); + + let observed_origin = temporary.path().join("observed-origin.txt"); + let path = format!( + "{}:{}", + fake_bin.display(), + env::var("PATH").expect("PATH should be available") + ); + let output = run(Command::new(repository.join("release.sh")) + .arg(repository.join("token.txt")) + .arg("--dry-run") + .env("PATH", path) + .env("OBSERVED_ORIGIN", &observed_origin) + .env("FAKE_RELEASE_STATUS", release_status.to_string())); + + assert_eq!(output.status.code(), Some(release_status)); + assert_eq!( + fs::read_to_string(&observed_origin) + .expect("fake release should record the temporary origin") + .trim(), + RELEASE_ORIGIN + ); + assert_eq!( + String::from_utf8(git(&repository, &["remote", "get-url", "origin"]).stdout) + .expect("origin should be UTF-8") + .trim(), + DEVELOPMENT_ORIGIN + ); + } +}