Skip to content
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 support for jenkins-helper git ref when build pipeline #420

Closed
wants to merge 4 commits into from

Conversation

zdtsw
Copy link
Contributor

@zdtsw zdtsw commented Sep 28, 2022

Fix: #419

As stated in the doc: You may find that theRepoHandlerTest.groovy:adoptDefaultsGetterReturns()will fail when you add new values. This is expected as the test is pulling in Adopt's master branchdefaults.json which does not yet contain the new values. Please inform any reviewers of this in the pull request.
thats why GH action groovy test failed on adoptDefaultsGetterReturns because on master helper_ref does not exist as null

RepoHandlerTest > adoptDefaultsGetterReturns() FAILED
    org.opentest4j.AssertionFailedError: expected: <null> but was: <master>
        at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
        at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
        at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
        at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
        at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1124)
        at org.junit.jupiter.api.Assertions$assertEquals$1.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
        at RepoHandlerTest.adoptDefaultsGetterReturns(RepoHandlerTest.groovy:27)

@github-actions github-actions bot added documentation generation Issues that provide enhancements or fixes to the job generators jenkins-pipeline testing labels Sep 28, 2022
@github-actions
Copy link

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 Guidelines

If you have not done so already, please familiarise yourself with our Contributing Guidelines and Code Of Conduct, even if you have contributed before.

Tests

Github 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 run tests on this PR.
If you are not an admin, please ask for one's attention in #infrastructure on Slack or ping one here.
To run full set of tests, use "run tests"; a subset of tests on specific jdk version, use "run tests quick 11,18"

@zdtsw
Copy link
Contributor Author

zdtsw commented Sep 28, 2022

run tests quick 11

@eclipse-temurin-bot
Copy link
Collaborator

 PR TESTER RESULT 

❎ Some pipelines failed or the job was aborted! ❎
See the pipeline-build-check below for more information...

@zdtsw
Copy link
Contributor Author

zdtsw commented Sep 28, 2022

run tests quick 11

@eclipse-temurin-bot
Copy link
Collaborator

 PR TESTER RESULT 

❎ Some pipelines failed or the job was aborted! ❎
See the pipeline-build-check below for more information...

@zdtsw
Copy link
Contributor Author

zdtsw commented Sep 29, 2022

run tests quick 11

@zdtsw zdtsw marked this pull request as ready for review September 29, 2022 08:11
@eclipse-temurin-bot
Copy link
Collaborator

 PR TESTER RESULT 

✅ All pipelines passed! ✅

@@ -626,7 +627,8 @@ class Builder implements Serializable {
try {
context.timeout(time: pipelineTimeouts.API_REQUEST_TIMEOUT, unit: "HOURS") {
// Query the Adopt api to get the "tip_version"
def JobHelper = context.library(identifier: 'openjdk-jenkins-helper@master').JobHelper
String helperRef = DEFAULTS_JSON['repository']['helper_ref']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs to check if helper_ref is blank or not set? then default to master?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or can we assume DEFAULTS_JSON must set it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so i added it to the pipeline/defaults.json to master as the default value.
see test : https://ci.adoptopenjdk.net/job/build-scripts-pr-tester/job/build-test/job/openjdk11-pipeline/930/parameters/

@karianna
Copy link
Contributor

karianna commented Oct 1, 2022

@zdtsw Should we expect the Test / Groovy GitHub action to pass on this?

@zdtsw
Copy link
Contributor Author

zdtsw commented Oct 1, 2022

@zdtsw Should we expect the Test / Groovy GitHub action to pass on this?

GH action test is based on master's defaults.json which does not have the new helper_ref yet, so the test is expected to get "null" than "master"
once this is updated, test should be fine.

@zdtsw zdtsw requested a review from karianna October 3, 2022 07:32
@karianna
Copy link
Contributor

karianna commented Oct 3, 2022

@zdtsw Still seems to be failing the test and the linter...

@zdtsw
Copy link
Contributor Author

zdtsw commented Oct 3, 2022

@zdtsw Still seems to be failing the test and the linter...

yeah, seems something is not working with super-linter now , created issue #425

@zdtsw
Copy link
Contributor Author

zdtsw commented Oct 4, 2022

close this PR, will add function into #423

@zdtsw zdtsw closed this Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation generation Issues that provide enhancements or fixes to the job generators jenkins-pipeline testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to have configurable tag when pulling down jenkins-helper repo
4 participants