github-plugin icon indicating copy to clipboard operation
github-plugin copied to clipboard

[JENKINS-60738] Fix global configuration submission from UI

Open Dohbedoh opened this issue 2 years ago • 11 comments

Fixes JENKINS-60738 caused by changes introduced in https://github.com/jenkinsci/github-plugin/pull/221.

Databinding of hookUrl is not working properly, per my understanding because the DataboundSetter setHookUrl(String hookUrl) accepts a String but the field is a URL. While adding a public void setHookUrl(URL hookUrl) might solve some of the problem, then there is yet another issue that disabling the Specify another hook URL for GitHub configuration checkbox does not remove the hook URL at all... that seems wrong.

So the propose fix:

  • handle the binding and the optional property state in the configure(StaplerRequest req, JSONObject json)
  • reactivate and adjusted the global configuration UI tests
  • [x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • [x] Ensure that the pull request title represents the desired changelog entry
  • [x] Please describe what you did
  • [x] Link to relevant issues in GitHub or Jira
  • [x] Link to relevant pull requests, esp. upstream and downstream changes
  • [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue

Dohbedoh avatar May 02 '23 11:05 Dohbedoh

While this sounds fine as a hotfix, the proper fix would be to delete all the overrides and special cases handling and fix the form to use normal databinding by convention.

jglick avatar May 03 '23 18:05 jglick

@KostyaSha are you ok with this as the active maintainer of this plugin?

jtnord avatar Jun 13 '23 12:06 jtnord

What's the status of this? I've just run into this with our own instance.

jrtc27 avatar Mar 05 '24 00:03 jrtc27

I have the same issue; as a workaround I've been adding <hookUrl> directly to github-plugin-configuration.xml, but unfortunately it's cleared out when I save/apply System settings in the web UI.

yahooguntu avatar Mar 06 '24 23:03 yahooguntu

I have the same issue; as a workaround I've been adding <hookUrl> directly to github-plugin-configuration.xml, but unfortunately it's cleared out when I save/apply System settings in the web UI.

If you edit the config file and restart so it has the updated value in memory then the UI should show the correct setting and not clobber it on save.

jrtc27 avatar Mar 06 '24 23:03 jrtc27

Can this be merged soon? I've just noticed this open PR after implementing the same fix and opening another PR : https://github.com/jenkinsci/github-plugin/pull/375

Feel free to close the other PR

@KostyaSha @jglick

franknarf8 avatar Apr 08 '24 13:04 franknarf8

(I am not a maintainer)

jglick avatar Apr 30 '24 11:04 jglick