diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index c6016c05a..937e5b5e4 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -256,7 +256,19 @@ timeout(time: 2, unit: 'HOURS') { 'schema': runDockerPostgresSidecar( 'echo schema test', schemaStashsrc, schemaStashdir ), - 'migration': runDockerPostgresSidecar(testMigrations()), + + 'migration': runDockerPostgresSidecar( + 'make migration', + ['backend/src/schema.rs'], + ['schemaold.rs'] + ), + + 'redomigration': runDockerPostgresSidecar( + testMigrations(), + ['backend/src/schema.rs'], + ['schemanew.rs'] + ), + 'changelog': runDocker( './ci/scripts/check-changelog.sh', 'permaplant-node:ci', @@ -265,6 +277,18 @@ timeout(time: 2, unit: 'HOURS') { ), failFast: true ) + + node('docker') { + unstash('schemaold.rs') + def beforeChecksum = sh(script: "sha256sum backend/src/schema.rs", returnStdout: true).trim() + unstash('schemanew.rs') + def afterChecksum = sh(script: "sha256sum backend/src/schema.rs", returnStdout: true).trim() + if (beforeChecksum != afterChecksum) { + throw new SchemaModifiedException() + } else { + echo 'Schema.rs was not modified during migration tests.' + } + } } stage('Test and Build') { @@ -440,3 +464,11 @@ class UnequalStashException extends Exception { } } + +class SchemaModifiedException extends Exception { + + SchemaModifiedException() { + super('Schema.rs was modified during migration tests.') + } + +} diff --git a/doc/changelog.md b/doc/changelog.md index da5c25423..6038aba74 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -85,6 +85,7 @@ Syntax: `- short text describing the change _(Your Name)_` - wrap api queries using react query _(Daniel Steinkogler)_ - CI: running pr deployment only on pr and not master branch _(Filip Markovic)_ - CI: unstash schemas in release pipeline in build-backend _(4ydan)_ +- CI: added check if schema.rs changes in remigration _(Filip Markovic)_ - _()_ - Fixed German common names not being used when language is set to German _(Christoph Schreiner)_ - _()_