ci(e2e): add E2E Tests parent workflow and make docker-unified callable

Merged
DE
20h ago
+400-271

Summary

Adds .github/workflows/e2e-tests.yml ("E2E Tests"). It becomes the parent of the end-to-end test lanes: it owns the pull_request and push triggers, classifies the PR once for smart testing, and calls docker-unified.yml as a reusable workflow. PR, push, release and dispatch runs should behave the same as before.

  • e2e-tests.yml: same paths: lists as docker-unified plus itself. Jobs: setup (PR only, just the change flags the classifier reads), classify_pr (moved from docker-unified), and docker: uses: ./.github/workflows/docker-unified.yml with secrets: inherit. docker also runs when classify_pr is skipped (push, forks) or fails. The concurrency group moves here unchanged.
  • docker-unified.yml: push and pull_request are replaced by workflow_call, with 9 string inputs carrying the classifier outputs. release and workflow_dispatch stay. needs.classify_pr.outputs.* becomes inputs.*, and github.event.inputs.* becomes inputs.*. The concurrency group is removed: under workflow_call, github.workflow is the caller's name, so it would have shared the parent's group. No other job bodies move.
  • PostHog: failure events from this lane keep the workflow name Docker Build, Scan, Test. The pytest step is pinned. resusable-playwright-tests.yml gets an optional workflow_name input; its other callers are unchanged.
  • Listeners and filters:
    • post-workflow-actions.yml:
      • E2E Tests is added to the list and to retry-on-failure.
      • The success notification fires for E2E Tests on a push and for Docker Build, Scan, Test on a release.
      • The escape check uses E2E Tests runs and falls back to docker-unified.yml runs for PRs whose last run predates the parent.
    • update-test-weights.yml, docker-unified-nightly.yml, download_test_artifacts.sh and the ci-optimization pytest-workflow filter now point at e2e-tests.yml.
    • validate_post_workflow_list.py allows Docker Build, Scan, Test, which release runs still use.
  • workflow_metrics.py: nested job names (docker / <job>) no longer collapse into one docker entry. A test is added.

Job check names on PRs change from <job> to docker / <job>. Anything keyed on the old names (branch protection rules, dashboards) needs a look.

Workflow flow after this PR

flowchart LR
  subgraph T["Triggers"]
    PR["pull_request"]
    PUSH["push: master, releases/**"]
    REL["release"]
    DISP["workflow_dispatch"]
  end

  subgraph E2E["E2E Tests (e2e-tests.yml)"]
    SETUP["setup (PRs only)"]
    CLS["classify_pr (once)"]
    DOCKER["docker job"]
    SETUP --> CLS --> DOCKER
  end

  subgraph DU["docker-unified.yml (Docker Build, Scan, Test)"]
    DSETUP["setup"] --> BB["base_build"]
    DSETUP --> STM["smoke_test_matrix"]
    STM --> PYT["pytest_tests"]
    BB --> PYT
    DSETUP --> PWP["playwright_plan"]
    PWP --> PWT["playwright_test"] --> PWR["playwright_report"]
    BB --> PWT
    BB --> AI["ai_smoke_test / java_integration_tests"]
    PYT --> PUB["publish_images / deploy (master only)"]
    PWT --> PUB
  end

  PR --> SETUP
  PUSH --> DOCKER
  DOCKER -- "workflow_call + classifier inputs" --> DSETUP
  REL -- "runs directly" --> DSETUP
  DISP -- "runs directly" --> DSETUP

  subgraph PWA["post-workflow-actions.yml (workflow_run)"]
    RETRY["retry on first failure"]
    FAIL["Slack: failure"]
    OK["Slack: Docker build success"]
    MET["metrics"]
    ESC["smart-selection escape check"]
  end

  E2E -- "named E2E Tests (PR, push)" --> PWA
  DU -- "named Docker Build, Scan, Test (release, dispatch)" --> PWA
  • PR and push runs report as E2E Tests, with the lane's jobs nested as docker / <job>. A called workflow has no run of its own, so it sends no separate workflow_run event.
  • Release and workflow_dispatch runs still start docker-unified.yml directly and report as Docker Build, Scan, Test.
  • Slack "Docker build success" fires for E2E Tests on push and for Docker Build, Scan, Test on release. The failure notification, retry and metrics cover both names.
  • The escape check runs on E2E Tests push runs. It looks up the merged PR's run under e2e-tests.yml first, then docker-unified.yml.

Validation

Done locally: actionlint, githubActionsPrettierCheck, .github/scripts/test and .github/smart-testing/test, and validate_post_workflow_list.py.

Runs on this branch (temporary commits have been reverted; the branch content now equals the original change plus the escape-check fallback):

  1. PR run 45980359571 (.github-only diff): success. One classify_pr in the parent, lane jobs named docker / *, classifier tags reached smoke_test_matrix, no separate Docker Build, Scan, Test run. Manual dispatch 45980878460: success, default inputs applied, smart testing off, full 5 pytest batches and 5 Playwright shards.
  2. run-all-tests label, PR run 45982424953: success, classifier stepped aside. Push run 45982420814 (temporary push trigger): parent setup/classify_pr skipped, docker ran, publish and deploy stayed off, full 5 pytest batches. One known-flaky glossary test failed, the same one master's push runs flake on.
  3. post-workflow-actions metrics dispatch 45988457229: nested job names kept (docker / Pytest Smoke Tests, matrix Batch 1/5), no publish, no Slack. Re-run of failed jobs on 45982420814: only the failed batch re-ran, the retry step ran just the failed module, and the run turned green. A new push cancelled the superseded run 45988728203 together with all its nested jobs.
  4. PR run 45988847358 (temporary backend change + run-all-tests): success. Full 5 pytest batches, Playwright plan + 8 shards + merged report under docker / *, all test artifacts present.
  5. PR run 45991631117 (final content, label removed): success. Classifier ran in shadow mode, 0 pytest batches for a workflow-only diff (same as master).
  6. PR run 45994405218 (smart testing active): success. Pytest canary of 10 tests in 1 batch, pytest-smoke-plan artifact, sticky smart-testing comment posted, selection telemetry step succeeded.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (PR title format)
  • Tests for the changes have been added/updated
  • Docs: smoke-test README lane table follows in the next PR
  • No breaking change for users (CI only)

šŸ¤– Generated with Claude Code


Summary by cubic

Adds a new E2E Tests parent workflow that owns the PR and push triggers for the end-to-end test lane, classifies each PR once for smart testing, and calls docker-unified.yml as a reusable workflow. Release and manual runs still start docker-unified.yml directly, which now receives the classifier outputs as workflow_call inputs.

Migration

  • PR job check names change from <job> to docker / <job>; branch protection rules and dashboards keyed on the old names need a look.

Behavior preserved

  • PostHog failure events keep the workflow name Docker Build, Scan, Test; the pytest step is pinned and the Playwright reusable gets an optional workflow_name input.
  • post-workflow-actions, update-test-weights, docker-unified-nightly, download_test_artifacts.sh, and the ci-optimization pytest-workflow filter now point at e2e-tests.yml.
  • The escape check looks up e2e-tests.yml runs and falls back to docker-unified.yml for PRs that predate the parent.
  • workflow_metrics.py keeps nested job names (docker / <job>) instead of collapsing them into one docker entry.