yaowanli opened a new issue, #17798:
URL: https://github.com/apache/dolphinscheduler/issues/17798

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   In Project A, Project A is assigned to the "test" workgroup, and internal 
workflows are also assigned to the "test" workgroup.
   
   1. With existing workgroups, clearing all workgroups and assigning only the 
"default" workgroup results in both "test" and "default" workgroups being 
displayed.
   
   The page retrieves groupings by obtaining the workgroups of workflows and 
scheduled jobs, then the project's grouping table, merging the data, and 
removing duplicates; therefore, two workgroups are displayed, which is normal.
   
   2. With existing workgroups, clearing all workgroups, and then clearing all 
workgroups a second time, results in an error message: "Failed to assign 
workgroups to the project."
   
   The prompt is incorrect. It should indicate that no workgroup can be 
cleared, or that no error message should be displayed.
   
   Alternatively, since a workgroup is already in use internally, clearing the 
"test" workgroup should not be allowed.
   
   3. Clear all workgroups, then assign the "default" group, and then assign 
the "test" workgroup. The prompt is: "Worker group [test] is referenced by a 
task or scheduled task in the project and cannot be reassigned."
   
   This is an incorrect error message. In reality, since no "test" workgroup 
has been assigned, it should be allowed to be assigned, not prohibited.
   
   ### What you expected to happen
   
   Therefore, I believe the workgroup assignment logic should be refactored.
   
   Solution 1: Extreme Simplification
   The page should allow free workgroup assignment, but the workflow workgroups 
and scheduled job workgroups should be combined and displayed during the echo.
   
   Solution 2: Complexity
   When assigning workgroups on the page, let's assume the new workgroup is A 
and the project workgroup is B.
   
   1) If the difference between A and B is greater than 0, directly add a new 
workgroup based on the difference.
   
   2) If the difference between B and A is greater than 0 (including cases 
where A is empty), check if the workgroups in the difference have already been 
assigned to workflows or scheduled jobs. If not, they can be deleted; if 
already assigned, they cannot be deleted.
   
   ### How to reproduce
   
   you can see the What happened
   
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   3.3.2
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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