Repository navigation
fix: honor disabled status when creating dashboard users - #8489
Conversation
Aias00
left a comment
There was a problem hiding this comment.
Stream Agent analysis
PR #8489 fixes disabled dashboard users being force-enabled on creation by changing buildDashboardUserDO to setEnabled(!Boolean.FALSE.equals(item.getEnabled())). Added unit tests and CI is green (74/74 success).
Evidence
- DashboardUserDO.java RIGHT line 253: setEnabled(!Boolean.FALSE.equals(item.getEnabled())) replaces unconditional setEnabled(true) in the creation branch.
- DashboardUserServiceImpl.java lines 162/182 are the only production callers of buildDashboardUserDO and do not reset enabled before insert/update.
- New DashboardUserDOTest.java covers disabled-on-create, enabled-on-create, omitted-defaults-enabled, disabled-on-update and omitted-partial-update; CI complete=true, 74 checks success, passed=true.
Recommended next steps
Scope: captured diff and GitHub check metadata only; no local tests were executed.
Task: 4dbbf551-f8f6-48b5-a44c-267bd8026f30 · Commit: eff09661036e3d864d151e963ae720ba45132adf
Review verdict: PASS
WHOLE_PR diff fully captured and reviewed: the one-line behavioral fix honors explicit enabled=false on creation while keeping the existing true/default semantics, update path unchanged, only production callers verified not to override the value, new tests cover the matrix, and CI passed with no failed checks. No concrete blocking defect found.
Publication: COMMENT (DRAFT_PR)
Aias00
left a comment
There was a problem hiding this comment.
Reviewed commit eff09661036e3d864d151e963ae720ba45132adf.
No blocking findings. I checked the create/update callers and selective SQL mapping: explicit enabled=false is preserved on creation, the omitted internal value retains the previous true default, and update mapping is unchanged. Public DTO validation still requires the field.
Fresh local validation: ./mvnw -pl shenyu-admin -am test -Dtest=DashboardUserDOTest,DashboardUserServiceTest -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.javadoc.skip=true -Djacoco.skip=true — 18 tests passed, zero failures/errors/skips; reactor Checkstyle ran. Independent code-quality and architecture reviews found no blocking issue. Full local repository install and rebuilt-Admin browser integration were not run.
Problem and change
Fixes #8485.
An administrator can submit enabled=false when creating a dashboard user, but the persisted user is enabled. DashboardUserDO.buildDashboardUserDO unconditionally calls setEnabled(true) in the creation branch. Updates already preserve the requested value.
Honor explicit enabled=false during user creation instead of unconditionally enabling the user. Keep the existing internal default and update mapping.
This branch is based directly on master
e9345162aand has no dependency on the other Admin follow-up PRs or dashboard migration drafts.IssueSpec
IssueSpec-Mode: lightweight
IssueSpec-Reason: Correct the existing enabled field mapping while preserving the internal default and update behavior; no new capability, schema or permission change.
IssueSpec-Validation: The named regression fails before the fix. The independent branch passes 18 focused tests plus reactor Checkstyle; the four-fix verification checkout passes 64 related tests and RAT; the added-code quality gate reports zero findings. Full repository clean install and browser testing of a rebuilt Admin are not run.
Production-fix lightweight classification remains subject to maintainer review under the repository policy.
Validation
./mvnw -pl shenyu-admin -am test -Dtest=DashboardUserDOTest,DashboardUserServiceTest -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.javadoc.skip=true -Djacoco.skip=true— PASS (18 tests, no failures/errors/skips).python3 .github/scripts/check-new-code-quality.py --base origin/master --checkstyle-jar ../frontend-completion/checkstyle-9.3-all.jar— zero findings on this branch. The jar matches the workflow-pinned SHA-256../mvnw -pl shenyu-admin -am apache-rat:check— PASS on the combined verification checkout containing the same four independent changes.git diff --check origin/master...HEAD— PASS.DashboardUserDOTest.preservesDisabledStatusOnCreation fails on unmodified master (expected false, got true). Additional tests cover explicit true, the omitted internal value, and disabled/partial updates.
You have read the contribution guidelines.
You submit test cases (unit or integration tests) that back your changes.
New production code follows the code quality rules Q1-Q9 in AGENTS.md.
Your local test passed
./mvnw clean install -Dmaven.javadoc.skip=true.