Repository navigation
Permission warnings check the role live and go away once it is updated - #472
Merged
Merged
Conversation
The Infrastructure vulnerabilities warning, the Integrations AWS panel's update warning and the AWS page's infrastructure reads note showed the saved permission check, which the worker refreshes once a day. Each now checks the role live while it shows the warning, hides it when the check comes back with nothing left to do, says quietly that it is checking, and after Update checks again on focus, on returning to the tab and every 15 seconds, through one shared hook (usePermissionChecks).
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.
Summary
The Infrastructure vulnerabilities warning ("needs N more read-only permissions in account ... Update the role in AWS") showed the saved permission check, which the worker refreshes once a day. After an admin created the update stack, the warning stayed until the next daily run. Pages that show a saved permission warning now check the role live while the warning is up, hide it when the check says nothing is left to do, and after Update keep checking the way Settings › AWS already does.
Changes
usePermissionChecks(dashboard/src/hooks/use-permission-checks.ts), taken fromuseAwsPermissions:POST /api/aws-connections/:id/permissions/check, which checks live and saves the result.useAwsPermissionsis now a thin wrapper over it, so Settings › AWS behaves as before.MissingReads):integrations) trigger it. A failed check keeps the saved warning.InfraReadsHelp): it uses the page's live check when that is newer than the saved one, so the note no longer repeats a stale list.PermissionCheckNote) on these warnings says "Checking the role now…" while a check runs, and "Waiting for the update" after Update.Verification
npm run typecheck,npm run lint(UI lint) and rooteslinton the changed files: clean. The dashboard has no vitest suite.infra-security.spec.tshas 3 new tests:up_to_date), with "Checking the role now…" shown while the check is held.pressed: trueand the card goes away.integrations-page.spec.ts: a new test shows the panel's saved warning going away after the live check.infra-aws-switch.spec.ts: a new test shows the AWS page note going away when the live check finds the reads.aws-permissions,aws-install-options,integrations,infra-runbooks,infra-policyandintegration-status.