ruanwenjun opened a new pull request, #18234:
URL: https://github.com/apache/dolphinscheduler/pull/18234
<!--Thanks very much for contributing to Apache DolphinScheduler, we are
happy that you want to help us improve DolphinScheduler! -->
## Was this PR generated or assisted by AI?
YES, ops 4.7
## Purpose of the pull request
Refactor 17 UsersService methods that returned Map<String, Object> to typed
returns / void with ServiceException, mirroring the pattern established by
EnvironmentService.
Methods migrated:
- createUser(8 args) -> User
- deleteUserById -> void
- grantProject / grantProjectWithReadPerm / grantProjectByCode -> void
- revokeProject / revokeProjectById -> void
- grantNamespaces / grantDataSource -> void
- getUserInfo -> User (tenantCode / alertGroup / timeZone populated,
password stripped)
- queryAllGeneralUsers / queryUserList(User) -> List<User>
- unauthorizedUser / authorizedUser -> List<User>
- registerUser / activateUser -> User
- batchActivateUser -> Map<String, Object> (kept Map; nested success/failed
buckets keep wire field names byte-for-byte)
batchActivateUser switches its inner loop to a try/catch around activateUser
since activateUser now throws ServiceException; the wire shape (success.{sum,
userName} / failed.{sum, info}) is unchanged.
UsersController forwards typed values via Result.success and the
authorizedUser endpoint drops its bespoke try/catch since ApiException +
ApiExceptionHandler now provide the equivalent fallback.
PythonGateway.deleteUser already discarded the return value, so the void
return causes no Py4J impact. The other Py4J / SSO callers all use the
already-typed createUser overloads.
Full module test suite: 682 tests, 0 failures.
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
## Verify this pull request
<!--*(Please pick either of the following options)*-->
This pull request is code cleanup without any test coverage.
*(or)*
This pull request is already covered by existing tests, such as *(please
describe tests)*.
(or)
This change added tests and can be verified as follows:
<!--*(example:)*
- *Added dolphinscheduler-dao tests for end-to-end.*
- *Added CronUtilsTest to verify the change.*
- *Manually verified the change by testing locally.* -->
(or)
## Pull Request Notice
[Pull Request
Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
If your pull request contains incompatible change, you should also add it to
`docs/docs/en/guide/upgrade/incompatible.md`
--
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]