So before we cut a GA release of the JENKINS-43507 changes I thought it might be a good idea to resolve one question.
There are some users who would like the Branch source to also return Tags
Now in a sense this is perfectly reasonable. I think there are some things that need to be ironed out first before we can enable discovery of tags. To give an example, you probably do not want to trigger a build storm of all your old tags if you recreate the multibranch project... in fact if you were using the pipeline to deploy to production when it detects the build is on a tag... this would be a very bad plan.
So before we enable the discovery of tags, we need to solve some problems...
But now, let's take it as read that we have solved those problems... this means that the Git source could be configured into one of four possible states:
- Stupid state: discovers nothing
- Branches only
- Tags only
- Both branches and tags
The natural way, given the conventions in the GitHub and Bitbucket behaviours / traits is that we would have one behaviour for discovering branches and one for discovering tags...
Well right now GitSCMSource has neither, it just discovers branches always.
That means we would have to grandfather in the discovery of branches.
So if we read a GitSCMSource from disk and it has no discovery traits we would then assume it is not configured thus by the user intent on it being in the stupid state... rather they want to discover branches... the constructor would have to always add the discovery trait from the start and people would need to configure away branch discovery... it seems like a bit of a mess to me.
So what I am thinking is that we just add a Git specific "Discover Branches" behaviour to the plugin before the 3.4.0 GA release. The legacy constructor would inject it as would readResolve and the UI would always propose it when creating via the UI
It does mean that the UI will always start with Discover Branches present (taking up vertical space that is effectively useless until we get Discover Tags) but I think it will make the addition of Discover Tags much less risky
WDYT?
-Stephen