-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat: add logic to overwrite defaultsJson's build_branch and pipeline_branch and add helper_ref #423
Conversation
Thank you for creating a pull request!Please check out the information below if you have not made a pull request here before (or if you need a reminder how things work). Code Quality and Contributing GuidelinesIf you have not done so already, please familiarise yourself with our Contributing Guidelines and Code Of Conduct, even if you have contributed before. TestsGithub actions will run a set of jobs against your PR that will lint and unit test your changes. Keep an eye out for the results from these on the latest commit you submitted. For more information, please see our testing documentation. In order to run the advanced pipeline tests (executing a set of mock pipelines), it requires an admin to post |
a03f4f5
to
34e847a
Compare
run tests quick 19 |
PR TESTER RESULT ❎ Some pipelines failed or the job was aborted! ❎ |
re-run https://ci.adoptopenjdk.net/job/build-scripts-pr-tester/job/build-test/job/jobs/job/jdk19/job/jdk19-alpine-linux-x64-temurin/60/console, due to previous docker build container failure Passed |
PR TESTER RESULT ❎ Some pipelines failed or the job was aborted! ❎ |
run tests quick 17 |
PR TESTER RESULT ✅ All pipelines passed! ✅ |
config_regeneration.groovy
add more into description as "Updates" for what this PR does |
Fix #417
Fix #419
In order to use this overwrite feature, must set
USE_ADOPT_SHELL_SCRIPTS
to false for the downstream job,or trigger from pipeline to uncheck
useAdoptBashScripts
test: https://ci.adoptopenjdk.net/job/build-scripts-pr-tester/job/build-test/job/jobs/job/jdk17u/job/jdk17u-linux-x64-temurin/
Update:
This can be achieved by two ways:
set
modify
BUILD_CONFIGURATION
's default values:this PR has below main changes:
DEFAULTS_JSON
within in the build steps inopenjdk_build_pipeline.groovy
buildScripts()after this, everywhere uses
DEFAULTS_JSON
to getbuild_branch
,pipeline_branch
andhelper_ref
has been modified if they are set to a real value in theBUILD_CONFIGURATION
So, do a
context.println JsonOutput.toJson(DEFAULTS_JSON)
to see the real values we are using in the build.replace
openjdk-jenkins-helper@master
which is used to do checkout of jenkins-helper repo toopenjdk-jenkins-helper@${helperRef}
which can use a variable (read out fromDEFAULTS_JSON['repository']['helper_ref']
) to point to either a branch or a tag if it has been updated from (1), or bybuildConfig.HELPER_REF ?: DEFAULTS_JSON['repository']['helper_ref']
similar to (2),
{DEFAULTS_JSON['repository']['build_branch']}
is replaced toconfiguration.buildRef ?: DEFAULTS_JSON['repository']['build_branch']
TODO in src/test/groovy: need to enable test once the code is in master, or the GH action will fail·
fix lint: space, quotes ,minus(), length of line etc
P.S
for part in the pr-test's
kick_off_tester
, only sethelperRef = DEFAULTS_JSON['repository']['helper_ref']
(i.e read from defaults.json because no intervention from parameter is used when pr-test triggered by GH action)same reason for
build_job_generator
andbuild_pipeline_generator