Browse Source

MINOR; Avoid unnecessarily requesting node for post step in Jenkinsfile (#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 fc74c8375a).

Reviewers: Mickael Maison <mickael.maison@gmail.com>
pull/12958/head
David Jacot 2 years ago committed by GitHub
parent
commit
2d6357f6fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      Jenkinsfile

6
Jenkinsfile vendored

@ -236,9 +236,9 @@ pipeline { @@ -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",

Loading…
Cancel
Save