ruanwenjun opened a new pull request, #18233:
URL: https://github.com/apache/dolphinscheduler/pull/18233

   <!--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
   
   Migrate all 11 TaskGroupService methods from Map<String,Object> returns to 
typed returns or void with ServiceException, plus the coupled 
ExecutorService.forceStartTaskInstance which is only invoked from 
TaskGroupServiceImpl.forceStartTask.
   
   TaskGroupService:
   - createTaskGroup -> TaskGroup
   - updateTaskGroup -> TaskGroup
   - queryAllTaskGroup / queryTaskGroupByStatus / queryTaskGroupByProjectCode 
-> PageInfo<TaskGroup>
   - queryTaskGroupById -> TaskGroup (nullable)
   - doQuery -> PageInfo<TaskGroup>
   - closeTaskGroup / startTaskGroup / forceStartTask / modifyPriority -> void
   
   ExecutorService:
   - forceStartTaskInstance -> void
   
   The private hasProjectPerm helper is replaced with requireProjectPerm which 
throws ServiceException. Admin users still bypass the project existence check 
(preserving the prior admin-shortcut semantics) and the 
non-admin-on-missing-project NPE is replaced with a clean PROJECT_NOT_FOUND 
error.
   
   ApiExceptionHandler now propagates the controller method's @ResponseStatus 
to the error response so error and success paths share the same HTTP status 
code (e.g. POST endpoints stay 201 Created on ServiceException). This is the 
byte-for-byte fix for putMsg/throw divergence the migration would otherwise 
introduce — confirmed against TaskGroupControllerTest's real SpringBootTest 
harness. Two pre-existing tests that asserted the legacy "errors always 200" 
behaviour are updated to the unified status:
   - AccessTokenControllerTest.testExceptionHandler
   - UsersControllerTest.testCreateUser
   
   ApiExceptionHandlerTest is updated to reflect the new ResponseEntity<Result> 
return type.
   
   No PythonGateway or cross-service callers exist for these methods, so the 
migration is contained within the api module.
   
   ## 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]

Reply via email to