Skip to content

Conversation

@proski
Copy link

@proski proski commented Jul 11, 2019

All advanced settings have reasonable defaults so they can be optional settings. Move then from @DataBoundConstructor to individual setters.

Make StashBuildTrigger initialize fields to the config.jelly defaults. That way, the Pipeline Snippet Generator knows what the defaults are and skips them from the snippets.

A nice side effect is having test this please and NO TEST shared between the code and config.jelly.

This PR is based on top of #69, as it's untestable without pipeline support.

The changes are based on https://jenkins.io/doc/developer/plugin-development/pipeline-integration/

@jakub-bochenski
Copy link

jakub-bochenski commented Jul 11, 2019

This PR is based on top of #69, as it's untestable without pipeline support.

The part that moves fields into @DataBoundSetter is actually beneficial to the job-dsl plugin usage. I don't think job-dsl cares about jelly though.
Could you maybe split this change to a separate PR so that it can be checked against dynamic dsl?

@proski
Copy link
Author

proski commented Jul 11, 2019

OK, I removed the dependency on pipelines (#69) but I left the dependency on #116. Actually, I hope both will be merged soon.

proski added 2 commits July 12, 2019 08:47
Change the constructor to accept essential settings only.

Reorder private fields, setters and getters the way they are ordered in
config.jelly.
That makes the Pipeline Snippet Generator skip arguments from the trigger
call if those arguments have default values.

Keep default values for the skip phrase and the build phrase in the
descriptor, so they can be used both in config.jelly and in the code.
@jakub-bochenski jakub-bochenski merged commit 5aae7f6 into jenkinsci:master Jul 21, 2019
@proski proski deleted the optional-settings branch July 21, 2019 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants