Skip to content

Check exit code of providers mirror#28

Open
agentydragon wants to merge 1 commit intoyanndegat:mainfrom
agentydragon:claude/fix-rules-tf-bug-pVjdf
Open

Check exit code of providers mirror#28
agentydragon wants to merge 1 commit intoyanndegat:mainfrom
agentydragon:claude/fix-rules-tf-bug-pVjdf

Conversation

@agentydragon
Copy link
Copy Markdown

terraform/tofu providers mirror was executed without checking the return code, and stdout was redirected to /dev/null. A transient registry outage would silently make Bazel cache an incomplete mirror. Later validate tests would restore the bad cache and fail with "provider not found in mirror".

Fix: Capture the execution result, remove output suppression, and fail immediately with the exit code and stderr when mirroring fails.

The `terraform providers mirror` and `tofu providers mirror` commands
were executed without checking the return code, and stdout was
redirected to /dev/null. A transient registry outage would silently
produce an incomplete mirror that Bazel caches, causing later validate
tests to fail with "provider not found in mirror".

Capture the execution result, remove output suppression, and fail
immediately with the exit code and stderr when the mirror command fails.

https://claude.ai/code/session_013H4EkisvYx73E5FbMs4EA7
Copilot AI review requested due to automatic review settings March 1, 2026 21:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves reliability of the Bazel-managed Terraform/OpenTofu provider mirror generation by surfacing failures from terraform/tofu providers mirror instead of silently producing an incomplete mirror during transient registry outages.

Changes:

  • Capture and check the ctx.execute(...) result when running providers mirror for both Terraform and OpenTofu toolchains.
  • Stop redirecting providers mirror stdout to /dev/null so that output is available for debugging and included on failures.
  • Fail fast with the exit code and captured stdout/stderr when mirroring fails.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tf/toolchains/tofu/toolchain.bzl Capture tofu providers mirror execution result and fail with diagnostics on non-zero exit.
tf/toolchains/terraform/toolchain.bzl Capture terraform providers mirror execution result and fail with diagnostics on non-zero exit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

agentydragon-agent pushed a commit to agentydragon-agent/ducktape that referenced this pull request Mar 1, 2026
agentydragon added a commit to agentydragon/ducktape that referenced this pull request Mar 1, 2026
Link yanndegat/rules_tf#28 so we know to remove
the patches once the fix is upstreamed.

https://claude.ai/code/session_014ZBAiyeychPb2xrP1kJPZ4

Co-authored-by: Claude <noreply@anthropic.com>
agentydragon added a commit to agentydragon/ducktape that referenced this pull request Mar 1, 2026
Link yanndegat/rules_tf#28 so we know to remove
the patches once the fix is upstreamed.

https://claude.ai/code/session_014ZBAiyeychPb2xrP1kJPZ4

Co-authored-by: Claude <noreply@anthropic.com>
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.

3 participants