Skip to content

chore(utils): add flush-cache to dev_acs_role_flip.sh - #5259

Merged
lukaszgryglicki merged 1 commit into
devfrom
chore/acs-flip-flush-cache
Oct 14, 2026
Merged

lukaszgryglicki merged 1 commit into
devfrom
chore/acs-flip-flush-cache

Conversation

@ahmedomosanya

Copy link
Copy Markdown
Contributor

ACS caches GET /warden/subjects/authorize for 30 minutes, keyed by URL and username. user-service /v1/me/permissions reads it, so a cla-manager grant or revoke made with this script takes up to 30 minutes to reach Self Serve. A role change does not clear the entry, and ACS's per-user /cache/reset does not reach it either.

flush-cache calls ACS POST /cache/flush with the script's existing dev M2M token. It empties the whole ACS cache for every dev user, so the next read sees current roles. Dev only, like the rest of the script.

Tested in dev: a grant followed by flush-cache showed up in Self Serve on the next page load instead of after 30 minutes.

ACS caches GET /warden/subjects/authorize for 30 minutes, keyed by URL
and username. user-service /v1/me/permissions reads it, so a cla-manager
grant or revoke made with this script takes up to 30 minutes to reach
Self Serve. The per-user /cache/reset does not reach that entry, so a
role change never clears it.

flush-cache calls ACS POST /cache/flush with the script's existing dev
M2M token. It empties the whole ACS cache for every dev user, so the
next read sees current roles.

Signed-off-by: ahmedomosanya <aopeyemi@contractor.linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 12:35
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 5d243265-ad39-42b5-abba-d19f1c9e31c7
📥 Commits

Reviewing files that changed from the base of the PR and between 54f743f and 6dc5fe5.

📒 Files selected for processing: 1
  • utils/dev_acs_role_flip.sh

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Walkthrough

The developer script now documents ACS authorization caching and provides a flush-cache command. The command requests a cache flush, reports the result, and notes the separate Self Serve cache duration.

Changes

ACS cache flush

Layer / File(s) Summary
Document and run ACS cache flush
utils/dev_acs_role_flip.sh
The script documents the 30-minute ACS authorization cache and adds flush-cache to its usage comments. The command obtains a token, posts an empty JSON body to /cache/flush, and reports the deleted-key count and any warning on HTTP 200. On other responses, it prints the status and response excerpt, then exits with failure. It also notes the separate 60-second Self Serve CLA-manager cache.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 6dc5f

The dev command clears ACS authorization caching after role-membership changes; Self Serve may retain its answer for 60 seconds. No material merge-blocking risk is established, so the change is ready for normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: adding the flush-cache command to dev_acs_role_flip.sh.
Description check Passed The description explains the ACS cache behavior, the new flush-cache command, its scope, and the reported dev test result. It is directly related to the changeset.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The script passes shell syntax validation and introduces no exposed secrets.

0 open findings

What changed in this PR

Adds a dev-only ACS cache flush command so role changes reach Self Serve promptly.

Changes:

  • Adds flush-cache using the existing M2M token.
  • Documents cache behavior and command usage.
File Description
utils/​dev_acs_role_flip.sh Adds and documents ACS cache flushing.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ahmedomosanya
ahmedomosanya marked this pull request as ready for review October 14, 2026 12:38
@ahmedomosanya ahmedomosanya self-assigned this Oct 14, 2026

@lukaszgryglicki lukaszgryglicki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@lukaszgryglicki
lukaszgryglicki merged commit 3cefb60 into dev Oct 14, 2026
9 of 10 checks passed
@lukaszgryglicki
lukaszgryglicki deleted the chore/acs-flip-flush-cache branch October 14, 2026 13:22

This branch had an error being deployed

1 failed deployment
dev — 6dc5fe5b Deployed Oct 14, 2026 by lukaszgryglicki via build-deploy-dev #1026
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.

3 participants