-
Notifications
You must be signed in to change notification settings - Fork 396
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-60738] Fix global configuration submission from UI #347
base: master
Are you sure you want to change the base?
Changes from all commits
cfaa0c4
3a5d46f
a6ec398
b14789f
929dbe3
e8952dd
37f455b
029dc4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -27,10 +27,11 @@ f.section(title: descriptor.displayName) { | |||||||||||||||||||||||
f.entry(title: _("Override Hook URL")) { | ||||||||||||||||||||||||
g.blockWrapper { | ||||||||||||||||||||||||
f.optionalBlock(title: _("Specify another hook URL for GitHub configuration"), | ||||||||||||||||||||||||
name: "isOverrideHookUrl", | ||||||||||||||||||||||||
inline: true, | ||||||||||||||||||||||||
checked: instance.isOverrideHookUrl()) { | ||||||||||||||||||||||||
f.entry(field: "hookUrl") { | ||||||||||||||||||||||||
f.textbox(checkMethod: "post") | ||||||||||||||||||||||||
f.textbox(checkMethod: "post", name: "hookUrl") | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
Comment on lines
27
to
37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For example all of this should just be like <f:entry field="hookUrl">
<f:textbox label="Alternate hook URL for GitHub configuration"/>
</f:entry> which may be blank. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see. Remove all the optional block that is not necessary.. Yeah sounds good to me I can test this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be more work for sure. The usual problem with this sort of fix is retaining compatibility for both XML settings and JCasC. Sometimes hacking up the JSON processing in the GUI logic is the only option since refactoring to a simpler structure would break something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the thing that bother me is the type
So it is not that simple to "reset" the hook URL because of the binding.. I thought about changing the type from Changing its signature could be a breaking change. Though it does not seem to be used outside the scope of that plugin repo: https://github.com/search?ref=simplesearch&type=code&q=user%3Ajenkinsci++getHookUrl. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW use permalinks for better display: github-plugin/src/main/java/org/jenkinsci/plugins/github/config/GitHubPluginConfig.java Lines 131 to 141 in 47b623a
|
||||||||||||||||||||||||
|
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.
Other than this method call, the whole
configure
method should not even need to be overridden.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.
The only way I found to simplify the data-binding and just do a
req.bindJson
is to change the signature ofpublic URL getHookUrl()
topublic String getHookUrl()
. That could be a breaking change. Example at 77cfb02.So not sure if that would be acceptable ? cc @KostyaSha
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.
better ask @jglick i forgot databinding nuances
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.
https://github.com/search?q=org%3Ajenkinsci%20getHookUrl&type=code does not look like it is used from other plugins.