jenkinsci / extension-filter-plugin

https://plugins.jenkins.io/extension-filter/
MIT License
2 stars 7 forks source link

`jenkins.model.Jenkins` default value breaks empty context form round trip #49

Closed daniel-beck closed 8 months ago

daniel-beck commented 9 months ago

https://github.com/jenkinsci/extension-filter-plugin/blob/33202c8708d46c2e57466ecbb4a2d7e10620363c/src/main/java/org/jenkinsci/plugins/Exclusion.java#L23 and https://github.com/jenkinsci/extension-filter-plugin/blob/33202c8708d46c2e57466ecbb4a2d7e10620363c/src/main/java/org/jenkinsci/plugins/ConfigurableExtensionFilter.java#L92 indicate it should be possible to have a null context.

https://github.com/jenkinsci/extension-filter-plugin/blob/33202c8708d46c2e57466ecbb4a2d7e10620363c/src/main/resources/org/jenkinsci/plugins/ConfigurableExtensionFilter/global.jelly#L12 breaks round-trip behavior, as it will replace a null value with jenkins.model.Jenkins on subsequent form submissions.

JenkinsRule#configRoundtrip can help write a test.

jonesbusy commented 8 months ago

Thanks I will try to take a look at it unless someone pick it before.

Plugin need other refresh (example https://github.com/jenkinsci/extension-filter-plugin/issues/54)