-
-
Notifications
You must be signed in to change notification settings - Fork 549
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
feat: Add support for version constraints in tfupdate
#437
Merged
antonbabenko
merged 17 commits into
master
from
feat/GH-388/tfupdate_float_version_right_args
Oct 6, 2022
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
92e64df
Swap args positions as preparation to passing arrays as arrays to func
MaxymVlasov 2f88e60
Pass ARGS to functions as array
MaxymVlasov 3233c37
Expand args to true array
MaxymVlasov dd470ad
Crutch to make work tfupdate as expected
MaxymVlasov d699d24
Remove crutch, add normal solution, tnx to yermulnik
MaxymVlasov 031296a
Apply review suggestions
MaxymVlasov 68a7f51
Apply suggestions from code review
MaxymVlasov 7866b64
Apply review suggestions
MaxymVlasov 41b0489
Not work. Revert "Apply review suggestions"
MaxymVlasov 7eccb5a
Add comment about how while loop work
MaxymVlasov cb9c726
Move options parsing to right place
MaxymVlasov d289774
Fix --all
MaxymVlasov d51b470
Stop tfupdate hook execution with wrong args order
MaxymVlasov e57286b
Fix shellcheck violations
MaxymVlasov 6321039
Refactor hooks to new style
MaxymVlasov 22fa93a
Restore right behavior
MaxymVlasov 8e379da
Update hooks/terraform_docs.sh
MaxymVlasov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would a simpler code work here? This also makes no need for
args_array_length
var.On the other hand the whole loop looks quite like simple
args=("$@")
🤔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.
Oh, I seem to think I understand why
args_array_length
is needed.Though given
common::per_dir_hook "$HOOK_ID" "${ARGS[*]}" "${FILES[@]}"
, which is used across this PR, the 2nd ARG to this current function has ARGS array rather than number of its elements — is this expected? So it's eithercommon::per_dir_hook "$HOOK_ID" "${#ARGS[*]}" "${ARGS[*]}" "${FILES[@]}"
, or I am missing something essential 🤔 (probably it's right about time to leave this for tomorrow 😛)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.
Okay, I couldn't leave it for tomorrow.
This
while
thing doesn't work as expected for me, and givencommon::per_dir_hook "$HOOK_ID" "${ARGS[*]}" "${FILES[@]}"
this should be that all same thing from our discussion in Slack: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.
No idea why, but the suggested solution does not work here 🤔
7866b64
(#437)I try to replace
common::per_dir_hook "${ARGS[*]}"
withcommon::per_dir_hook "${ARGS[@]}"
but got a weird errorAlso, no luck with changing
per_dir_hook_unique_part "${args[@]}"
toper_dir_hook_unique_part "${args[*]}"
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.
Hm-m-m, that's odd. By the way how come args come in with
__REPLACED__SPACE__
thing in them? Is the__REPLACED__SPACE__
to be replaced with actual space later down the code? 🤔I didn't check the code with
__REPLACED__SPACE__
in args instead of spaces...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.
Should be. Firstly, it replaces spaces with placeholders and then placeholders with spaces. Check file for
__REPLACED__SPACE__
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.
Nah, I mean is this expected that at this place the
__REPLACED__SPACE__
isn't replaced with spaces yet? This may influence how we should be parsing array elements since elements values are not space-separated string, but__REPLACED__SPACE__
-separated string.