mirror of
https://github.com/corda/corda.git
synced 2024-12-30 01:39:04 +00:00
f30ba33929
The node now sends a transaction to the verifier if any of its attachments were compiled with Kotlin 1.2 (the net.corda.node.verification.external system property has been removed). It uses kotlinx-metadata to read the Kotlin metadata in the attachment to determine this. For now this scanning is done each time the attachment is loaded from the database. The existing external verification integration tests were converted into smoke tests so that 4.11 nodes could be involved. This required various improvements to NodeProcess.Factory. A new JAVA_8_HOME environment variable, pointing to JDK 8, is required to run these tests. There is still some follow-up work that needs to be done: Sending transactions from a 4.11 node to a 4.12 node works, but not the other way round. A new WireTransaction component group needs to be introduced for storing 4.12 attachments so that they can be safely ignored by 4.11 nodes, and the 4.12 node needs to be able to load both 4.11 and 4.12 versions of the same contracts CorDapp so that they can be both attached to the transaction. Even though attachments are cached when retrieved from the database, the Kotlin metadata version should be stored in the attachments db table, rather than being scanned each time. Finally, VerificationService was refactored into NodeVerificationSupport and can be passed into SignedTransaction.verifyInternal, instead of needing the much heavier VerifyingServiceHub. This makes it easier for internal tools to verify transactions and spawn the verifier if necessary.
175 lines
6.2 KiB
Groovy
175 lines
6.2 KiB
Groovy
#!groovy
|
|
/**
|
|
* Jenkins pipeline to build Corda Opensource Pull Requests.
|
|
*/
|
|
|
|
@Library('corda-shared-build-pipeline-steps')
|
|
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
|
|
|
|
killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
|
|
|
|
/**
|
|
* Common Gradle arguments for all Gradle executions
|
|
*/
|
|
String COMMON_GRADLE_PARAMS = [
|
|
'--no-daemon',
|
|
'--stacktrace',
|
|
'--info',
|
|
/*
|
|
** revert default behavour for `ignoreFailures` and
|
|
** do not ignore test failures in PR builds
|
|
*/
|
|
'-Ptests.ignoreFailures=false',
|
|
'-Pcompilation.warningsAsErrors=false',
|
|
'-Ptests.failFast=true',
|
|
'-Ddependx.branch.origin="${GIT_COMMIT}"', // DON'T change quotation - GIT_COMMIT variable is substituted by SHELL!!!!
|
|
'-Ddependx.branch.target="${CHANGE_TARGET}"', // DON'T change quotation - CHANGE_TARGET variable is substituted by SHELL!!!!
|
|
'--build-cache',
|
|
].join(' ')
|
|
|
|
pipeline {
|
|
agent { label 'standard' }
|
|
|
|
/*
|
|
* List options in alphabetical order
|
|
*/
|
|
options {
|
|
ansiColor('xterm')
|
|
buildDiscarder(logRotator(daysToKeepStr: '14', artifactDaysToKeepStr: '14'))
|
|
parallelsAlwaysFailFast()
|
|
timeout(time: 6, unit: 'HOURS')
|
|
timestamps()
|
|
}
|
|
|
|
/*
|
|
* List environment variables in alphabetical order
|
|
*/
|
|
environment {
|
|
ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials')
|
|
BUILD_CACHE_CREDENTIALS = credentials('gradle-ent-cache-credentials')
|
|
BUILD_CACHE_PASSWORD = "${env.BUILD_CACHE_CREDENTIALS_PSW}"
|
|
BUILD_CACHE_USERNAME = "${env.BUILD_CACHE_CREDENTIALS_USR}"
|
|
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
|
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
|
CORDA_GRADLE_SCAN_KEY = credentials('gradle-build-scans-key')
|
|
CORDA_USE_CACHE = "corda-remotes"
|
|
JAVA_HOME="/usr/lib/jvm/java-17-amazon-corretto"
|
|
JAVA_8_HOME = "/usr/lib/jvm/java-1.8.0-amazon-corretto"
|
|
}
|
|
|
|
stages {
|
|
stage('Compile') {
|
|
steps {
|
|
authenticateGradleWrapper()
|
|
sh script: [
|
|
'./gradlew',
|
|
COMMON_GRADLE_PARAMS,
|
|
'clean',
|
|
'jar',
|
|
'--parallel'
|
|
].join(' ')
|
|
}
|
|
}
|
|
|
|
stage('Stash') {
|
|
steps {
|
|
stash name: 'compiled', useDefaultExcludes: false
|
|
}
|
|
}
|
|
|
|
stage('All Tests') {
|
|
parallel {
|
|
stage('Another agent') {
|
|
agent {
|
|
label 'standard'
|
|
}
|
|
options {
|
|
skipDefaultCheckout true
|
|
}
|
|
post {
|
|
always {
|
|
archiveArtifacts artifacts: '**/*.log', allowEmptyArchive: true, fingerprint: true
|
|
junit testResults: '**/build/test-results/**/*.xml', keepLongStdio: true,allowEmptyResults: true
|
|
}
|
|
cleanup {
|
|
deleteDir() /* clean up our workspace */
|
|
}
|
|
}
|
|
stages {
|
|
stage('Unstash') {
|
|
steps {
|
|
unstash 'compiled'
|
|
}
|
|
}
|
|
stage('Recompile') {
|
|
steps {
|
|
authenticateGradleWrapper()
|
|
sh script: [
|
|
'./gradlew',
|
|
COMMON_GRADLE_PARAMS,
|
|
'jar',
|
|
'--parallel'
|
|
].join(' ')
|
|
}
|
|
}
|
|
stage('Unit Test') {
|
|
steps {
|
|
sh script: [
|
|
'./gradlew',
|
|
COMMON_GRADLE_PARAMS,
|
|
'test'
|
|
].join(' ')
|
|
}
|
|
}
|
|
stage('Smoke Test') {
|
|
steps {
|
|
sh script: [
|
|
'./gradlew',
|
|
COMMON_GRADLE_PARAMS,
|
|
'smokeTest'
|
|
].join(' ')
|
|
}
|
|
}
|
|
stage('Slow Integration Test') {
|
|
steps {
|
|
sh script: [
|
|
'./gradlew',
|
|
COMMON_GRADLE_PARAMS,
|
|
'slowIntegrationTest'
|
|
].join(' ')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Same agent') {
|
|
post {
|
|
always {
|
|
archiveArtifacts artifacts: '**/*.log', allowEmptyArchive: true, fingerprint: true
|
|
junit testResults: '**/build/test-results/**/*.xml', keepLongStdio: true, allowEmptyResults: true
|
|
}
|
|
}
|
|
stages {
|
|
stage('Integration Test') {
|
|
steps {
|
|
sh script: [
|
|
'./gradlew',
|
|
COMMON_GRADLE_PARAMS,
|
|
'integrationTest'
|
|
].join(' ')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
findBuildScans()
|
|
}
|
|
cleanup {
|
|
deleteDir() /* clean up our workspace */
|
|
}
|
|
}
|
|
}
|