[Bug] [Task Definition] cannot change Environment Name when create or edit task
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
It's not work when I create or change the task Environment Name, and Environment Name always use the first Environment of the Worker Group.
What you expected to happen
Environment Name should be changed so that I can use different Environment Name from the same Worker group.
How to reproduce
It's simple to reproduce this issue
1. into the `Security -> Environment Manage`, create multiple `Environment Name` that all belongs to one worker group.
2. into the `Project -> Task -> Task Definition`, change the `Environment Name` by create or edit task;
3. save and review the task,and will find it's not work;
Anything else
How often does this problem occur?
every time
The following instructions may be useful
Our dolphincheduler instance use MySQL database, and found the sql update with wrong contition:
# 1
select
id, code...
from t_ds_task_definition
WHERE code = ...
and version = ..
# 2
insert into t_ds_task_definition_log ...
# 3
UPDATE t_ds_task_definition SET code=...
...
WHERE id=?
we cann't find the id value from the table t_ds_task_definition, but found in table t_ds_task_definition_log.
Version
3.1.x
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
- In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
- If you haven't received a reply for a long time, you can join our slack and send your question to channel
#troubleshooting
According to your reproduction steps, this problem is not reproduced.
before:
after:

We use the standalone mode(v3.1.0). and found t_ds_task_definition update correctly, but display in the web always wrong.

I use the standalone mode(v3.1.0) too.
I can't reproduce too ,@arstercz can you provide more infomation to help reproducing this issue ?
which milestone will it be fixed? it seems it's a UI bug, when UI dialog show, it should display the corrent env-name last edited. 3q
这个BUG随手就可以改掉的,为何要一推再推呢?!
这个BUG随手就可以改掉的,为何要一推再推呢?!
This issue will be fixed after pr #13148 is completed