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

fix modules.json and terraform-sources.json overriding each other #1903

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

ansgarm
Copy link
Member

@ansgarm ansgarm commented Dec 19, 2024

#1836 added support for parsing terraform-sources.json files present in stacks projects. As the modules.json and the terraform-sources.json files are mutually exclusive and thus not expected to be present at the same time, that PR re-used the existing InstalledModules for simplicity. However, it thereby accidentally introduced a race between the two jobs looking for and parsing these files. In the case of hashicorp/vscode-terraform#1915, the job parsing terraform-sources.json terminated second and overwrote InstalledModules with nil as no manifest file was found.

This PR adds a simple fix to only overwrite InstalledModules if it is not nil – this is just a short-term bandaid however, given it might lead to stale data. For a long-term fix, we should split InstalledModules into two fields instead.

Resolves hashicorp/vscode-terraform#1915

@ansgarm ansgarm requested a review from a team as a code owner December 19, 2024 14:15
@ansgarm ansgarm merged commit 1f574b8 into main Dec 19, 2024
22 checks passed
@ansgarm ansgarm deleted the fix-module-parsing-race branch December 19, 2024 16:00
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initialised module from GitHub not being recognised
2 participants