Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object AndroidConfig {
const val MIN_SDK_FOR_AUTO = 29
const val BUILD_TOOLS_VERSION = "36.0.0"

val VERSION = Version(3, 11, 0, Version.Type.Snapshot)
val VERSION = Version(3, 11, 0, Version.Type.Snapshot())
}

// TODO RUM-628 Switch to Java 17 bytecode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ data class Version(
override val suffix: String = "-dev"
}

object Snapshot : Type() {
override val suffix: String = "-SNAPSHOT"
data class Snapshot(val label: String? = null) : Type() {
override val suffix: String =
if (label.isNullOrEmpty()) "-SNAPSHOT" else "-$label-SNAPSHOT"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,28 @@ class VersionTest {
@Test
fun addSuffixForSnapshot() {
// When
val name = Version(4, 11, 5, Version.Type.Snapshot).name
val name = Version(4, 11, 5, Version.Type.Snapshot()).name

// Then
val expected = "4.11.5-SNAPSHOT"
assertThat(name).isEqualTo(expected)
}

@Test
fun `M return labeled snapshot suffix W Snapshot with label`() {
// When
val name = Version(1, 2, 3, Version.Type.Snapshot("dogfooding")).name

// Then
assertThat(name).isEqualTo("1.2.3-dogfooding-SNAPSHOT")
}

@Test
fun `M return plain snapshot suffix W Snapshot with empty label`() {
// When
val name = Version(1, 2, 3, Version.Type.Snapshot("")).name

// Then
assertThat(name).isEqualTo("1.2.3-SNAPSHOT")
}
}
71 changes: 66 additions & 5 deletions ci/pipelines/default-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,17 @@ stages:
- cache/notifications/
policy: pull

# Skip all standard jobs on the dogfooding branch — only the manual publish runs there.
.except-dogfooding-branch:
except:
- dogfooding

# CI IMAGE

ci-image:
stage: ci-image
when: manual
except: [ tags, schedules ]
except: [ tags, schedules, dogfooding ]
tags: [ "arch:amd64" ]
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:24.0.4-jammy
script:
Expand All @@ -106,6 +111,8 @@ ci-image:
# SECURITY

create_key:
extends:
- .except-dogfooding-branch
stage: security
when: manual
tags: [ "arch:amd64" ]
Expand All @@ -124,6 +131,8 @@ create_key:
# STATIC ANALYSIS

static-analysis:
extends:
- .except-dogfooding-branch
stage: analysis
variables:
DETEKT_PUBLIC_API: "true"
Expand All @@ -137,6 +146,7 @@ static-analysis:
analysis:detekt-custom:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags:
- "arch:amd64"
image: $CI_IMAGE_DOCKER
Expand All @@ -157,6 +167,7 @@ analysis:detekt-custom:
test:debug:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test
Expand All @@ -178,6 +189,7 @@ test:debug:
test:tools:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test
Expand All @@ -188,6 +200,8 @@ test:tools:
- GRADLE_OPTS="-Xmx3072m" ./gradlew :unitTestTools --stacktrace --no-daemon --build-cache --gradle-user-home cache/

test:kover:
extends:
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test
Expand Down Expand Up @@ -224,6 +238,7 @@ test:kover:
test-pyramid:core-it-min-api:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
Expand All @@ -239,6 +254,7 @@ test-pyramid:core-it-min-api:
test-pyramid:core-it-latest-api:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
Expand All @@ -254,6 +270,7 @@ test-pyramid:core-it-latest-api:
test-pyramid:core-it-median-api:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
Expand All @@ -269,6 +286,7 @@ test-pyramid:core-it-median-api:
test-pyramid:single-fit-logs:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand All @@ -286,6 +304,7 @@ test-pyramid:single-fit-logs:
test-pyramid:single-fit-rum:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand All @@ -303,6 +322,7 @@ test-pyramid:single-fit-rum:
test-pyramid:single-fit-trace:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand All @@ -320,6 +340,7 @@ test-pyramid:single-fit-trace:
test-pyramid:single-fit-okhttp:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand All @@ -339,6 +360,7 @@ test-pyramid:single-fit-okhttp:
test-pyramid:legacy-integration-instrumented-min-api:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
Expand All @@ -354,6 +376,7 @@ test-pyramid:legacy-integration-instrumented-min-api:
test-pyramid:legacy-integration-instrumented-latest-api:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
Expand All @@ -369,6 +392,7 @@ test-pyramid:legacy-integration-instrumented-latest-api:
test-pyramid:legacy-integration-instrumented-median-api:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If most of the jobs are disabled in the dogfooding branch, we could create a dedicated yaml for its CI and route to it like this.

However I'm not sure that we need to skip our usual tests in the dogfooding branch. It is more-or-less the same situation as the develop branch.

tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
Expand All @@ -384,6 +408,7 @@ test-pyramid:legacy-integration-instrumented-median-api:
test-pyramid:ndk-instrumented-latest-api:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
Expand All @@ -399,6 +424,7 @@ test-pyramid:ndk-instrumented-latest-api:
test-pyramid:detekt-api-coverage:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand All @@ -419,6 +445,7 @@ test-pyramid:detekt-api-coverage:
test-pyramid:publish-e2e-synthetics:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand Down Expand Up @@ -449,6 +476,7 @@ test-pyramid:publish-e2e-synthetics:
test-pyramid:publish-webview-synthetics:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand Down Expand Up @@ -479,6 +507,7 @@ test-pyramid:publish-webview-synthetics:
test-pyramid:publish-staging-synthetics:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand Down Expand Up @@ -509,6 +538,7 @@ test-pyramid:publish-staging-synthetics:
test-pyramid:publish-benchmark-synthetics:
extends:
- .base-cache-pull-job
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test-pyramid
Expand Down Expand Up @@ -539,6 +569,8 @@ test-pyramid:publish-benchmark-synthetics:
# PUBLISH ARTIFACTS ON MAVEN

publish:release-all:
extends:
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
only:
- tags
Expand All @@ -555,11 +587,26 @@ publish:release-all:
paths:
- "**/verification-metadata.xml"

publish:snapshot-dogfooding:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the develop branch we use the publish:release-all job. Why can't we reuse it here?

tags: [ "arch:amd64" ]
only:
- dogfooding
image: $CI_IMAGE_DOCKER
stage: publish
timeout: 30m
when: manual
script:
- !reference [.snippets, set-publishing-credentials]
# SNAPSHOT versions are published directly to the Sonatype SNAPSHOT repository
# and do not require staging/closing — only release artifacts need that step.
- ./gradlew publishToSonatype --stacktrace --no-daemon

# SLACK NOTIFICATIONS

notify:publish-develop-success:
extends: .slack-notifier-base
extends:
- .slack-notifier-base
- .except-dogfooding-branch
stage: notify
when: on_success
only:
Expand All @@ -569,7 +616,9 @@ notify:publish-develop-success:
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"

notify:publish-develop-failure:
extends: .slack-notifier-base
extends:
- .slack-notifier-base
- .except-dogfooding-branch
stage: notify
when: on_failure
only:
Expand All @@ -580,7 +629,9 @@ notify:publish-develop-failure:
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"

notify:publish-release-success:
extends: .slack-notifier-base
extends:
- .slack-notifier-base
- .except-dogfooding-branch
stage: notify
when: on_success
only:
Expand All @@ -591,7 +642,9 @@ notify:publish-release-success:
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"

notify:publish-release-failure:
extends: .slack-notifier-base
extends:
- .slack-notifier-base
- .except-dogfooding-branch
stage: notify
when: on_failure
only:
Expand All @@ -602,6 +655,8 @@ notify:publish-release-failure:
- postmessage "#mobile-sdk-ops" "$MESSAGE_TEXT"

notify:dogfood-app:
extends:
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
only:
- tags
Expand All @@ -617,6 +672,8 @@ notify:dogfood-app:
- python3 ./ci/scripts/dogfood.py -v $CI_COMMIT_TAG -t app

notify:dogfood-demo:
extends:
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
only:
- tags
Expand All @@ -632,6 +689,8 @@ notify:dogfood-demo:
- python3 ./ci/scripts/dogfood.py -v $CI_COMMIT_TAG -t demo

notify:dogfood-gradle-plugin:
extends:
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
only:
- tags
Expand All @@ -647,6 +706,8 @@ notify:dogfood-gradle-plugin:
- python3 ./ci/scripts/dogfood.py -v $CI_COMMIT_TAG -t gradle-plugin

notify:merge-verification-metadata:
extends:
- .except-dogfooding-branch
tags: [ "arch:amd64" ]
only:
- tags
Expand Down
Loading
Loading