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

Releasing encryption POC on Snapshot #1639

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
### Enhancements
* [Sync] Added option to use managed WebSockets via OkHttp instead of Realm's built-in WebSocket client for Sync traffic (Only Android and JVM targets for now). Managed WebSockets offer improved support for proxies and firewalls that require authentication. This feature is currently opt-in and can be enabled by using `AppConfiguration.usePlatformNetworking()`. Managed WebSockets will become the default in a future version. (PR [#1528](https://github.com/realm/realm-kotlin/pull/1528)).
* `AutoClientResetFailed` exception now reports as the throwable cause any user exceptions that might occur during a client reset. (Issue [#1580](https://github.com/realm/realm-kotlin/issues/1580))
* Added an experimental configuration API which will allow to pass the encryption key using a callback https://github.com/realm/realm-kotlin/pull/1636.

### Fixed
* Cache notification callback JNI references at startup to ensure that symbols can be resolved in core callbacks. (Issue [#1577](https://github.com/realm/realm-kotlin/issues/1577))
Expand All @@ -30,6 +31,7 @@
* Update to Ktor 2.3.4.
* Updated to CMake 3.27.7
* Updated to Realm Core 13.25.0, commit 71f94d75e25bfc8913fcd93ae8de550b57577a4a.
* The Unpacking of JVM native library will use the current library version instead of a calculated hash for the path.


## 1.13.1-SNAPSHOT (YYYY-MM-DD)
Expand Down
298 changes: 150 additions & 148 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ publishBuild = false
version = null
// Wether or not to run test steps
runTests = true
isReleaseBranch = releaseBranches.contains(currentBranch)
//isReleaseBranch = releaseBranches.contains(currentBranch)
isReleaseBranch = false
// Manually wipe the workspace before checking out the code. This happens automatically on release branches.
forceWipeWorkspace = false

Expand Down Expand Up @@ -154,152 +155,152 @@ pipeline {
runStaticAnalysis()
}
}
stage('Benchmarks') {
steps {
runBenchmarks()
}
}
stage('Tests Compiler Plugin') {
when { expression { runTests } }
steps {
runCompilerPluginTest()
}
}
stage('Tests macOS - Unit Tests') {
when { expression { runTests } }
steps {
testAndCollect("packages", "cleanAllTests macosTest -PincludeTestModules=false")
}
}
stage('Tests Android - Unit Tests') {
when { expression { runTests } }
steps {
withLogcatTrace(
"unittest",
{
testAndCollect("packages", "cleanAllTests connectedAndroidTest -PincludeTestModules=false")
}
)
}
}
stage('Integration Tests - Android') {
when { expression { runTests } }
steps {
testWithServer([
{
withLogcatTrace(
"integrationtest",
{
forwardAdbPorts()
testAndCollect("packages", "cleanAllTests -PsyncUsePlatformNetworking=true -PincludeSdkModules=false connectedAndroidTest")
}
)
}
])
}
}
stage('Integration Tests - macOS - New memory model') {
when { expression { runTests } }
steps {
testWithServer([
// This will overwrite previous test results, but should be ok as we would not get here
// if previous stages failed.
{
testAndCollect("packages", "cleanAllTests macosTest -PincludeSdkModules=false")
},
])
}
}
stage('Tests JVM') {
when { expression { runTests } }
steps {
testWithServer([
{
testAndCollect("packages", 'cleanAllTests jvmTest -PsyncUsePlatformNetworking=true -PincludeSdkModules=false ')
}
])
}
}
stage('Integration Tests - iOS') {
when { expression { runTests } }
steps {
testWithServer([
{
testAndCollect("packages", "cleanAllTests iosTest -PincludeSdkModules=false")
}
])
}
}
stage('Minified Sync Tests - Android') {
when { expression { runTests } }
steps {
testWithServer([
{
testAndCollect("packages", 'cleanAllTests :test-sync:connectedAndroidtest -PsyncUsePlatformNetworking=true -PincludeSdkModules=false -PtestBuildType=debugMinified')
}
])
sh 'rm mapping.zip || true'
zip([
'zipFile': 'mapping.zip',
'archive': true,
'glob': 'packages/test-sync/build/outputs/mapping/debugMinified/mapping.txt'
])
}
}
stage('Gradle Plugin Integration Tests') {
when { expression { runTests } }
steps {
testAndCollect("integration-tests/gradle/current", "integrationTest")
testAndCollect("integration-tests/gradle/current", "-Pkotlin.experimental.tryK2=true integrationTest")
testAndCollect("integration-tests/gradle/gradle6-test", "integrationTest")
testAndCollect("integration-tests/gradle/gradle71-test", "integrationTest")
testAndCollect("integration-tests/gradle/gradle75-test", "integrationTest")
withEnv(["JAVA_HOME=${JAVA_17}"]) {
testAndCollect("integration-tests/gradle/gradle8-test", "integrationTest")
testAndCollect("integration-tests/gradle/gradle85-test", "integrationTest")
}
}
}
stage('Tests Android Sample App') {
when { expression { runTests } }
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
runMonkey()
}
runAndroidUnitTestsOnJvm()
}
}
stage('Build Android on minimum versions') {
when { expression { runTests } }
steps {
runBuildMinAndroidApp()
}
}
stage('Test Realm Java Compatibility App') {
when { expression { runTests } }
steps {
testAndCollect("examples/realm-java-compatibility", "connectedAndroidTest")
testAndCollect("examples/realm-java-compatibility", "-Pkotlin.experimental.tryK2=true connectedAndroidTest")
}
}
stage('Track build metrics') {
when { expression { currentBranch == "main" } }
steps {
trackBuildMetrics(version)
}
}
// stage('Benchmarks') {
// steps {
// runBenchmarks()
// }
// }
// stage('Tests Compiler Plugin') {
// when { expression { runTests } }
// steps {
// runCompilerPluginTest()
// }
// }
// stage('Tests macOS - Unit Tests') {
// when { expression { runTests } }
// steps {
// testAndCollect("packages", "cleanAllTests macosTest -PincludeTestModules=false")
// }
// }
// stage('Tests Android - Unit Tests') {
// when { expression { runTests } }
// steps {
// withLogcatTrace(
// "unittest",
// {
// testAndCollect("packages", "cleanAllTests connectedAndroidTest -PincludeTestModules=false")
// }
// )
// }
// }
// stage('Integration Tests - Android') {
// when { expression { runTests } }
// steps {
// testWithServer([
// {
// withLogcatTrace(
// "integrationtest",
// {
// forwardAdbPorts()
// testAndCollect("packages", "cleanAllTests -PsyncUsePlatformNetworking=true -PincludeSdkModules=false connectedAndroidTest")
// }
// )
// }
// ])
// }
// }
// stage('Integration Tests - macOS - New memory model') {
// when { expression { runTests } }
// steps {
// testWithServer([
// // This will overwrite previous test results, but should be ok as we would not get here
// // if previous stages failed.
// {
// testAndCollect("packages", "cleanAllTests macosTest -PincludeSdkModules=false")
// },
// ])
// }
// }
// stage('Tests JVM') {
// when { expression { runTests } }
// steps {
// testWithServer([
// {
// testAndCollect("packages", 'cleanAllTests jvmTest -PsyncUsePlatformNetworking=true -PincludeSdkModules=false ')
// }
// ])
// }
// }
// stage('Integration Tests - iOS') {
// when { expression { runTests } }
// steps {
// testWithServer([
// {
// testAndCollect("packages", "cleanAllTests iosTest -PincludeSdkModules=false")
// }
// ])
// }
// }
// stage('Minified Sync Tests - Android') {
// when { expression { runTests } }
// steps {
// testWithServer([
// {
// testAndCollect("packages", 'cleanAllTests :test-sync:connectedAndroidtest -PsyncUsePlatformNetworking=true -PincludeSdkModules=false -PtestBuildType=debugMinified')
// }
// ])
// sh 'rm mapping.zip || true'
// zip([
// 'zipFile': 'mapping.zip',
// 'archive': true,
// 'glob': 'packages/test-sync/build/outputs/mapping/debugMinified/mapping.txt'
// ])
// }
// }
// stage('Gradle Plugin Integration Tests') {
// when { expression { runTests } }
// steps {
// testAndCollect("integration-tests/gradle/current", "integrationTest")
// testAndCollect("integration-tests/gradle/current", "-Pkotlin.experimental.tryK2=true integrationTest")
// testAndCollect("integration-tests/gradle/gradle6-test", "integrationTest")
// testAndCollect("integration-tests/gradle/gradle71-test", "integrationTest")
// testAndCollect("integration-tests/gradle/gradle75-test", "integrationTest")
// withEnv(["JAVA_HOME=${JAVA_17}"]) {
// testAndCollect("integration-tests/gradle/gradle8-test", "integrationTest")
// testAndCollect("integration-tests/gradle/gradle85-test", "integrationTest")
// }
// }
// }
// stage('Tests Android Sample App') {
// when { expression { runTests } }
// steps {
// catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
// runMonkey()
// }
// runAndroidUnitTestsOnJvm()
// }
// }
// stage('Build Android on minimum versions') {
// when { expression { runTests } }
// steps {
// runBuildMinAndroidApp()
// }
// }
// stage('Test Realm Java Compatibility App') {
// when { expression { runTests } }
// steps {
// testAndCollect("examples/realm-java-compatibility", "connectedAndroidTest")
// testAndCollect("examples/realm-java-compatibility", "-Pkotlin.experimental.tryK2=true connectedAndroidTest")
// }
// }
// stage('Track build metrics') {
// when { expression { currentBranch == "main" } }
// steps {
// trackBuildMetrics(version)
// }
// }
stage('Publish SNAPSHOT to Maven Central') {
when { expression { shouldPublishSnapshot(version) } }
steps {
runPublishSnapshotToMavenCentral()
}
}
stage('Publish Release to Maven Central') {
when { expression { publishBuild } }
steps {
runPublishReleaseOnMavenCentral()
}
}
// stage('Publish Release to Maven Central') {
// when { expression { publishBuild } }
// steps {
// runPublishReleaseOnMavenCentral()
// }
// }
}
}
}
Expand Down Expand Up @@ -682,12 +683,12 @@ def startEmulatorInBgIfNeeded() {
}

boolean shouldPublishSnapshot(version) {
if (!releaseBranches.contains(currentBranch)) {
return false
}
if (version == null || !version.endsWith("-SNAPSHOT")) {
return false
}
// if (!releaseBranches.contains(currentBranch)) {
// return false
// }
// if (version == null || !version.endsWith("-SNAPSHOT")) {
// return false
// }
return true
}

Expand Down Expand Up @@ -716,7 +717,8 @@ def runCommand(String command){
}

def shouldBuildJvmABIs() {
if (publishBuild || shouldPublishSnapshot(version)) return true else return false
//if (publishBuild || shouldPublishSnapshot(version)) return true else return false
return true
}

def build_jvm_linux(String buildType) {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ val HOST_OS: OperatingSystem = findHostOs()

object Realm {
val ciBuild = (System.getenv("JENKINS_HOME") != null || System.getenv("CI") != null)
const val version = "1.14.0-SNAPSHOT"
const val version = "1.14.0-ENCRYPTION-POC-SNAPSHOT"
const val group = "io.realm.kotlin"
const val projectUrl = "https://realm.io"
const val pluginPortalId = "io.realm.kotlin"
Expand Down
Loading