I'm confused. As far as I was aware, the 'Suppress automatic SCM triggering' property already does what you require - branches will be indexed, but no builds will ever be triggered by an SCM poll
Or perhaps there's three different requirements here - as I've already said, I'm a big fan of the "different behaviour on first indexing" approach, but it looks like your requirement is a little more specific. On Fri, Apr 24, 2020 at 1:39 PM Adam Gabryś <[email protected]> wrote: > @Liam Newman > > It is impossible to implement in a nice way a new strategy without > changing the BranchBuildStrategy > <https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/BranchBuildStrategy.java> > class. I have access only to stuff, which are listed there. I wouldn't like > not to implement a class which requires to configure job name, and next use > Jenkins API to get the item by name etc. > > "Skip Build on First Job Indexing" is not enough. Users are able to > configure indexing on regular basics (for example once per day). It is > useful, if a webhook is not delivered, then on thenext day developers may > execute the job from Jenkins UI. Without indexing the branch in such case > will never be available. > > I think the cleanest solution is to pass information about the build > reason to the strategy (indexing or event). This gives ability to implement > simple strategies like "SkipBuildOnJobIndexing" or more advanced if any > body needed. For us and I think most of the people "SkipBuildOnJobIndexing" > is enough (probably most of the people use hooks instead of polling). > > > @Daniel Beck > > The BranchBuildStrategy > <https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/BranchBuildStrategy.java> > class > gives access to SCMHead, so you are able to get a branch name. There is no > information about the build cause. > > > @Joh Brohauge > > My solution works, but it is not clean. As I wrote above, the cleanest > solution is to add a build cause to the BranchBuildStrategy > <https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/BranchBuildStrategy.java> > class. > Then people may implement simple and complex strategies required by them. > > Finally, we have exactly the same situation as you, I provide CI as a > Service, I don't own or influence teams repositories. > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/418b55ff-2ea3-4f23-9f30-5bf2571d3dff%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/418b55ff-2ea3-4f23-9f30-5bf2571d3dff%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAEWqh9H18La%3DaZvbp%3DzCGbr%2BGSHF4mmLBdVb_phTueTqxd-UHA%40mail.gmail.com.
