fabric8io / fabric8-generator

a jboss forge add on for the fabric8 upstream and SaaS generator wizards
Apache License 2.0
1 stars 12 forks source link

allow users to opt out of upgrading the fabric8-maven-plugin version on import #38

Closed jstrachan closed 7 years ago

jstrachan commented 7 years ago

its fairly likely that old versions will work worse than the curated version; but we could allow users to opt out of the upgrade on import

burrsutter commented 7 years ago

At a minimum, we should block the import if we find a pre-existing Jenkinsfile and the user does NOT want his file replaced.

jstrachan commented 7 years ago

in pseudo-code we should add a CheckExistingJenkinsfileStep to the fabric8-generator before the ChoosePipelineStep.

jstrachan commented 7 years ago

Maybe a much simpler way to implement it is to detect an existing Jenkinsfile exists in ChoosePipelineStep and add an UIInput<Boolean> keepJenkinsfile option to it first? If the user opts to keep jenkinsfiles then any project(s) being imported/created will not use the selected pipeline but will reuse the existing one - otherwise it carries on as normal copying the selected Jenkinsfile into the project(s).

The only complication is we can import multiple projects; so if there are multiple projects being imported; one could have a Jenkinsfile, another may not. So if we take this approach we probably always want to show the pick pipeline UI - even if the user selects the 'keepJenkinsfile' option (so that the pipeline selection is ignored).

Am not sure thats such a big issue really; the main thing is we let users opt out of replacing Jenkinsfiles if they are present (but overwrite them by default and give a suitable warning)?

Then we can always revisit again later if we can figure out a better UX?