Conversation
|
Thanks for the pull request, @rodmgwgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
69c97d0 to
36960c4
Compare
36960c4 to
4484874
Compare
Problem
Authorization schema definitions may carry a Paragon
iconname on categories, permissions, roles, and role extensions, but nothing validated those names. ADR 0017 §4 requires schema validation to reject icon values that are not valid names exported by@openedx/paragon/icons. Without this check, a typo or a removed/renamed icon reaches the frontend and fails to render.Approach
Adds icon-name validation to the schema
validatestep, backed by a vendored allow-list:openedx_authz/engine/schema/paragon_icons.py— generatedPARAGON_ICON_NAMESfrozenset (the component exports of@openedx/paragon/icons).scripts/generate_paragon_icons.py— regenerates that list from a pinned Paragon version;make paragon_iconswrites it andmake paragon_icons_checkfails if it is stale (for CI).openedx_authz/engine/schema/validation.py— new_check_iconhelper (PascalCase format + membership check), wired intovalidate_documentfor categories, permissions, roles, and role extensions. Both a malformed name and an unknown name are error-level, so an invalid icon blocks deployment through the existing validation gate.docs/decisions/0026-paragon-icon-list-maintenance.rst— ADR describing why the list is vendored and how it is refreshed.openedx_authz/tests/schema/.The pinned version is the
@openedx/paragonmajor thatfrontend-app-admin-consoledeclares onmaster(^23, generated from23.21.3), since that MFE is the consumer that renders these icons. The list is regenerated whenever the console bumps its Paragon version (see ADR 0026).Manual testing instructions
Run in a tutor dev environment with this repo mounted. Every command below is shown for
cms;lmsworks identically.1. A valid schema still applies cleanly
Expect the same definition sections as before (17 categories, 48 permissions, 11 roles, 132 role-permission grants) with no icon errors — every icon shipped in the schema is a valid Paragon name.
2. An unknown icon name stops deployment
Edit a category or permission in
openedx_authz/authz/schema/course_permissions.yamland seticon:to a name Paragon does not export (for exampleicon: NotARealParagonIcon), then run:Expect a
CommandError; the log lists the icon error with its source file, ending with "is not a valid @openedx/paragon/icons name", and the database is untouched.3. A malformed icon name is rejected with a distinct message
Set an icon to a non-PascalCase value (for example
icon: remove_red_eye) and run the command again. The reported error ends with "must be a PascalCase Paragon icon name". Remove the edit and confirm the command succeeds again.4. The vendored list is current
Prints
... is up to date (2317 icons).and exits 0. Runningmake paragon_iconsrewrites the file from the pinned Paragon version and leaves it unchanged.Automated coverage
openedx_authz/tests/schema/test_validation.pyaddsTestIconRules(11 tests): valid icon passes, missing/empty icon is allowed, non-PascalCase names error, unknown well-formed names error, and the permission/role/role-extension icon paths are each exercised. The full schema suite (230 tests) passes, withvalidation.pyandparagon_icons.pyat 100% coverage.Rollback plan
Revert this PR. The vendored list and validation are self-contained; nothing else depends on them. The schema YAML files and prior pipeline are unaffected. No migration is involved.
Retro compatibility
No authorization behavior changed. The check only runs during schema validation (
load_authz_schema), and the shipped schema already uses valid icon names, so existing deployments are unaffected. The new rule is error-level, so any future schema that references an icon outside the pinned Paragon set will fail validation until the icon is corrected or the vendored list is refreshed.Follow up work required
make paragon_icons_checkinto CI so a forgotten refresh after a Paragon bump is caught automatically.AI Usage
Kiro was used to assist on feature planning and implementation. Implementation was done step by step with human guidance and validation, based on the ADRs.
Stack (4/4):
rod/authz-schema-loader)Merge checklist: