fix(workspace): ignore unreadable directories when listing Dockerfiles#1764
Merged
mergify[bot] merged 2 commits intoaws:mainlinefrom Dec 18, 2020
Merged
Conversation
…INT during prompt
19916a3 to
80b9b3e
Compare
huanjani
approved these changes
Dec 18, 2020
Contributor
huanjani
left a comment
There was a problem hiding this comment.
Thanks for jumping on this!
iamhopaul123
approved these changes
Dec 18, 2020
| var err error | ||
| if validator == nil { | ||
| err = p(prompt, &result, stdio(), icons()) | ||
| err = p(prompt, &result, stdio(), icons(), noInterrupt()) |
| if err != nil { | ||
| return nil, fmt.Errorf("read directory: %w", err) | ||
| // swallow errors for unreadable directories | ||
| continue |
Contributor
There was a problem hiding this comment.
Do we need to update unit tests for this change?
Contributor
Author
There was a problem hiding this comment.
There are currently no unit tests reliant on it, apparently. I'll add one in my next PR.
Contributor
Author
There was a problem hiding this comment.
It turns out that afero does not check permissions when opening files. See spf13/afero#150 for others complaining about this.
mergify Bot
pushed a commit
that referenced
this pull request
Dec 21, 2020
<!-- Provide summary of changes --> <!-- Issue number, if available. E.g. "Fixes #31", "Addresses #42, 77" --> The newest survey release reverts a commit which was introduced in the previous release, which added unstable behavior for all users of survey. This commit bumps to the latest version and reverts changes introduced in #1764 to handle the instability. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau
pushed a commit
to localstack/copilot-cli-local
that referenced
this pull request
Dec 9, 2022
aws#1764) <!-- Provide summary of changes --> This is a quick change to skip over directories with invalid permissions when reading dockerfiles. If a directory doesn't have appropriate permissions, it's not essential that we read it--customers can always specify paths directly. This also fixes an issue introduced by the newest version of Survey (aws#1754) where the new OnInterrupt field was not populated, causing segfaults whenever ctrl+c was pressed at a prompt. <!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau
pushed a commit
to localstack/copilot-cli-local
that referenced
this pull request
Dec 9, 2022
<!-- Provide summary of changes --> <!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" --> The newest survey release reverts a commit which was introduced in the previous release, which added unstable behavior for all users of survey. This commit bumps to the latest version and reverts changes introduced in aws#1764 to handle the instability. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a quick change to skip over directories with invalid permissions when reading dockerfiles. If a directory doesn't have appropriate permissions, it's not essential that we read it--customers can always specify paths directly.
This also fixes an issue introduced by the newest version of Survey (#1754) where the new OnInterrupt field was not populated, causing segfaults whenever ctrl+c was pressed at a prompt.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.