Skip to content

Commit

Permalink
MINOR; Avoid unnecessarily requesting node for post step in Jenkinsfi…
Browse files Browse the repository at this point in the history
…le (apache#12939)

Pull requests' builds are often waiting unnecessarily on getting an ubuntu node in the post step. The post step sends out an email to the dev mailing list but it does so only for regular branches. For pull requests, it does nothing. However, the check to verify if the build is for a pull request is executed when the node is allocated so the build has to wait for it.

![Screenshot 2022-12-05 at 13 42 58](https://user-images.githubusercontent.com/157182/205639994-afc09ffa-475e-41ae-9e33-86e0dfe4d998.png)

With this change, the check is executed before requesting the node so it does not unnecessarily request a node if one is not needed.

![Screenshot 2022-12-05 at 13 43 21](https://user-images.githubusercontent.com/157182/205640048-57264a1c-3fa4-4c71-9b3d-12fb43490d68.png)

Note that I have verified that sending the email still works with this change (see apache@fc74c83).

Reviewers: Mickael Maison <mickael.maison@gmail.com>
  • Loading branch information
dajac committed Dec 5, 2022
1 parent 1c10d10 commit 2d6357f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ pipeline {

post {
always {
node('ubuntu') {
script {
if (!isChangeRequest(env)) {
script {
if (!isChangeRequest(env)) {
node('ubuntu') {
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: "dev@kafka.apache.org",
Expand Down

0 comments on commit 2d6357f

Please sign in to comment.