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: don't prompt when using Deno.permissions.request with --no-prompt #25811

Merged
merged 7 commits into from
Oct 3, 2024

Conversation

lowlighter
Copy link
Contributor

Closes #14668

@lowlighter lowlighter changed the title fix(permissions): don't prompt when using Deno.permissions.request when --no-prompt is set fix: don't prompt when using Deno.permissions.request with --no-prompt Sep 22, 2024
@bartlomieju
Copy link
Member

Thanks for the PR, unfortunately I think this test is not correct - if you are in non-TTY environment (eg. in a CI) the prompting won't happen anyway. I believe we'll need to have this test use PTY - eg. check permissions_cache() test in tests/integration/run_tests.rs

@lowlighter
Copy link
Contributor Author

I've updated the test to use a PTY environment like suggested

@@ -3438,7 +3441,8 @@ mod tests {
fn test_request() {
set_prompter(Box::new(TestPrompter));
let parser = TestPermissionDescriptorParser;
let mut perms: Permissions = Permissions::none_without_prompt();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed this to none_with_prompt() because it seemed like a mistake, since later in the test we manipulate the prompt value. I feel like this is why it has been overlooked in the first place, though I could be wrong

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@dsherret dsherret enabled auto-merge (squash) October 3, 2024 11:17
@dsherret dsherret merged commit da7edf1 into denoland:main Oct 3, 2024
17 checks passed
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.

Deno.permissions.request() prompts even if --no-prompt set
3 participants