What are "Branch indexing" activities in Jenkins BlueOcean
Asked Answered
D

1

10

I'm setting a Multi-Branch pipeline in jenkins blue ocean. Everything is starting to work nice.

One thing I've noticed is that once a while, I get an execution of the job named: "Branch indexing" running.

My build contains some heavy unit testing and code coverage, that take ~4h30 to be executed, so having this job randomly executed 2 times is not really good(not even taking in account that we have 6-8 active branches, so it would mean that the executions will only stacks.

So:

1) What are those executions? 2) Is this absolutely required? 3) Can I disable it?

Dowry answered 28/6, 2018 at 11:54 Comment(7)
Branch indexing discovers new or deleted branches. In the job configuration (Branch Sources > Property strategy), you can activate Suppress automatic SCM triggering, which will not automatically build new branches.Highbred
But this is not a new branch, I'm talking about develop that have been build 2h before it has been triggered.Dowry
And it says something like "triggered by branch indexing"?Highbred
The other builds have the name of the last commit. This one has just "Branch indexing" as title, so I guess.Dowry
Did you figure this out? I'm having the same issue, trying to disable this "Branch Indexing". I asked a Q here #54334758Ditzel
@Ditzel unfortunately no :(Dowry
It's probably this Scan Organization Triggers or Child Scan Triggers, from the explanation, it said This trigger allows for a periodic fallback, but when necessary. If no indexing has been performed in the specified interval, then an indexing will be scheduled.Mussolini
T
2

In Jenkins, we can create a stage to abort branch indexing.

stage('Branch indexing: abort') {
            when {
                allOf {
                    triggeredBy cause: "BranchIndexingCause"
                    not { 
                        changeRequest() 
                    }
                }
            }
            steps {
                script {
                    echo "Branch discovered by branch indexing"
                    currentBuild.result = 'SUCCESS' 
                    error "Caught branch indexing..."
                }
            }
        }
Thalia answered 1/9, 2021 at 10:19 Comment(1)
You're explaining what the 'branch indexing' is though?Hightoned

© 2022 - 2024 — McMap. All rights reserved.