Repository navigation
Fixes #26521: Decouple Incident Manager Permissions from Test Case Edit Permissions - #32074
Conversation
…sions Managing an incident (status, severity, assignee) required EditTests or EditAll on the test case, so teams could not grant incident management alongside read-only access to test cases under Data Observability. Introduce EditStatus as the Incident Manager grant on the testCase resource: - TestCaseResource now advertises EditStatus, so policies can grant it and the permissions API returns it to clients. - TestCaseResolutionStatusResource.buildEditAuthRequests (severity patch, incident create/bulk) and TaskRepository.addIncidentEditRequests (the task-first status/assign/reassign transitions) accept EditStatus in addition to the existing EditTests/EditAll grants. - The incident list table and the data quality tab gate incident status, severity and assignee on EditStatus via getPrioritizedEditPermission instead of raw EditAll, matching what the incident page header already does. EditAll subsumes every Edit* operation in the policy engine, so existing roles keep working unchanged. Resolves #26521 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
| Count | Rule |
|---|---|
| 3 | sonarjs/cyclomatic-complexity |
| 2 | openmetadata-imports/no-lower-layer-page-imports |
| 1 | react-hooks/exhaustive-deps |
| 1 | sonarjs/no-duplicate-string |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:48:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:137:25 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 18 which is greater than 10 authorized.","cost":8,"secondaryLocations":[{"line":137,"column":24,"endLine":137,"endColum |
| 🟡 | src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:334:57 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 11 which is greater than 10 authorized.","cost":1,"secondaryLocations":[{"line":334,"column":56,"endLine":334,"endColum |
| 🟡 | src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:455:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has missing dependencies: 'collectInlineIncidentStatuses' and 'fetchTestCasePermissions'. Either include them or remove the dependency arra |
| 🟡 | src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx:568:48 |
sonarjs/cyclomatic-complexity |
{"message":"Function has a complexity of 16 which is greater than 10 authorized.","cost":6,"secondaryLocations":[{"line":568,"column":47,"endLine":568,"endColum |
| 🟡 | src/components/IncidentManager/IncidentManagerTable.component.tsx:34:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/IncidentManager/IncidentManagerTable.component.tsx:131:23 |
sonarjs/no-duplicate-string |
Define a constant instead of duplicating this literal 3 times. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
TeddyCr
left a comment
There was a problem hiding this comment.
/olivaw fix the guitar-bot comment regarding coverage issue on EDIT_STATUS permission
✅ Playwright Results — workflow succeededValidated commit ✅ 992 passed · ❌ 0 failed · 🟡 4 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 53m 42s ⏱️ Max setup 4m 29s · max shard execution 17m 45s · max shard-job elapsed before upload 21m 59s · reporting 7s 🌐 209.00 requests/attempt · 2.41 app boots/UI scenario · 19.34% common-shard skew Optimization targets still in progress:
🟡 4 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
TeddyCr
left a comment
There was a problem hiding this comment.
/olivaw fix the guitar-bot comment regarding coverage issue on EDIT_STATUS permission
TeddyCr
left a comment
There was a problem hiding this comment.
/olivaw fix the guitar-bot comment regarding coverage issue on EDIT_STATUS permission
Code Review ✅ Approved 1 resolved / 1 findingsDecouples Incident Manager permissions from test case edit permissions by introducing ✅ 1 resolved✅ Quality: TaskRepository incident-edit fallback path lacks test coverage
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
There was a problem hiding this comment.
🔵 Needs a closer look
It changes authorization behavior for incident management (security-sensitive) and cannot be fully validated here without CI/build/test execution.
Review details
Suppressed comments (1)
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TaskRepository.java:975
- The updated Javadoc says the incident fallback allows a non-filer with
EditStatus,EditTestsorEditAll“on the related entity”, but the implementation only checksEditStatuson the test case (andEditTests/EditAllon both test case and the underlying entity). Please adjust the wording to reflect the actual authorization conditions so it doesn’t mislead future readers/maintainers.
* <p>For incident-style tasks ({@code TestCaseResolution}, {@code IncidentResolution}) a
* fallback is permitted: a non-filer user with {@code EditStatus}, {@code EditTests} or
* {@code EditAll} on the related entity can resolve the task even if the task policy alone would
* deny — preserving the historical behaviour that test owners can act on incidents, and letting
* {@code EditStatus} alone grant incident management without test case edit rights. The filer
* check is intentional:
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
|



What olivaw checked (machine-observed, §8.2/A.1)
7a64474afafab92e2550ee2c97d4a7d0e0a3da4744ce2099e3da39bbbb9617af0792a4ed6f179524No build or test command is configured for this workspace, so only the diff's existence was checked. Set
run_config.build_cmd/test_cmdto have olivaw verify its own work.What the agent says it did (unverified)
Greptile Summary
The PR separates Incident Manager actions from general test-case editing by introducing
EditStatusconsistently across backend authorization and frontend controls.EditStatusas a test-case-specific operation.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
EditStatusto the incident task fallback while retaining existing test-case and underlying-entity grants.EditStatus.EditStatusas an entity-specific test-case operation for permission discovery.EditStatuspermission.EditStatuspermission for inline incident status changes.EditStatusand retains legacy grants.EditStatus.Sequence Diagram
Reviews (2): Last reviewed commit: "test: cover the task incident EDIT_STATU..." | Re-trigger Greptile