-
Notifications
You must be signed in to change notification settings - Fork 116
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
tfexec: Add -allow-deferral
experimental options to Plan
and Apply
commands
#447
Conversation
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" { | ||
t.Skip("Terraform for darwin/arm64 is not available until v1") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipping to avoid this error: https://github.com/hashicorp/terraform-exec/actions/runs/8914271134/job/24481540878?pr=447
An unfortunate situation where the latest macos GHA runners now are macOS 14 and ARM64 architecture machines: https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/. We ran into this issue on setup-terraform
last week: hashicorp/setup-terraform#409
I'm not sure if we want to default fallback to amd64
or if skipping this on arm64
is acceptable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think skipping on arm64 is acceptable given that the nature of the test is to check for version differences, not so much architecture differences, and the former is already being checked on other platforms as well.
@@ -80,7 +80,7 @@ jobs: | |||
- resolve-versions | |||
- static-checks | |||
runs-on: ${{ matrix.os }} | |||
timeout-minutes: 10 | |||
timeout-minutes: 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another GH workflow related change, it seems that setup-go
is taking an extra 2 minutes to setup Go 1.22.x
on windows-latest
, not leaving enough time for the rest of the job to run 🙂 : https://github.com/hashicorp/terraform-exec/actions/runs/8914407327/job/24482771576?pr=447
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, I will chase Katy or Radek for a quick look in case I'm missing something as I haven't look closely at this before.
@@ -180,6 +181,22 @@ func (tf *Terraform) compatible(ctx context.Context, minInclusive *version.Versi | |||
return nil | |||
} | |||
|
|||
// experimentsEnabled asserts the cached terraform version has experiments enabled in the executable, | |||
// and returns a well known error if not. Experiments are enabled in alpha and (potentially) dev builds of Terraform. | |||
func (tf *Terraform) experimentsEnabled(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would've probably called this versionIsPrerelease()
or something along these lines, as that's what the function actually does but it's also not exposed API to downstream so I'm not too worried about the name here.
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" { | ||
t.Skip("Terraform for darwin/arm64 is not available until v1") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think skipping on arm64 is acceptable given that the nature of the test is to check for version differences, not so much architecture differences, and the former is already being checked on other platforms as well.
This PR introduces a new plan and apply flag
-allow-deferral
. This flag enables the deferred actions experiment that was introduced in Terraformv1.9.0-alpha20240404
Notes
alpha
ordev
in the version as a best effort. Happy to update with a more accurate method if one exists!