-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] Custom revision parameter for Jenkins jobs #3419
[ci] Custom revision parameter for Jenkins jobs #3419
Conversation
This commit introduces a REVISION parameter (when clicking Build With Parameters) to help running adhoc Jenkins builds with a specific revision.
This pull request does not have a backport label. Could you fix it @dliappis? 🙏
NOTE: |
SonarQube Quality Gate |
steps { | ||
pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ]) | ||
deleteDir() | ||
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true) | ||
gitCheckout(basedir: "${BASE_DIR}", branches: [[name: "${params.REVISION}"]], githubNotifyFirstTimeContributor: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changing the default behaviour, if REVISION
is optional, then, I'd say to keep the default behaviour if empty and checkout the given branch otherwise.
On the other hand, branches
is not a valid argument for the gitCheckout
-> https://github.com/elastic/apm-pipeline-library/tree/main/vars#gitcheckout
gitCheckout(basedir: "${BASE_DIR}", branches: [[name: "${params.REVISION}"]], githubNotifyFirstTimeContributor: true) | |
whenTrue("$REVISION" != "") { | |
gitCheckout(basedir: "${BASE_DIR}", branch: "${REVISION}", githubNotifyFirstTimeContributor: true) | |
} | |
whenFalse("$REVISION" != "") { | |
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit introduces a REVISION parameter (when clicking Build With Parameters) to help running adhoc Jenkins builds with a specific revision.
Will creating a PR from any given commit could help with? Or even creating a branch in elastic/elastic-agent
for the given commit replace this particular implementation?
By doing so, there is no need to interact with Jenkins but wait for the outcome. If using PRs then, the GitHub comment with the build result could help with.
Just an idea
@v1v This sounds like a great idea! In addition, given that #3411 seems to have addressed the issue that triggered this need, I think it might be best to close this PR. |
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
|
🌐 Coverage report
|
This commit introduces a REVISION parameter (when clicking Build With Parameters) to help running adhoc Jenkins builds with a specific revision.
It can be useful for re-producing failures similar to elastic/beats#35803