Skip to content

[Build] Autenticate access to Jenkins API in build#3808

Merged
HannesWell merged 1 commit into
eclipse-platform:masterfrom
HannesWell:jenkins-api-authentication
May 7, 2026
Merged

[Build] Autenticate access to Jenkins API in build#3808
HannesWell merged 1 commit into
eclipse-platform:masterfrom
HannesWell:jenkins-api-authentication

Conversation

@HannesWell
Copy link
Copy Markdown
Member

Based on the expected solution from

This should resolve

This is currently a draft as it is not yet tested and probably needs adaption to the final credential names.

@HannesWell HannesWell force-pushed the jenkins-api-authentication branch from 455b9dd to edce661 Compare May 7, 2026 16:29
Comment on lines +198 to +204
def getTestDuration() {
// Workaround for https://github.com/jenkinsci/junit-plugin/issues/1235
withCredentials([usernameColonPassword(credentialsId: 'jenkins-api', variable: 'JENKINS_API_TOKEN')]) {
def summary = sh(script: 'curl --fail --user "${JENKINS_API_TOKEN}" "${BUILD_URL}/testReport/api/json?tree=duration"', returnStdout: true)
return readJSON(text: summary).duration
}
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If jenkinsci/junit-plugin#1236 is available one day, this can be removed and rebased at the caller by just testResults.duration.

@HannesWell HannesWell marked this pull request as ready for review May 7, 2026 16:31
And reduce access to Jenkins API when collecting the test result summary
(only the duration is not yet available without the Jenkins API).
@HannesWell HannesWell force-pushed the jenkins-api-authentication branch from edce661 to 76b6bba Compare May 7, 2026 16:57
@HannesWell
Copy link
Copy Markdown
Member Author

All testing was successful, submitting.

@HannesWell HannesWell merged commit 2cd98ab into eclipse-platform:master May 7, 2026
6 checks passed
@HannesWell HannesWell deleted the jenkins-api-authentication branch May 7, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant