-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
[JENKINS-71737] fix redirect when submitting cloud changes #8505
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't work if someone clicks apply and then makes another change.
(the main reason for the rename page I thought was to avoid the apply button being present)
@timja you are right, in my excitement I forgot about that part 🤦 |
Basil suggested on the other PR you could just remove the apply button and that may be the simplest fix and then going with this |
@@ -331,7 +331,8 @@ public HttpResponse doConfigSubmit(StaplerRequest req, StaplerResponse rsp) thro | |||
j.clouds.replace(this, result); | |||
j.save(); | |||
// take the user back to the cloud top page. | |||
return FormApply.success("."); | |||
return FormApply.success("../" + result.name + '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for what it's worth, I think return FormApply.success("../..");
is the quick fix for the issue. Due to the underlying url manage/cloud/xyz/configure
. You will always be in .../configure
so you are forced to get back to the overall cloud listing page. If you want some elegance you test whether the name has not changed, then use the old way. However, since index.jelly is e.g. in kubernetes plugin a blank page and doing "."
leads to it I would rather be redirected to the overall cloud page, but that is me as a user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scherler ..
was the original fix, but I think the main issue with that was that a quick fix was not desired, but rather a proper way to address the UX behavior
See #8310 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bug is a bug and should be fixed. Any follow-up should be addressed after that. That is just my 2 cents being a fan of iterations. The follow-up cost for any downstream plugin/code is to fix it themselves while we boil the ocean, which does not make sense at all. I know there will be a lot of "the follow-up never will come" excuses to not fix a BUG but that is a completely different discussion IMHO if the fix is ../..
and the behavior before the breaking change is back, there should not be a discussion. Really questionable why the fix has not landed 24 h after the PR had been filed. 🤷♂️
https://github.com/scherler/jenkins/tree/JENKINS-71737 is the test that should pass |
Can we go with this and forget about this bug? |
Why not just remove the apply button? |
Yes, this is what I meant. |
go for it |
@@ -231,7 +231,6 @@ private void handleNewCloudPage(Descriptor<Cloud> descriptor, String name, Stapl | |||
checkName(name); | |||
JSONObject formData = req.getSubmittedForm(); | |||
formData.put("name", name); | |||
formData.put("cloudName", name); // ec2 uses that field name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ec2 no longer uses that filed name
jenkinsci/ec2-plugin#892
also azure-vm-agents
jenkinsci/azure-vm-agents-plugin#462
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
…#8505) Co-authored-by: Alexander Brandes <[email protected]> (cherry picked from commit ec27a07)
See JENKINS-71737.
#8310 first started as simple redirect fixes, but they never worked for downstream plugins (particularly
ec2
andazure-vm-agents
). The solution then evolved to make a separate rename page that was consistent with the rename logic ofAbstractItem
introduced in #3289 .Eventually it was discovered that the use of
cloudName
instead ofname
in the downstream plugins, along with a hardcoded workaround in core was what made my initial attempts at redirect fail.This PR is an alternative to the more complicated #8310
Fixes the redirect so that
save
goes to the new cloud name page and it removes the apply button from cloud configurationTesting done
Tested manually in
ec2
andazure-vm-agents
TODO: Create PRs with incremental generated by this PR
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist