bito-code-review[bot] commented on code in PR #27779:
URL: https://github.com/apache/superset/pull/27779#discussion_r3485988482
##########
superset-frontend/src/dashboard/util/permissionUtils.ts:
##########
@@ -24,17 +24,17 @@ import {
} from 'src/types/bootstrapTypes';
import { Dashboard } from 'src/types/Dashboard';
import { findPermission } from 'src/utils/findPermission';
+import getBootstrapData from 'src/utils/getBootstrapData';
-// this should really be a config value,
-// but is hardcoded in backend logic already, so...
-const ADMIN_ROLE_NAME = 'admin';
+const bootstrapData = getBootstrapData();
+const ADMIN_ROLE_NAME = bootstrapData.common.conf.AUTH_ROLE_ADMIN || 'Admin';
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Incomplete test coverage for configurable admin
role</b></div>
<div id="fix">
The module-level `getBootstrapData()` call is not mocked in tests, creating
a testing gap for the new configurable ADMIN_ROLE_NAME functionality. Tests
rely on DEFAULT_BOOTSTRAP_DATA which has `conf: {}`, so the custom
AUTH_ROLE_ADMIN path is never exercised. Consider adding mock setup in
beforeAll to control the admin role name and verify case-insensitive matching
behavior for both default and custom values.
</div>
</div>
<small><i>Code Review Run #080cad</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]