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: decode all submodules with the right path #810

Merged
merged 2 commits into from
Mar 1, 2022

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Mar 1, 2022

Fixes #801

Prior to this patch we would only decode the last submodule in the slice. This was because of a common mistake documented in https://github.com/golang/go/wiki/CommonMistakes#using-reference-to-loop-iterator-variable

i.e. we were passing a reference to the job functions which were executed well after the ranging over the slice was done, hence reusing the same reference, with the reference pointing to the last value in the last iteration.

I believe this was only introduced in the refactoring PR #782 so if we patch it prior to the next release there would be no user affected.

Attached below is the same example as in the original bug report, now working:
2022-03-01 11 06 05

@radeksimko radeksimko added the bug Something isn't working label Mar 1, 2022
@radeksimko radeksimko changed the title fix: decode 2nd and other submodules with the right path fix: decode all submodules with the right path Mar 1, 2022
@radeksimko radeksimko requested a review from a team March 1, 2022 11:31
@radeksimko radeksimko added this to the v0.26.0 milestone Mar 1, 2022
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@radeksimko radeksimko merged commit 08f226d into main Mar 1, 2022
@radeksimko radeksimko deleted the b-fix-meta-job-scheduling branch March 1, 2022 14:14
@github-actions
Copy link

This functionality has been released in v0.26.0 of the language server.
If you use the official Terraform VS Code extension, it will prompt you to upgrade to this version automatically upon next launch or within the next 24 hours.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
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 Apr 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

indexing: Submodules fail to be indexed until open at some circumstances
2 participants