Skip to content

fix: tools always ask for permissions#2647

Merged
laileni-aws merged 2 commits intoaws:feature/permissions-fixfrom
laileni-aws:feature/permissions-fix
Mar 9, 2026
Merged

fix: tools always ask for permissions#2647
laileni-aws merged 2 commits intoaws:feature/permissions-fixfrom
laileni-aws:feature/permissions-fix

Conversation

@laileni-aws
Copy link
Contributor

Problem

Root Cause

  • Wrong order of checks in requiresPathAcceptance()
    1. isSensitivePath(path) → if matches, IMMEDIATELY return requiresAcceptance: true ← BUG
    2. isPathApproved(path) → check approved cache
    3. isInWorkspace(path) → only reached if step 1 didn't match

Solution

  • Check isInWorkspace() FIRST — if the file is inside the workspace, trust it immediately

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@laileni-aws laileni-aws requested a review from a team as a code owner March 9, 2026 16:59
@laileni-aws laileni-aws force-pushed the feature/permissions-fix branch from 90025e0 to a122468 Compare March 9, 2026 17:57
@laileni-aws laileni-aws merged commit 48473f1 into aws:feature/permissions-fix Mar 9, 2026
5 checks passed
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.22%. Comparing base (8b35d52) to head (a122468).
⚠️ Report is 1 commits behind head on feature/permissions-fix.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/permissions-fix    #2647   +/-   ##
========================================================
  Coverage                    60.21%   60.22%           
========================================================
  Files                          279      279           
  Lines                        65975    65986   +11     
  Branches                      4164     4166    +2     
========================================================
+ Hits                         39726    39737   +11     
  Misses                       26167    26167           
  Partials                        82       82           
Flag Coverage Δ
unittests 60.22% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

laileni-aws added a commit that referenced this pull request Mar 10, 2026
* fix: tools always ask for permissions

* fix: tests

Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
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.

4 participants