Skip to content

Commit 3f9f97f

Browse files
authored
Add extra logging to publisher to capture errors (#4507)
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> We recently had a failing release run without enough logs to debug what actually happened: https://github.com/smithy-lang/smithy-rs/actions/runs/21417345086/job/61691325413 The final logs are below, note that they don't include any of the output from the failed runs of `cargo publish`: ``` 2026-01-28T04:24:12.316457Z INFO publish{handle=PackageHandle { name: "aws-smithy-legacy-http-server", version: Some(Version { major: 0, minor: 65, patch: 11 }) } crate_path="./aws-smithy-legacy-http-server"}: publisher::publish: new 2026-01-28T04:24:12.316503Z INFO publish{handle=PackageHandle { name: "aws-smithy-legacy-http-server", version: Some(Version { major: 0, minor: 65, patch: 11 }) } crate_path="./aws-smithy-legacy-http-server"}: publisher::publish: Publishing `aws-smithy-legacy-http-server-0.65.11`... 2026-01-28T04:28:14.187956Z INFO publish{handle=PackageHandle { name: "aws-smithy-legacy-http-server", version: Some(Version { major: 0, minor: 65, patch: 11 }) } crate_path="./aws-smithy-legacy-http-server"}: publisher::publish: close time.busy=769µs time.idle=242s Error: failed 5 times and won't be retried again Error: Process completed with exit code 1. ``` _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 28e2d70 commit 3f9f97f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/ci-build/publisher/src/cargo/publish.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ impl ShellOperation for Publish {
4444
.arg("1")
4545
.arg("--no-verify"); // The crates have already been built in previous CI steps
4646
let output = command.output()?;
47+
let (stdout, stderr) = output_text(&output);
48+
4749
if !output.status.success() {
48-
let (stdout, stderr) = output_text(&output);
4950
let already_uploaded_msg = format!(
5051
"error: crate version `{}` is already uploaded",
5152
self.package_handle.expect_version()
@@ -56,8 +57,14 @@ impl ShellOperation for Publish {
5657
self.package_handle
5758
);
5859
} else {
60+
info!(
61+
"cargo publish failed for {}\nStdout:\n{}\nStderr:\n{}",
62+
self.package_handle, stdout, stderr
63+
);
5964
return Err(capture_error("cargo publish", &output));
6065
}
66+
} else {
67+
info!("cargo publish succeeded for {}", self.package_handle);
6168
}
6269
Ok(())
6370
}

0 commit comments

Comments
 (0)