The GitHub Actions job "CI" on 
rocketmq-dashboard.git/fix/plain-access-admin-preserved has failed.
Run started by GitHub user unbridled-41 (triggered by unbridled-41).

Head commit for run:
1217002ad365d65ae48535ac7a23c9caf9bb7aa9 / unbridled-41 
<[email protected]>
fix(acl): stop a partial plain-access update from clearing the admin flag

`admin` is optional in the documented write contract ("admin | boolean | 否",
docs/api-spec.md:1460) and the console's own model of this request preserves it
(web/src/services/aclService.ts: `admin: data.admin ?? existing?.admin ?? 
false`),
but the write path could not tell "not provided" from "explicitly false":

    // UpsertPlainAccessConfigDTO
    private boolean admin;

    // MybatisPlusAclRepository.createAndUpdatePlainAccessConfig
    entity.setAdmin(config.isAdmin());

`updateById` writes `Boolean.FALSE` (only null is skipped), so re-saving an 
existing
account without naming the flag - rotating its secret, editing its whitelist or 
its
permission entries - silently demoted it, returned `admin:false`, and dropped 
it out
of the ACL risk view's `adminAccountCount`. The sibling user update already 
models
this correctly (UpdateAclUserDTO: "Null when the admin flag was not part of the
partial update, in which case the existing value must be preserved instead of 
being
reset to false").

Make the flag nullable on the request/response VO and resolve the effective 
value in
the repository: an omitted flag keeps an existing account's stored value, a new
account defaults to false, and an explicit value always wins. The write response
carries the effective value, so the web contract is unchanged.

Tests (server/): mvn -o -B -ntp test 
-Dtest='MybatisPlusAclRepositoryTest,AclServiceTest,AclControllerTest'
-> Tests run: 134, Failures: 0, Errors: 0.
- new updateWithOmittedAdminShouldKeepStoredAdminFlagTest fails before the 
resolution
  ("Expecting value to be true but was false") and passes after it.
- new updateWithExplicitlyClearedAdminShouldDemoteTheAccountTest guards that an
  explicit false still demotes.
- the existing blank-secret case now reads the effective value through 
getAdmin().
- checkstyle passes.

Report URL: 
https://github.com/apache/rocketmq-dashboard/actions/runs/37991091661

With regards,
GitHub Actions via GitBox

Reply via email to