Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture stderr from extracting Zstandard bundles #2514

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

henrymercer
Copy link
Contributor

We use the standard toolcache API to decompress bundles, but when decompression fails, we only get the exit code from the toolcache API, which isn't very helpful for debugging.

Therefore this PR calls tar directly when decompressing Zstandard bundles to provide better quality failure information. A large part of the PR is a refactor to expose the functionality we use for invoking and capturing errors from the CLI in a generic way.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@henrymercer henrymercer requested a review from a team as a code owner October 2, 2024 17:27
Copy link
Contributor

@angelapwen angelapwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactoring makes sense 👍 just a question!

Comment on lines +102 to +106
if (!tarVersion) {
throw new Error(
"Could not determine tar version, which is required to extract a Zstandard archive.",
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does throwing here prevent us from falling back on the gzip version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to double check this — this should indeed be covered by the fallback in setupCodeQLBundle.

@henrymercer henrymercer merged commit e85017e into main Oct 2, 2024
277 checks passed
@henrymercer henrymercer deleted the henrymercer/zstd-better-failure-logging branch October 2, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants