diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index eaa23500bf..0000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,615 +0,0 @@ -variables: - CURRENT_STAGING: staging-42 - APP: 'browser-sdk' - CURRENT_CI_IMAGE: 91 - BUILD_STABLE_REGISTRY: 'registry.ddbuild.io' - CI_IMAGE: '$BUILD_STABLE_REGISTRY/ci/$APP:$CURRENT_CI_IMAGE' - GIT_REPOSITORY: 'git@github.com:DataDog/browser-sdk.git' - MAIN_BRANCH: 'main' - NEXT_MAJOR_BRANCH: '' - CHROME_PACKAGE_VERSION: 139.0.7258.66-1 - FF_TIMESTAMPS: 'true' # Enable timestamps for gitlab-ci logs - -cache: - key: - files: - - yarn.lock - paths: - - .yarn/cache - -stages: - - task - - ci-image - - test - - after-tests - - browserstack - - pre-deploy - - deploy:canary - - notify:canary - - deploy - - notify - -.base-configuration: - tags: - - 'arch:amd64' - image: $CI_IMAGE - id_tokens: - DDOCTOSTS_ID_TOKEN: - aud: dd-octo-sts - retry: - max: 2 - when: - - runner_system_failure - -######################################################################################################################## -# Branch selection helpers -######################################################################################################################## - -.test-allowed-branches: - except: - refs: - - /^release\// - - schedules - -.bs-allowed-branches: - except: - refs: - - main - - /^mq-working-branch-staging-[0-9]+-[a-z0-9]+$/ - - /^staging-[0-9]+$/ - - /^release\// - - schedules - -.feature-branches: - except: - refs: - - main - - tags - - /^staging-[0-9]+$/ - - /^release\// - - schedules - variables: - - $CI_COMMIT_REF_NAME == $NEXT_MAJOR_BRANCH - -.next-major-branch: - only: - variables: - - $CI_COMMIT_REF_NAME == $NEXT_MAJOR_BRANCH - -.staging: - only: - variables: - - $CI_COMMIT_REF_NAME == $CURRENT_STAGING - -.main: - only: - refs: - - main - except: - refs: - - schedules - variables: - - $CI_COMMIT_TITLE =~ /^v[0-9.]+/ - -.tags: - only: - refs: - - tags - -########################################################################################################################### -# Resource allocation -########################################################################################################################### -.resource-allocation-4-cpus: - variables: - WORKERS: 2 - KUBERNETES_CPU_REQUEST: 4 - KUBERNETES_CPU_LIMIT: 4 - KUBERNETES_MEMORY_REQUEST: 16Gi - KUBERNETES_MEMORY_LIMIT: 16Gi - NODE_OPTIONS: '--max-old-space-size=16000' - -######################################################################################################################## -# CI image -######################################################################################################################## - -ci-image: - stage: ci-image - extends: - - .base-configuration - - .feature-branches - when: manual - tags: ['runner:docker', 'size:large'] - image: $BUILD_STABLE_REGISTRY/docker:18.03.1 - script: - - docker build --build-arg CHROME_PACKAGE_VERSION=$CHROME_PACKAGE_VERSION --tag $CI_IMAGE . - - docker push $CI_IMAGE - -######################################################################################################################## -# Tests -######################################################################################################################## - -format: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - yarn format - -woke: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - yarn woke - -typecheck: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - yarn build - - yarn typecheck - - scripts/cli typecheck test/apps/vanilla - - scripts/cli typecheck test/e2e - -build-and-lint: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - yarn build - - yarn lint - - node scripts/check-packages.ts - -test-performance: - extends: - - .base-configuration - - .test-allowed-branches - except: - variables: - - $CI_COMMIT_REF_NAME == $CURRENT_STAGING - interruptible: true - allow_failure: true - script: - - yarn - - yarn build:bundle - - node ./scripts/deploy/deploy.ts staging pull-request pull-request - - node ./scripts/performance/index.ts - -build-bundle: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - yarn build:bundle - -compatibility: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - yarn test:compat:tsc - - yarn test:compat:ssr - -unit: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - artifacts: - reports: - junit: test-report/unit/*.xml - script: - - yarn - - yarn test:unit - after_script: - - node ./scripts/test/export-test-result.ts unit - -e2e: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - artifacts: - when: always - reports: - junit: test-report/e2e/*.xml - script: - - yarn - - FORCE_COLOR=1 yarn test:e2e:ci - after_script: - - node ./scripts/test/export-test-result.ts e2e - -check-licenses: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - node scripts/check-licenses.ts - -check-node-version: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - node scripts/check-node-version.ts - -check-release: - extends: - - .base-configuration - - .tags - interruptible: true - script: - - yarn - - BUILD_MODE=release yarn build - - node scripts/release/check-release.ts - -check-schemas: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - node scripts/check-schemas.ts - -unit-bs: - stage: browserstack - needs: ['unit'] - extends: - - .base-configuration - - .bs-allowed-branches - interruptible: true - resource_group: browserstack - artifacts: - reports: - junit: test-report/unit-bs/*.xml - script: - - yarn - - ./scripts/test/ci-bs.sh test:unit - after_script: - - node ./scripts/test/export-test-result.ts unit-bs - -e2e-bs: - stage: browserstack - needs: ['e2e'] - extends: - - .base-configuration - - .bs-allowed-branches - - .resource-allocation-4-cpus - interruptible: true - resource_group: browserstack - timeout: 35 minutes - artifacts: - when: always - reports: - junit: test-report/e2e-bs/*.xml - script: - - yarn - - FORCE_COLOR=1 ./scripts/test/ci-bs.sh test:e2e:ci - after_script: - - node ./scripts/test/export-test-result.ts e2e-bs - -script-tests: - extends: - - .base-configuration - - .test-allowed-branches - interruptible: true - script: - - yarn - - yarn build:bundle - - yarn test:script -######################################################################################################################## -# Deploy -######################################################################################################################## - -deploy-feature: - stage: deploy - when: manual - variables: - SUFFIX: 'my-feature' #/datadog-[product]-${SUFFIX}.js - extends: - - .base-configuration - - .feature-branches - script: - - export BUILD_MODE=canary - - yarn - - yarn build:bundle - - node ./scripts/deploy/deploy.ts staging $SUFFIX root - -deploy-staging: - stage: deploy - extends: - - .base-configuration - - .staging - script: - - export BUILD_MODE=canary - - yarn - - yarn build:bundle - - node ./scripts/deploy/deploy.ts staging staging root - - node ./scripts/deploy/upload-source-maps.ts staging root - -deploy-prod-canary: - stage: deploy:canary - extends: - - .base-configuration - - .main - script: - - export BUILD_MODE=canary - - yarn - - yarn build:bundle - - node ./scripts/deploy/deploy.ts prod canary root - - node ./scripts/deploy/upload-source-maps.ts canary root - -deploy-next-major-canary: - stage: deploy - extends: - - .base-configuration - - .next-major-branch - script: - - export BUILD_MODE=canary - - VERSION=$(node -p -e "require('./lerna.json').version") - - yarn - - yarn build:bundle - - node ./scripts/deploy/deploy.ts prod v${VERSION%%.*}-canary root - - node ./scripts/deploy/upload-source-maps.ts v${VERSION%%.*}-canary root - -deploy-manual: - stage: deploy - extends: - - .tags - trigger: - include: - - local: .gitlab/deploy-manual.yml - -deploy-auto: - stage: deploy - extends: - - .tags - trigger: - include: - - local: .gitlab/deploy-auto.yml - -######################################################################################################################## -# Notify -######################################################################################################################## - -include: 'https://gitlab-templates.ddbuild.io/slack-notifier/v3-sdm/template.yml' - -notify-feature-branch-failure: - extends: - - .slack-notifier.on-failure - - .feature-branches - -.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-staging-failure: - extends: - - .prepare_notification - - .staging - when: on_failure - script: - - 'MESSAGE_TEXT=":host-red: $CI_PROJECT_NAME main pipeline for <$BUILD_URL|$COMMIT_MESSAGE> failed."' - - postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT" - -notify-prod-canary-success: - stage: notify:canary - extends: - - .prepare_notification - - .main - script: - - 'MESSAGE_TEXT=":rocket: $CI_PROJECT_NAME <$COMMIT_URL|$COMMIT_MESSAGE> deployed to :datadog:."' - - postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT" - - postmessage "#rum-browser-sdk-ops" "$MESSAGE_TEXT" - -notify-prod-canary-failure: - stage: notify:canary - extends: - - .prepare_notification - - .main - 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 -######################################################################################################################## - -staging-reset-scheduled: - stage: task - extends: .base-configuration - only: - variables: - - $TARGET_TASK_NAME == "staging-reset-scheduled" - before_script: - - eval $(ssh-agent -s) - script: - - yarn - - node scripts/staging-ci/staging-reset.ts - artifacts: - reports: - dotenv: build.env - -staging-reset-scheduled-success: - extends: .prepare_notification - only: - variables: - - $TARGET_TASK_NAME == "staging-reset-scheduled" - script: - - 'MESSAGE_TEXT=":white_check_mark: [*$CI_PROJECT_NAME*] Staging has been reset from *${CURRENT_STAGING}* to *${NEW_STAGING}* on pipeline <$BUILD_URL|$COMMIT_MESSAGE>."' - - postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT" - dependencies: - - staging-reset-scheduled - -staging-reset-scheduled-failure: - extends: .prepare_notification - only: - variables: - - $TARGET_TASK_NAME == "staging-reset-scheduled" - when: on_failure - script: - - 'MESSAGE_TEXT=":x: [*$CI_PROJECT_NAME*] Staging failed to reset from *${CURRENT_STAGING}* to *${NEW_STAGING}* on pipeline <$BUILD_URL|$COMMIT_MESSAGE>."' - - postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT" - dependencies: - - staging-reset-scheduled - -merge-into-staging: - stage: pre-deploy - allow_failure: true - extends: - - .base-configuration - - .main - before_script: - - eval $(ssh-agent -s) - script: - - yarn - - node scripts/update-branch.ts $CURRENT_STAGING - -merge-into-next-major: - stage: pre-deploy - allow_failure: true - extends: - - .base-configuration - only: - refs: - - main - variables: - - $NEXT_MAJOR_BRANCH - except: - refs: - - schedules - before_script: - - eval $(ssh-agent -s) - script: - - yarn - - node scripts/update-branch.ts $NEXT_MAJOR_BRANCH - -check-staging-merge: - stage: test - extends: - - .base-configuration - - .feature-branches - interruptible: true - before_script: - - eval $(ssh-agent -s) - script: - - yarn - - node scripts/staging-ci/check-staging-merge.ts - -# A noop job that's used to signal to `to-staging` that it can merge to the -# staging branch, even though the pipeline is still running -tests-passed: - stage: after-tests - extends: - - .base-configuration - - .feature-branches - interruptible: true - script: - - 'true' - -# in after-tests to not block `to-staging` merge -check-squash-into-staging: - stage: after-tests - allow_failure: true - extends: - - .base-configuration - - .feature-branches - interruptible: true - before_script: - - eval $(ssh-agent -s) - script: - - yarn - - node scripts/staging-ci/check-squash-into-staging.ts - -######################################################################################################################## -# Bump e2e chrome version -######################################################################################################################## - -bump-chrome-version-scheduled: - stage: task - extends: .base-configuration - only: - variables: - - $TARGET_TASK_NAME == "bump-chrome-version-scheduled" - before_script: - - eval $(ssh-agent -s) - script: - - yarn - - node scripts/test/bump-chrome-version.ts - artifacts: - reports: - dotenv: build.env - -bump-chrome-version-scheduled-success: - extends: .prepare_notification - only: - variables: - - $TARGET_TASK_NAME == "bump-chrome-version-scheduled" - before_script: - - '[ -z "$BUMP_CHROME_PULL_REQUEST_URL" ] && exit' - script: - - 'MESSAGE_TEXT=":chrome: [*$CI_PROJECT_NAME*] New Chrome version available on <$BUMP_CHROME_PULL_REQUEST_URL|PR>."' - - postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT" - dependencies: - - bump-chrome-version-scheduled - -bump-chrome-version-scheduled-failure: - extends: .prepare_notification - only: - variables: - - $TARGET_TASK_NAME == "bump-chrome-version-scheduled" - when: on_failure - script: - - 'MESSAGE_TEXT=":x: [*$CI_PROJECT_NAME*] Chrome version bumped failed on pipeline <$BUILD_URL|$COMMIT_MESSAGE>."' - - postmessage "#browser-sdk-deploy" "$MESSAGE_TEXT" - dependencies: - - bump-chrome-version-scheduled - -######################################################################################################################## -# Check expired telemetry -######################################################################################################################## - -check-expired-telemetry-scheduled: - stage: task - extends: .base-configuration - only: - variables: - - $TARGET_TASK_NAME == "check-expired-telemetry" - script: - - yarn - - yarn build - - MONITOR_UNTIL_COMMENT_EXPIRED_LEVEL=error yarn lint - -check-expired-telemetry-scheduled-failure: - extends: .prepare_notification - only: - variables: - - $TARGET_TASK_NAME == "check-expired-telemetry" - when: on_failure - script: - - 'MESSAGE_TEXT=":fire: [*$CI_PROJECT_NAME*] <$BUILD_URL|Expired telemetry detected> :fire:"' - - postmessage "#rum-browser-sdk-ops" "$MESSAGE_TEXT" - dependencies: - - check-expired-telemetry-scheduled diff --git a/packages/core/src/domain/configuration/configuration.ts b/packages/core/src/domain/configuration/configuration.ts index 258f928ed3..3f40fbac2e 100644 --- a/packages/core/src/domain/configuration/configuration.ts +++ b/packages/core/src/domain/configuration/configuration.ts @@ -306,6 +306,7 @@ export interface Configuration extends TransportConfiguration { // Built from init configuration beforeSend: GenericBeforeSendCallback | undefined sessionStoreStrategyType: SessionStoreStrategyType | undefined + usePartitionedCrossSiteSessionCookie: boolean sessionSampleRate: number telemetrySampleRate: number telemetryConfigurationSampleRate: number @@ -401,6 +402,7 @@ export function validateAndBuildConfiguration( beforeSend: initConfiguration.beforeSend && catchUserErrors(initConfiguration.beforeSend, 'beforeSend threw an error:'), sessionStoreStrategyType: isWorkerEnvironment ? undefined : selectSessionStoreStrategyType(initConfiguration), + usePartitionedCrossSiteSessionCookie: initConfiguration.usePartitionedCrossSiteSessionCookie ?? false, sessionSampleRate: initConfiguration.sessionSampleRate ?? 100, telemetrySampleRate: initConfiguration.telemetrySampleRate ?? 20, telemetryConfigurationSampleRate: initConfiguration.telemetryConfigurationSampleRate ?? 5, diff --git a/packages/rum-core/src/domain/action/getActionNameFromElement.spec.ts b/packages/rum-core/src/domain/action/getActionNameFromElement.spec.ts index bc08b483e5..2f1446e960 100644 --- a/packages/rum-core/src/domain/action/getActionNameFromElement.spec.ts +++ b/packages/rum-core/src/domain/action/getActionNameFromElement.spec.ts @@ -643,6 +643,16 @@ describe('getActionNameFromElement', () => { expectedName: 'foo bar baz', expectedNameSource: 'text_content', }, + { + html: ` +