Skip to content

Add CLI to clean up stale roles in Auth0 dev tenant - #2906

Merged
pylipp merged 4 commits into
masterfrom
cli-clean-up-dev-roles
Sep 21, 2026
Merged

pylipp merged 4 commits into
masterfrom
cli-clean-up-dev-roles

Conversation

@pylipp

@pylipp pylipp commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.23%. Comparing base (dcf7c70) to head (d24ba8c).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2906      +/-   ##
==========================================
+ Coverage   74.21%   74.23%   +0.02%     
==========================================
  Files         330      331       +1     
  Lines       25393    25417      +24     
  Branches     2532     2537       +5     
==========================================
+ Hits        18845    18869      +24     
  Misses       6498     6498              
  Partials       50       50              
Flag Coverage Δ
backend 99.65% <ø> (+<0.01%) ⬆️
frontend 66.85% <ø> (ø)
sharedComponents 44.29% <ø> (ø)
sharedFront 91.72% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

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.

Copilot review overview

🟡 Changes recommended

The new role listing helper risks missing roles due to pagination handling, and the cleanup command’s dry-run messaging is misleading when there is nothing to delete.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 2 Low severity

Open (3)
What changed in this PR

This PR adds a new bwiz clean-up-roles CLI utility intended to remove stale Auth0 roles from the Auth0 dev tenant by comparing roles in Auth0 against the role IDs present in the seeded database table.

Changes:

  • Introduces clean_up_roles() CLI functionality and wires it into bwiz subcommands with a dev-safety guard.
  • Refactors Auth0 CLI service logic to add a get_roles() helper and throttles role deletions.
  • Adds model tests covering the new cleanup behavior and documents the available CLI utilities in the backend README.
File Description
back/​test/​model_tests/​test_cli.py Adds tests validating dry-run vs --force cleanup behavior.
back/​README.md Documents bwiz utilities, including the new dev-tenant role cleanup command.
back/​boxtribute_server/​cli/​service.py Adds get_roles() and introduces a short delay between role deletions.
back/​boxtribute_server/​cli/​main.py Adds the clean-up-roles subcommand and dev-only execution guard.
back/​boxtribute_server/​cli/​clean_up_roles.py Implements role cleanup by diffing Auth0 roles vs seeded DB role IDs.

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

Comment thread back/boxtribute_server/cli/service.py
Comment thread back/README.md
Comment thread back/boxtribute_server/cli/clean_up_roles.py
@pylipp
pylipp marked this pull request as ready for review September 21, 2026 12:42
@pylipp
pylipp merged commit bb0e4b8 into master Sep 21, 2026
14 checks passed
@pylipp
pylipp deleted the cli-clean-up-dev-roles branch September 21, 2026 12:42
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