🤖🤖🤖 Close WriteSnapshotToDir snapshot file handles#38534
Conversation
Ensure `WriteSnapshotToDir` always closes the created snapshot file and returns close errors when write succeeds but close fails. Add focused regression coverage in `internal/modsdir` for repeated snapshot writes and file-handle release behavior. Tested: go test ./internal/modsdir in a Go 1.25.8 Docker container Tested: git diff --check -- internal/modsdir/manifest.go internal/modsdir/manifest_test.go '.changes/v1.16/BUG FIXES-20260506-195131.yaml' pr-request-dd-026-terraform-38302.txt
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
|
Thanks for this submission. Please see our Contributing.md document regarding submission guidelines, particularly Proposing a Change and rules on disclosure of usage of GenAI. So that this can be considered for review, please also sign the CLA as per this comment: #38534 (comment). Thanks! |
WriteSnapshotToDir snapshot file handlesWriteSnapshotToDir snapshot file handles
|
@crw Thanks for pointing me to those guidelines. I updated the PR title/body to include the issue reference and the AI usage disclosure requested in The remaining blocker is the CLA check; I’ll get that handled before expecting review. |
|
@crw about CLA, I signed it, though I could not find a page to confirm I have signed it. The bot still shows that I am not signed. |
Empty commit to check whether the CLA bot re-runs after the CLA was signed. Signed-off-by: Mike Ma <mike.ma@lmctl.com>
The CLA signing mechanism is based on matching the email of the account doing the signing to the email doing the commit. Sometimes those are not the same email. Do you know if you committed with the same email as you signed? If so I'll do some deeper digging on this side with regards to what email we have signed for you. Thanks! |
Fixes #38302.
This closes the
modules.jsonsnapshot file on allWriteSnapshotToDirreturn paths and returns close errors after a successful encode when appropriate.The regression tests cover repeated writes and file-handle release behavior in
internal/modsdir.AI usage disclosure: AI assistance was used to inspect the affected code path and draft the initial patch/tests. I reviewed the change, kept the scope to
internal/modsdir, and tested it locally.Tested:
go test ./internal/modsdirin a Go 1.25.8 Docker container