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

Running test_lint locally when lockfiles exist #2622

Open
wyardley opened this issue Sep 25, 2024 · 2 comments
Open

Running test_lint locally when lockfiles exist #2622

wyardley opened this issue Sep 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@wyardley
Copy link
Contributor

wyardley commented Sep 25, 2024

TL;DR

The validation portion of test_lint can fail when there is a lockfile present locally, since most projects have the lockfiles .gitignored, but generation of them can't be suppressed

However, since in some places, the lockfile is checked in, @apeabody says it probably isn't ideal to just force -upgrade on all terraform init calls as I'd originally proposed in the linked issue.

So perhaps there should be a way to control the behavior. Removing the lockfile might also be an option, but that seems riskier / more unexpected or undesirable from the standpoint of the end user.

Another option would be to do the whole init / validate in a temporary copy (perhaps the one that I think is already checked out?)

Expected behavior

The validation to succeed when a new version has come out since the lockfile was last created.

Observed behavior

Don't have the exact error handy now, but it's the one where the version is locked and can't be updated without init -upgrade

Terraform Configuration

n/a

Terraform Version

Terraform v1.9.5
on darwin_arm64

Additional information

See discussion starting at #2617 (comment)

@wyardley wyardley added the bug Something isn't working label Sep 25, 2024
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Nov 24, 2024
@apeabody
Copy link
Collaborator

Hmm, an option might be to check if the lockfile is tracked by git. If it is not tracked, it is likely safe to delete/upgrade.

@apeabody apeabody removed the Stale label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants