feat(supabase): add tracing integration #20556
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Platform | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master, mq-working-branch-master-*] | |
| schedule: | |
| - cron: 0 4 * * * | |
| workflow_dispatch: | |
| inputs: | |
| latest-version: | |
| description: "Node version to use" | |
| required: false | |
| type: string | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ inputs.latest-version }}-${{ github.ref == 'refs/heads/master' && github.run_id || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| LATEST_VERSION: ${{ inputs.latest-version }} | |
| # TODO: upstream jobs | |
| jobs: | |
| package-manager: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| manager: | |
| - name: npm | |
| install: npm install | |
| - name: pnpm | |
| install: >- | |
| pnpm | |
| --allow-build=@datadog/native-appsec | |
| --allow-build=@datadog/native-iast-taint-tracking | |
| --allow-build=@datadog/native-metrics | |
| --allow-build=@datadog/pprof | |
| --allow-build=dd-trace | |
| add | |
| - name: yarn | |
| install: yarn add | |
| - name: yarn-berry | |
| install: >- | |
| (command -v corepack >/dev/null 2>&1 || npm install -g corepack) | |
| && yarn set version stable | |
| && yarn config set nodeLinker node-modules | |
| && yarn config set enableScripts true | |
| && yarn config set --json npmPreapprovedPackages '["@datadog/*","import-in-the-middle"]' | |
| && yarn add | |
| - name: bun | |
| install: bun add --linker=hoisted | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node/active-lts | |
| - uses: ./.github/actions/install | |
| - run: FILENAME=$(npm pack --silent --pack-destination /tmp) && mv "/tmp/$FILENAME" /tmp/dd-trace.tgz | |
| - run: mkdir -p /tmp/app | |
| - run: npm i -g pnpm | |
| if: matrix.manager.name == 'pnpm' | |
| - run: cd /tmp/app && ${{ matrix.manager.install }} /tmp/dd-trace.tgz | |
| - run: echo "require('dd-trace').init()" >> /tmp/app/index.js | |
| - run: node /tmp/app | |
| bun-pack: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node/active-lts | |
| - uses: ./.github/actions/install | |
| - run: mkdir npm bun | |
| - run: FILENAME=$(npm pack --silent) && tar -zxf "$FILENAME" -C npm | |
| - run: ./node_modules/.bin/bun pm pack --gzip-level 0 --filename bun.tgz && tar -zxf bun.tgz -C bun | |
| - run: diff -r npm bun | |
| bun-runtime: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node/active-lts | |
| - uses: ./.github/actions/install | |
| - run: npm run test:integration:bun | |
| - uses: ./.github/actions/upload-junit-artifacts | |
| if: always() | |
| with: | |
| id: ${{ github.job }} | |
| core: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node/oldest-maintenance-lts | |
| - uses: ./.github/actions/install | |
| - run: npm run test:core:ci | |
| - uses: ./.github/actions/node/latest | |
| - run: npm run test:core:ci | |
| - uses: ./.github/actions/coverage | |
| with: | |
| flags: platform-core | |
| - uses: ./.github/actions/upload-junit-artifacts | |
| if: "!cancelled()" | |
| with: | |
| id: ${{ github.job }} | |
| dd-trace-api: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| env: | |
| PLUGINS: dd-trace-api | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/plugins/test | |
| # TODO: Split this up as it runs tests for multiple different teams. | |
| integration: | |
| strategy: | |
| # when one version fails, say 14, all the other versions are stopped | |
| # setting fail-fast to false in an attempt to prevent this from happening | |
| fail-fast: false | |
| matrix: | |
| version: [oldest, maintenance, active, latest] | |
| name: ${{ github.workflow }} / integration (node-${{ matrix.version }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node | |
| with: | |
| version: ${{ matrix.version }} | |
| # Disable core dumps since some integration tests intentionally abort and core dump generation takes around 5-10s | |
| - uses: ./.github/actions/install | |
| - run: sudo sysctl -w kernel.core_pattern='|/bin/false' | |
| - run: npm run test:integration:coverage | |
| - uses: ./.github/actions/coverage | |
| with: | |
| flags: platform-integration-${{ matrix.version }} | |
| - uses: ./.github/actions/upload-junit-artifacts | |
| if: "!cancelled()" | |
| with: | |
| id: ${{ github.job }}-${{ strategy.job-index }} | |
| crashtracking: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [oldest, maintenance, active, latest] | |
| name: ${{ github.workflow }} / crashtracking (node-${{ matrix.version }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node | |
| with: | |
| version: ${{ matrix.version }} | |
| - uses: ./.github/actions/install | |
| # Disable core dumps since crashtracking tests intentionally abort | |
| - run: sudo sysctl -w kernel.core_pattern='|/bin/false' | |
| - run: npm run test:integration:crashtracking | |
| - uses: ./.github/actions/upload-junit-artifacts | |
| if: "!cancelled()" | |
| with: | |
| id: ${{ github.job }}-${{ strategy.job-index }} | |
| unit-guardrails: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node/latest | |
| - uses: ./.github/actions/install | |
| - run: npm run test:trace:guardrails:ci | |
| - uses: ./.github/actions/coverage | |
| with: | |
| flags: platform-unit-guardrails | |
| - uses: ./.github/actions/upload-junit-artifacts | |
| if: "!cancelled()" | |
| with: | |
| id: ${{ github.job }} | |
| # We'll run these separately for earlier (i.e. unsupported) versions | |
| integration-guardrails: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: [16.0.0, 18.0.0, 20.0.0, 22.0.0, 24.0.0, 25] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node/active-lts | |
| - uses: ./.github/actions/install | |
| - run: bun add --linker=hoisted --ignore-scripts mocha@10 # Use older mocha to support old Node.js versions | |
| - run: bun add --linker=hoisted --ignore-scripts express@4 # Use older express to support old Node.js versions | |
| - uses: ./.github/actions/node | |
| with: | |
| version: ${{ matrix.version }} | |
| - run: node node_modules/.bin/mocha --colors --timeout 30000 integration-tests/init.spec.js | |
| - uses: ./.github/actions/upload-junit-artifacts | |
| if: "!cancelled()" | |
| with: | |
| id: ${{ github.job }}-${{ strategy.job-index }} | |
| integration-guardrails-unsupported: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: | |
| ["0.8", "0.10", "0.12", "4", "6", "8", "10", "12", "14.0.0", "14"] | |
| runs-on: ubuntu-latest | |
| env: | |
| DD_TRACE_DEBUG: "true" # This exercises more of the guardrails code | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node | |
| with: | |
| version: ${{ matrix.version }} | |
| - run: node ./init | |
| - run: node ./init | |
| env: | |
| DD_INJECTION_ENABLED: "true" | |
| shimmer: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ./.github/actions/node/oldest-maintenance-lts | |
| - uses: ./.github/actions/install | |
| - run: npm run test:shimmer:ci | |
| - uses: ./.github/actions/node/latest | |
| - run: npm run test:shimmer:ci | |
| - uses: ./.github/actions/coverage | |
| with: | |
| flags: platform-shimmer | |
| - uses: ./.github/actions/upload-junit-artifacts | |
| if: "!cancelled()" | |
| with: | |
| id: ${{ github.job }} |