Skip to content

GTM destination: clear self-loaded keys with undefined incl. event #1081

GTM destination: clear self-loaded keys with undefined incl. event

GTM destination: clear self-loaded keys with undefined incl. event #1081

Workflow file for this run

name: 🧪Lint and Test
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [newjitsu]
workflow_dispatch:
env:
# The jitsu-builder container has Playwright browsers binaries preinstalled on this path:
PLAYWRIGHT_BROWSERS_PATH: /root/.cache/ms-playwright
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-format:
name: ✨ Lint & Test
timeout-minutes: 20
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: 📥 Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: 🔍 Check changed files
id: changes
uses: dorny/paths-filter@v4
with:
filters: |
playwright:
- 'libs/jitsu-js/**'
- '**/playwright/**'
- '**/*.spec.ts'
- '**/playwright.config.ts'
nodejs:
- 'cli/**'
- 'libs/**'
- 'services/**'
- 'types/**'
- 'webapps/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- name: 🚀 Setup Turbo cache
if: steps.changes.outputs.nodejs == 'true'
uses: actions/cache@v5
with:
path: |
.turbo
**/node_modules/.cache
key: ${{ runner.os }}-turbo-lint-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-turbo-lint-
- name: 🐳 Pull and start builder container
if: steps.changes.outputs.nodejs == 'true'
# Mount the host Docker socket + share the host network so tests using
# testcontainers (rotor) can talk to the runner's Docker daemon and
# reach sibling containers on localhost. Ryuk is disabled here for the
# same reason the bulker Go test job disables it — the reaper needs
# privileged socket access we don't grant, and CI runners are ephemeral.
run: |
docker pull jitsucom/jitsu-builder:latest
docker run -d --name builder \
-v ${{ github.workspace }}:/workspace -w /workspace \
-v /var/run/docker.sock:/var/run/docker.sock \
--network host \
-e CI=true \
-e TESTCONTAINERS_RYUK_DISABLED=true \
jitsucom/jitsu-builder:latest tail -f /dev/null
- name: 📦 Fetch dependencies from store
if: steps.changes.outputs.nodejs == 'true'
run: |
docker exec builder sh -c 'echo "pnpm store path: $(pnpm store path)"'
docker exec builder pnpm fetch
- name: 📦 Install dependencies
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm install --frozen-lockfile --offline
- name: ✨ Check code format
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm format:check:all
- name: 🔧 Run codegen
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm codegen
- name: 🧪️ Run Typecheck
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm typecheck
- name: 🧪 Run linter
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm lint
- name: 🧪 Run tests
if: steps.changes.outputs.nodejs == 'true'
run: docker exec builder pnpm test
- name: 🎭 Run Playwright tests
if: steps.changes.outputs.nodejs == 'true' && steps.changes.outputs.playwright == 'true'
# Note: build of @jitsu/js and all it's dep is required for playwright tests to work
run: |
docker exec builder pnpm --filter jsondiffpatch --filter @jitsu/js build
docker exec builder pnpm test:playwright
- name: 🧹 Cleanup container
if: always() && steps.changes.outputs.nodejs == 'true'
run: docker stop builder && docker rm builder
bulker-test:
name: 🧪 Bulker Test
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 📥 Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: true
- name: 🔍 Check changed files
id: changes
uses: dorny/paths-filter@v4
with:
filters: |
bulker:
- 'bulker/jitsubase/**'
- 'bulker/ingest/**'
- 'bulker/kafkabase/**'
- 'bulker/eventslog/**'
- 'bulker/bulkerlib/**'
- 'bulker/bulkerapp/**'
- name: Set up Go
if: steps.changes.outputs.bulker == 'true'
uses: actions/setup-go@v6
with:
go-version: '1.26'
cache-dependency-path: "bulker/**/*.sum"
check-latest: true
# cache: false
- name: 🧪 Run Bulker tests
if: steps.changes.outputs.bulker == 'true'
working-directory: ./bulker
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
BULKER_TEST_BIGQUERY: ${{ secrets.BULKER_TEST_BIGQUERY }}
BULKER_TEST_REDSHIFT_IAM: ${{ secrets.BULKER_TEST_REDSHIFT_IAM }}
BULKER_TEST_S3: ${{ secrets.BULKER_TEST_S3 }}
BULKER_TEST_MOTHERDUCK: ${{ secrets.BULKER_TEST_MOTHERDUCK }}
# BULKER_TEST_REDSHIFT: ${{ secrets.BULKER_TEST_REDSHIFT }}
BULKER_TEST_REDSHIFT_SERVERLESS: ${{ secrets.BULKER_TEST_REDSHIFT_SERVERLESS }}
BULKER_TEST_SNOWFLAKE: ${{ secrets.BULKER_TEST_SNOWFLAKE }}
BULKER_TEST_MILLION_ROWS_BATCHED: postgres
TESTCONTAINERS_RYUK_DISABLED: true
run: |
go test -parallel=10 -timeout 60m -json ./jitsubase/... ./ingest/... ./kafkabase/... ./eventslog/... ./bulkerlib/... ./bulkerapp/... > test_report.json
- name: 📊 Generate test report
if: always() && steps.changes.outputs.bulker == 'true'
working-directory: ./bulker
run: |
go install github.com/vakenbolt/go-test-report@latest
cat test_report.json | ~/go/bin/go-test-report
- name: 📤 Upload test artifacts
if: always() && steps.changes.outputs.bulker == 'true'
uses: actions/upload-artifact@v7
with:
name: bulker-test-report
path: |
bulker/test_report.html
bulker/test_report.json
notify:
name: 📢 Notify
needs: [lint-and-format, bulker-test]
if: always() && github.ref == 'refs/heads/newjitsu'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: 📥 Checkout code
uses: actions/checkout@v6
- name: 📝 Get short SHA
id: short-sha
run: echo "sha=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
- name: 🔍 Check job statuses
id: status
run: |
if [[ "${{ needs.lint-and-format.result }}" == "success" && "${{ needs.bulker-test.result }}" == "success" ]]; then
echo "success=true" >> $GITHUB_OUTPUT
echo "color=#36a64f" >> $GITHUB_OUTPUT
echo "header=✅ Lint & Test on branch \`${{ github.ref_name }}\` SUCCEEDED" >> $GITHUB_OUTPUT
else
echo "success=false" >> $GITHUB_OUTPUT
echo "color=#ff0000" >> $GITHUB_OUTPUT
FAILED_JOBS=""
[[ "${{ needs.lint-and-format.result }}" != "success" ]] && FAILED_JOBS="lint-and-format"
[[ "${{ needs.bulker-test.result }}" != "success" ]] && FAILED_JOBS="$FAILED_JOBS bulker-test"
echo "header=❌ Lint & Test on branch \`${{ github.ref_name }}\` FAILED ($FAILED_JOBS)" >> $GITHUB_OUTPUT
fi
- name: 💬 Send notification to Slack
uses: ./.github/actions/slack-notify
with:
slack_webhook_url: ${{ secrets.CI_SLACK_WEBHOOK }}
color: ${{ steps.status.outputs.color }}
header: ${{ steps.status.outputs.header }}
blocks: |
- title: Commit
value: ${{ steps.short-sha.outputs.sha }}
url: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
- title: Commit message
value: ${{ toJSON(github.event.head_commit.message) }}
is_code: true
- title: Workflow run
value: ${{ steps.status.outputs.success == 'true' && 'View workflow run' || 'View failed run' }}
url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- title: Triggered by
value: ${{ github.actor }}
dispatch-publish:
name: 🚀 Dispatch Publish
# Auto-publish only when an explicit version-bump landed on newjitsu and
# lint+test passed. Every other commit goes unpublished — use the manual
# publish.yml dispatch for canary/beta off-cycle builds.
needs: [lint-and-format, bulker-test]
if: github.event_name == 'push' && github.ref == 'refs/heads/newjitsu'
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: 📥 Checkout code
uses: actions/checkout@v6
with:
# Need history covering the entire push range so dorny/paths-filter
# (which uses `base: ${{ github.event.before }}` implicitly for push
# events) sees every commit in the merge, not just the tip.
fetch-depth: 0
- name: 🔍 Did a version file change anywhere in the push?
id: changes
uses: dorny/paths-filter@v4
with:
filters: |
version_bump:
- .services.version.json
- .jsclient.version.json
- name: 🚀 Trigger publish workflow
if: steps.changes.outputs.version_bump == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Pass the full push range to publish.yml so its detect job sees
# every file touched across all commits in the merge — we don't
# squash, so the version-bump commit may be earlier in the range.
FROM_SHA: ${{ github.event.before }}
TO_SHA: ${{ github.event.after }}
run: |
gh workflow run publish.yml \
--repo ${{ github.repository }} \
--ref ${{ github.ref_name }} \
-f from_sha="$FROM_SHA" \
-f to_sha="$TO_SHA"