adoptium / ci-jenkins-pipelines

jenkins pipeline build scripts
Apache License 2.0
19 stars 70 forks source link

Can we make `openjdk_build_pipeline` more manageable? #1116

Open sxa opened 5 days ago

sxa commented 5 days ago

Features that impact the whole project (e.g. Adding a new OpenJDK distribution) are proposed and discussed in the Adoptium repository.

Otherwise, please suggest the enhancements you would like made to the jenkins pipeline scripts:

The current openjdk_build_pipeline.groovy is over 2500 lines long. We have already had to do a /* groovylint-disable MethodCount */ in https://github.com/adoptium/ci-jenkins-pipelines/pull/955 because of the number of methods in there and while the number of methods isn't too bad the size of some of them make them quite difficult to read and maintain. Noting that there are some other functions which aren't defined with def e.g. verifySigning gpgSign formMetadata that aren't included in this list, so this should not be considered a comprehensive table of function sizes:

145:    def getSmokeTestJobParams() {
160:    def getAQATestJobParams(testType) {
179:    def getCommonTestJobParams() {
318:    def setStageResult(String stage, String result) {
333:    def runSmokeTests() {
387:    def runAQATests() {
557:    def remoteTriggerJckTests(String platform, String jdkFileName) {
657:    def compareReproducibleBuild(String nonDockerNodeName) {
674:                            definition {
743:    def sign(VersionInfo versionInfo) {
878:    def buildInstaller(VersionInfo versionData) {
925:    def signInstaller(VersionInfo versionData) {
1281:    def writeMetadata(VersionInfo version, Boolean initialWrite) {
1372:    def determineFileName() {
1434:    def readCrossCompiledVersionString() {
1485:    def printGitRepoInfo() {
1890:    def waitForANodeToBecomeActive(def label) {
1932:    def updateGithubCommitStatus(STATE, MESSAGE) {
1959:    def addNodeToBuildDescription() {
1970:    def build() {
(Ends at 2312)

Some of my changes in an upcoming PR for https://github.com/adoptium/infrastructure/issues/3709 will split up some functionality an refactor bits of build() and

sxa@fedora:~/git/ci-jenkins-pipelines$ grep -nw 'def.*[{(]$' ./pipelines/build/common/openjdk_build_pipeline.groovy
145:    def getSmokeTestJobParams() {
160:    def getAQATestJobParams(testType) {
179:    def getCommonTestJobParams() {
318:    def setStageResult(String stage, String result) {
333:    def runSmokeTests() {
387:    def runAQATests() {
557:    def remoteTriggerJckTests(String platform, String jdkFileName) {
656:    def compareReproducibleBuild(String nonDockerNodeName) {
673:                            definition {
742:    def sign(VersionInfo versionInfo) {
881:    def buildInstaller(VersionInfo versionData) {
929:    def signInstaller(VersionInfo versionData) {
1292:    def writeMetadata(VersionInfo version, Boolean initialWrite) {
1394:    def determineFileName() {
1456:    def readCrossCompiledVersionString() {
1520:    def printGitRepoInfo() {
1528:def buildScriptsEclipseSigner() {
1641:def buildScriptsAssemble(
1776:    def buildScripts(
2122:    def waitForANodeToBecomeActive(def label) {
2164:    def updateGithubCommitStatus(STATE, MESSAGE) {
2191:    def addNodeToBuildDescription() {
2202:    def build() 
(Ends at 2598 in the current version, but there is more cleaning to be done)

In addition we have all of the signing scripting that is run on mac/windows on the eclipse codesign machine inlined into the pipeline scripts where it would be preferable, if feasible, to have that as a separate shell script that is invoked.