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

Improve robustness of find-permissions extensions #1450

Merged
merged 2 commits into from
Jun 17, 2024
Merged

Conversation

cd-work
Copy link
Contributor

@cd-work cd-work commented Jun 17, 2024

This patch adds two minor changes that should make the find-permissions extensions easier to use for people unfamiliar with it.

To ensure we don't incorrectly log that / is required when the command always fails, the extension now does an explicit check on / and outputs a detailed error on the issue.

While I wasn't able to reproduce this issue myself, there have been some reports on failures due to permission errors. To avoid the possibility of that we now explicitly handle Deno.readDir failures and just assume the corresponding directory is wholly required.

To improve consistency, all console.error calls have been changed to use red color.

This patch adds two minor changes that should make the
`find-permissions` extensions easier to use for people unfamiliar with
it.

To ensure we don't incorrectly log that `/` is required when the command
always fails, the extension now does an explicit check on `/` and
outputs a detailed error on the issue.

While I wasn't able to reproduce this issue myself, there have been some
reports on failures due to permission errors. To avoid the possibility
of that we now explicitly handle `Deno.readDir` failures and just assume
the corresponding directory is wholly required.

To improve consistency, all `console.error` calls have been changed to
use red color.
@cd-work cd-work requested a review from a team as a code owner June 17, 2024 17:16
@cd-work cd-work requested a review from matt-phylum June 17, 2024 17:16
maxrake
maxrake previously approved these changes Jun 17, 2024
Copy link
Contributor

@maxrake maxrake left a comment

Choose a reason for hiding this comment

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

I like these changes and think they will help. The only suggestion is to fix a deno checks failure.

extensions/find-permissions/main.ts Outdated Show resolved Hide resolved
@cd-work cd-work enabled auto-merge (squash) June 17, 2024 18:17
@cd-work cd-work self-assigned this Jun 17, 2024
Copy link
Contributor

@maxrake maxrake left a comment

Choose a reason for hiding this comment

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

LGTM

@cd-work cd-work merged commit e4a6c44 into main Jun 17, 2024
14 checks passed
@cd-work cd-work deleted the better_findperms branch June 17, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants