Skip to content

Commit

Permalink
Merge branch 'main' into congyao/RUM-3902-privacy-control-action-name
Browse files Browse the repository at this point in the history
  • Loading branch information
cy-moi committed Apr 29, 2024
2 parents 31ee24b + d1b0048 commit 18eaec5
Show file tree
Hide file tree
Showing 89 changed files with 1,516 additions and 819 deletions.
105 changes: 20 additions & 85 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
variables:
CURRENT_STAGING: staging-17
CURRENT_STAGING: staging-18
APP: 'browser-sdk'
CURRENT_CI_IMAGE: 63
CURRENT_CI_IMAGE: 64
BUILD_STABLE_REGISTRY: '486234852809.dkr.ecr.us-east-1.amazonaws.com'
CI_IMAGE: '$BUILD_STABLE_REGISTRY/ci/$APP:$CURRENT_CI_IMAGE'
GIT_REPOSITORY: '[email protected]:DataDog/browser-sdk.git'
MAIN_BRANCH: 'main'
CHROME_PACKAGE_VERSION: 123.0.6312.58-1
CHROME_PACKAGE_VERSION: 124.0.6367.60-1

cache:
key:
Expand All @@ -22,7 +22,6 @@ stages:
- after-tests
- browserstack
- pre-deploy
- pre-deploy-notify
- deploy:canary
- notify:canary
- deploy
Expand Down Expand Up @@ -202,6 +201,15 @@ e2e:
after_script:
- node ./scripts/test/export-test-result.js e2e

e2e-developer-extension:
extends:
- .base-configuration
- .test-allowed-branches
interruptible: true
script:
- yarn
- yarn test:e2e:developer-extension

check-licenses:
extends:
- .base-configuration
Expand Down Expand Up @@ -306,67 +314,21 @@ deploy-prod-canary:
- node ./scripts/deploy/deploy.js prod canary root
- node ./scripts/deploy/upload-source-maps.js canary root

.deploy-prod:
deploy-manual:
stage: deploy
extends:
- .base-configuration
- .tags
when: manual
allow_failure: false
script:
- export BUILD_MODE=release
- VERSION=$(node -p -e "require('./lerna.json').version")
- yarn
- yarn build:bundle
- node ./scripts/deploy/check-monitors.js $UPLOAD_PATH
- node ./scripts/deploy/deploy.js prod v${VERSION%%.*} $UPLOAD_PATH
- node ./scripts/deploy/upload-source-maps.js v${VERSION%%.*} $UPLOAD_PATH

step-1_deploy-prod-minor-dcs:
extends:
- .deploy-prod
variables:
UPLOAD_PATH: us3,us5,ap1
trigger:
include:
- local: .gitlab/deploy-manual.yml

step-2_deploy-prod-eu1:
extends:
- .deploy-prod
variables:
UPLOAD_PATH: eu1

step-3_deploy-prod-us1:
extends:
- .deploy-prod
variables:
UPLOAD_PATH: us1

step-4_deploy-prod-gov:
extends:
- .deploy-prod
variables:
UPLOAD_PATH: root

step-5_publish-npm:
deploy-auto:
stage: deploy
extends:
- .base-configuration
- .tags
when: manual
allow_failure: false
script:
- yarn
- node ./scripts/deploy/publish-npm.js

step-6_publish-developer-extension:
stage: deploy
extends:
- .base-configuration
- .tags
when: manual
allow_failure: false
script:
- yarn
- node ./scripts/deploy/publish-developer-extension.js
trigger:
include:
- local: .gitlab/deploy-auto.yml

########################################################################################################################
# Notify
Expand Down Expand Up @@ -395,15 +357,6 @@ notify-staging-failure:
- 'MESSAGE_TEXT=":host-red: $CI_PROJECT_NAME main pipeline for <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"

notify-release-ready:
stage: pre-deploy-notify
extends:
- .prepare_notification
- .tags
script:
- 'MESSAGE_TEXT=":i: $CI_PROJECT_NAME <$BUILD_URL|$COMMIT_MESSAGE> ready to be deployed to :datadog:"'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"

notify-prod-canary-success:
stage: notify:canary
extends:
Expand All @@ -424,24 +377,6 @@ notify-prod-canary-failure:
- 'MESSAGE_TEXT=":host-red: $CI_PROJECT_NAME release pipeline <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"

notify-prod-stable-success:
extends:
- .prepare_notification
- .tags
script:
- 'MESSAGE_TEXT=":rocket: $CI_PROJECT_NAME <$COMMIT_URL|$COMMIT_MESSAGE> deployed to :earth_americas:."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"
- postmessage "#rum-browser-sdk-ops" "$MESSAGE_TEXT"

notify-prod-stable-failure:
extends:
- .prepare_notification
- .tags
when: on_failure
script:
- 'MESSAGE_TEXT=":host-red: $CI_PROJECT_NAME release pipeline <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"

########################################################################################################################
# To staging CI
########################################################################################################################
Expand Down
116 changes: 116 additions & 0 deletions .gitlab/deploy-auto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
stages:
- pre-notify
- deploy
- post-notify

.base-configuration:
tags: ['runner:main', 'size:large']
image: $CI_IMAGE

.deploy-prod:
stage: deploy
script:
- export BUILD_MODE=release
- VERSION=$(node -p -e "require('./lerna.json').version")
- yarn
- yarn build:bundle
- node ./scripts/deploy/deploy-prod-dc.js v${VERSION%%.*} $UPLOAD_PATH true

step-1_deploy-prod-minor-dcs:
when: manual
allow_failure: false
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: us3,us5,ap1

step-2_deploy-prod-eu1:
needs:
- step-1_deploy-prod-minor-dcs
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: eu1

step-3_deploy-prod-us1:
needs:
- step-2_deploy-prod-eu1
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: us1

step-4_deploy-prod-gov:
needs:
- step-3_deploy-prod-us1
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: root

step-5_publish-npm:
needs:
- step-4_deploy-prod-gov
stage: deploy
extends:
- .base-configuration
allow_failure: false
script:
- yarn
- node ./scripts/deploy/publish-npm.js

step-6_publish-developer-extension:
needs:
- step-5_publish-npm
stage: deploy
extends:
- .base-configuration
allow_failure: false
script:
- yarn
- node ./scripts/deploy/publish-developer-extension.js

########################################################################################################################
# Notify
########################################################################################################################

include: 'https://gitlab-templates.ddbuild.io/slack-notifier/v1/template.yml'

.prepare_notification:
extends: .slack-notifier-base
before_script:
- COMMIT_MESSAGE=`git show-branch --no-name HEAD`
- BUILD_URL="$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID"
- COMMIT_URL="$CI_PROJECT_URL/commits/$CI_COMMIT_SHA"

notify-deploy-ready:
stage: pre-notify
extends:
- .prepare_notification
script:
- 'MESSAGE_TEXT=":i: $CI_PROJECT_NAME <$BUILD_URL|$COMMIT_MESSAGE> ready to be deployed *automatically* to :datadog:"'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"

notify-deploy-success:
stage: post-notify
needs:
- step-6_publish-developer-extension
extends:
- .prepare_notification
script:
- 'MESSAGE_TEXT=":rocket: $CI_PROJECT_NAME <$COMMIT_URL|$COMMIT_MESSAGE> *automatically* deployed to :earth_americas:."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"
- postmessage "#rum-browser-sdk-ops" "$MESSAGE_TEXT"

notify-deploy-failure:
stage: post-notify
extends:
- .prepare_notification
when: on_failure
script:
- 'MESSAGE_TEXT=":host-red: $CI_PROJECT_NAME *automatic* deployment of <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"
106 changes: 106 additions & 0 deletions .gitlab/deploy-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
stages:
- pre-notify
- deploy
- post-notify

.base-configuration:
tags: ['runner:main', 'size:large']
image: $CI_IMAGE

.deploy-prod:
stage: deploy
when: manual
allow_failure: false
script:
- export BUILD_MODE=release
- VERSION=$(node -p -e "require('./lerna.json').version")
- yarn
- yarn build:bundle
- node ./scripts/deploy/deploy-prod-dc.js v${VERSION%%.*} $UPLOAD_PATH false

step-1_deploy-prod-minor-dcs:
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: us3,us5,ap1

step-2_deploy-prod-eu1:
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: eu1

step-3_deploy-prod-us1:
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: us1

step-4_deploy-prod-gov:
extends:
- .base-configuration
- .deploy-prod
variables:
UPLOAD_PATH: root

step-5_publish-npm:
stage: deploy
extends:
- .base-configuration
when: manual
allow_failure: false
script:
- yarn
- node ./scripts/deploy/publish-npm.js

step-6_publish-developer-extension:
stage: deploy
extends:
- .base-configuration
when: manual
allow_failure: false
script:
- yarn
- node ./scripts/deploy/publish-developer-extension.js

########################################################################################################################
# Notify
########################################################################################################################

include: 'https://gitlab-templates.ddbuild.io/slack-notifier/v1/template.yml'

.prepare_notification:
extends: .slack-notifier-base
before_script:
- COMMIT_MESSAGE=`git show-branch --no-name HEAD`
- BUILD_URL="$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID"
- COMMIT_URL="$CI_PROJECT_URL/commits/$CI_COMMIT_SHA"

notify-deploy-ready:
stage: pre-notify
extends:
- .prepare_notification
script:
- 'MESSAGE_TEXT=":i: $CI_PROJECT_NAME <$BUILD_URL|$COMMIT_MESSAGE> ready to be deployed *manually* to :datadog:"'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"

notify-deploy-success:
stage: post-notify
extends:
- .prepare_notification
script:
- 'MESSAGE_TEXT=":rocket: $CI_PROJECT_NAME <$COMMIT_URL|$COMMIT_MESSAGE> *manually* deployed to :earth_americas:."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"
- postmessage "#rum-browser-sdk-ops" "$MESSAGE_TEXT"

notify-deploy-failure:
stage: post-notify
extends:
- .prepare_notification
when: on_failure
script:
- 'MESSAGE_TEXT=":host-red: $CI_PROJECT_NAME *manual* deployment of <$BUILD_URL|$COMMIT_MESSAGE> failed."'
- postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT"
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
---

## v5.16.0

-[RUM-3684] Capture scroll record on shadow dom elements ([#2708](https://github.com/DataDog/browser-sdk/pull/2708))
-[RUM-3798] Report the cpu impact as a pr comment ([#2702](https://github.com/DataDog/browser-sdk/pull/2702))
-[RUM-162] Truncate resources URL containing data URLs ([#2690](https://github.com/DataDog/browser-sdk/pull/2690))
- 🐛[RUM-4109] Mask iframe srcdoc with privacy override ([#2714](https://github.com/DataDog/browser-sdk/pull/2714))
-[RUM-2782] Validate resource timings more granularly

## v5.15.0

- 🐛 fix beforeSend type definition for logs ([#2686](https://github.com/DataDog/browser-sdk/pull/2686))
Expand Down
Loading

0 comments on commit 18eaec5

Please sign in to comment.