-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow node alias wiped after node edit #13581
Comments
@AlanCoding it looks like the UI is making a PATCH request in this scenario and we're not sending an alias in the payload. Is it expected that this would clear the alias out? For example, if we have a node that looks like:
and if we make a PATCH request with a payload that looks like:
the resulting object looks like:
Is this expected? It seems a little odd to me. cc @gamuniz since you ran into this as well. |
the uuid4 is implemented as the model field default. awx/awx/main/models/workflow.py Line 182 in 4499a50
Obviously it shouldn't reset on unrelated updates. I have no idea why it might be doing this. |
I just tested this with dev tools open and it does a put with just the
changed field:
1. Request URL:
https://fedora.local:8043/api/v2/workflow_job_template_nodes/1/
2. Request Method:
PUT
3. Status Code:
200 OK
4.
Remote Address:
172.16.136.128:8043
5. Referrer Policy:
strict-origin-when-cross-origin
1. {"all_parents_must_converge":false}
I think that this is the actual problem. If I do a patch the identifier remains.
|
Let me be sure I understand what @gamuniz said... The UI does a PUT, but does not provide all of the fields for the node. Since the idea of PUT is that it sets all the fields, it's unclear what the expectations are here, it's even unclear if the API should allow that. As I test with an unrelated object, if I do a PUT and exclude, say, |
Yep, that is what I was saying. I'd say that the correct fix here is to
send a patch so that only the field being passed would be changed via the
api.
…On Thu, Feb 23, 2023 at 9:49 AM Alan Rominger ***@***.***> wrote:
Let me be sure I understand what @gamuniz <https://github.com/gamuniz>
said...
The UI does a PUT, but does not provide *all* of the fields for the node.
Since the idea of PUT is that it sets all the fields, it's unclear what the
expectations are here, it's even unclear if the API should allow that.
As I test with an unrelated object, if I do a PUT and exclude, say,
description then it resets the description to empty string. In that case,
empty string is the default value. Running the uuid4 method is the
"default" value for the workflow node identifier field. So surprising as
this is, that appears to be the canonically accepted correct API behavior
as per the Django rest framework.
—
Reply to this email directly, view it on GitHub
<#13581 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEJSTWJG2TUGWQ65GS6KR3LWY52GDANCNFSM6AAAAAAU562R6M>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Gabe Muniz
Senior Software Maintenance Engineer
|
Please confirm the following
Bug Summary
Hello and thank you for your work.
It seems that the bug previously fixed by this PR merged in 21.5.0 is back.
In a job template visualiser, editing a node wipes out its alias.
AWX version
21.10.2
Select the relevant components
Installation method
kubernetes
Modifications
no
Ansible version
2.12.5.post0
Operating system
Debian GNU/Linux 11 (bullseye)
Web browser
Firefox, Chrome, Edge
Steps to reproduce
From AWX web GUI:
at this point everything is fine. Then:
you will see that the alias got wiped out, it is now empty
Expected results
The node alias should not be wiped every time the node is edited, it should only happen if the form field is cleared by the user.
Actual results
The node alias is wiped out (made empty)
Additional information
The bug does NOT produce on AWX version 21.5.0 with ansible version 2.12.5.post0 (same ansible version in both AWX on my environment)
The text was updated successfully, but these errors were encountered: