ci(e2e): run the Docker-free lane from the E2E Tests parent workflow

Merged
DE
20h ago
+580-87

Stacked on #21673 (E2E Tests parent workflow + callable docker-unified.yml).

Summary

docker-free-e2e.yml becomes a reusable workflow that the E2E Tests parent (e2e-tests.yml) calls next to the Docker lane. The lane gets the same smart-testing pipeline as the Docker lane: one classification in the parent, its own batch plan on the Docker-free stack's weights, its own PR comment and PostHog events.

  • docker-free-e2e.yml: push, pull_request, the docker-free:pytests label gate and the label-aware concurrency group are removed. It now has workflow_call (the 9 classifier inputs docker-unified.yml takes, plus smoke_tier and smoke_changed_tests) and workflow_dispatch (full tier, 9 batches, smart testing off).
    • New smoke_test_matrix job: resolves the smart-testing mode like the Docker lane and runs plan_pytest_batches.sh with SMOKE_BACKEND=local, so batches are packed on pytest_test_weights_docker_free.json (cap 9, 8-minute target). Plan artifact: pytest-smoke-plan-local. Same fallbacks as the Docker lane: fixed 9 batches for the full tier, 3 for p0, and p0 in 3 batches if an active plan fails.
    • pytest_tests reads the matrix, tier and plan from smoke_test_matrix. PostHog failure events keep --workflow-name "Docker-free E2E" and --batch-label docker-free.
    • New comment_smart_testing job posts the lane's own sticky comment.
  • e2e-tests.yml: setup decides run_pytest, smoke_tier and smoke_changed_tests. These are copies of the Docker lane's PR logic, with "keep in step" comments on both sides. The new docker_free job calls the lane on pull requests when the Docker lane runs pytest, and on every push to master.
  • Scripts: render_comment.py compose --lane gives a lane its own comment marker. send_smart_selection_to_posthog.py adds a lane property (docker, docker-free).
  • Listeners:
    • post-workflow-actions.yml: the Docker build success message for an E2E Tests push follows the run's docker / * jobs, so a Docker-free-only failure does not suppress it. It waits for the retry when attempt 1 failed. Docker Build, Scan, Test pushes from older release branches still notify. The escape check downloads only the Docker lane's pytest results.
    • update-test-weights.yml reads Docker-free results from e2e-tests.yml.
    • validate_post_workflow_list.py allows Docker-free E2E, which now has dispatch runs only.
    • The ci-optimization pytest-workflow filter covers the lane and its stack action.
  • Docs: smoke-test/README.md describes both lanes in a table, with labels and dispatch. AGENTS.md no longer mentions the label.

Workflow after this PR

flowchart LR
  PR["pull_request"]
  PUSH["push: master, releases/**"]
  DISP_D["workflow_dispatch: docker-unified.yml"]
  DISP_F["workflow_dispatch: docker-free-e2e.yml"]
  REL["release"]

  subgraph PARENT["E2E Tests (e2e-tests.yml)"]
    SETUP["setup: change flags, run_pytest, smoke_tier"]
    CLASSIFY["classify_pr: smart-testing tags"]
    DJOB["docker"]
    FJOB["docker_free"]
  end

  subgraph DOCKER["Docker lane (docker-unified.yml)"]
    D_BUILD["setup, base_build"]
    D_MATRIX["smoke_test_matrix"]
    D_PYTEST["pytest_tests batches"]
    D_PW["playwright_plan, Playwright shards"]
    D_OTHER["Java SDK, AI smoke, publish"]
    D_COMMENT["comment_smart_testing"]
  end

  subgraph FREE["Docker-free lane (docker-free-e2e.yml)"]
    F_BUILD["build"]
    F_MATRIX["smoke_test_matrix: plan on local weights"]
    F_PYTEST["pytest_tests batches"]
    F_COMMENT["comment_smart_testing"]
  end

  subgraph POST["post-workflow-actions.yml"]
    RETRY["retry on first failure"]
    SLACK_F["Slack: failure"]
    SLACK_S["Slack: Docker build success"]
    METRICS["metrics"]
    ESCAPE["escape check"]
  end

  PR --> SETUP
  SETUP -->|"same-repo PR, not run-all-tests"| CLASSIFY
  PUSH --> DJOB
  SETUP --> DJOB
  CLASSIFY -->|"tags or empty"| DJOB
  CLASSIFY -->|"tags or empty"| FJOB
  SETUP -->|"run_pytest (forks too)"| FJOB
  PUSH -->|"master only (stability window)"| FJOB

  DJOB --> D_BUILD
  D_BUILD --> D_MATRIX --> D_PYTEST
  D_BUILD --> D_PW
  D_BUILD --> D_OTHER
  D_MATRIX -->|"same-repo PR, mode not off"| D_COMMENT
  DISP_D --> D_BUILD
  REL --> D_BUILD

  FJOB --> F_BUILD
  FJOB --> F_MATRIX
  F_BUILD --> F_PYTEST
  F_MATRIX --> F_PYTEST
  F_MATRIX -->|"same-repo PR, mode not off"| F_COMMENT
  DISP_F -->|"full tier, 9 batches, smart off"| F_BUILD

  PARENT -->|"workflow_run: E2E Tests"| POST
  DOCKER -->|"workflow_run: Docker Build, Scan, Test (release, dispatch)"| POST
  FREE -->|"workflow_run: Docker-free E2E (dispatch)"| POST

Smart-testing mode for each lane's pytest comes from the SMART_TESTING_MODE repository variable on same-repo PRs. It is off on pushes, on dispatch, on fork PRs, and with the run-all-tests or run-all-tests:pytest label. SMART_TESTING_MODE and PYTEST_P0_SMOKE are set in this repository, so same-repo PRs run the p0 tier with planned batches. A PR that only changes the pytest wiring runs a canary.

What changes for contributors

  • Same-repo PRs that run pytest on the Docker lane also run it on the Docker-free stack. You'll see docker-free / … jobs and a second sticky comment, "Smart test selection (docker-free lane)". The docker-free:pytests label is no longer needed.
  • Fork PRs run the Docker-free lane too, on GitHub-hosted runners: full tier, 9 batches, smart testing off, no comment.
  • run-all-tests / run-all-tests:pytest turn smart testing off in both lanes. They don't start a lane the change wouldn't start.
  • To run the Docker-free lane alone, dispatch Docker-free E2E from the Actions tab.

Decisions

  • Forks run the lane. Repository variables and secrets don't reach fork PRs, so the lane falls back to ubuntu-24.04 runners, no remote Gradle cache and smart testing off.
  • No gate job. Branch protection (Mergeable) blocks on the lane's own docker-free / * jobs.
  • Lane-specific comment marker (<!-- smart-testing-selection:docker-free -->), so the two lanes don't overwrite each other's comment.
  • PostHog lane property on ci_smart_selection events (docker / docker-free). Failure events keep their pinned workflow names.
  • Every push to master runs the lane while it runs next to the Docker lane. It is a temporary stability window, to be narrowed later.
  • Batch counts (9 full, 3 p0) are unchanged here. A follow-up will right-size them from real runs.

Validation

Checks run locally:

  • actionlint on the changed workflows
  • githubActionsPrettierCheck and mdPrettierCheck
  • validate_post_workflow_list.py
  • pytest .github/scripts/test .github/scripts/release/test .github/smart-testing/test: 858 passed
  • plan_pytest_batches.sh with SMOKE_BACKEND=local: a canary plans 1 batch

To run on the branch:

  1. This PR touches only workflow files (all pytest-workflow changes). Under active mode, both lanes should plan a canary. Expect docker-free / smoke_test_matrix in active mode, pytest-smoke-plan-local uploaded, a small planned matrix, and two sticky comments.
  2. A connector-source-only change: docker_free is skipped, along with the Docker lane's pytest.
  3. A backend change: p0 tier, planned batches in both lanes, ci_smart_selection events with each lane.
  4. The run-all-tests:pytest label: fixed 9 batches at the full tier, no lane comment.
  5. A forced batch failure: the docker-free / … batch job and the run go red.
  6. Dispatch docker-free-e2e.yml alone: 9 batches, smart testing off, jobs without a prefix.
  7. "Re-run failed jobs" on one Docker-free batch: smoke-test-retry finds its previous results.
  8. After merge: first master push runs both lanes; the Docker build success message follows the docker / * jobs; weekly weights find Docker-free results under e2e-tests.yml.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
  • Links to related issues (if applicable): stacked on #21673
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes: not needed (CI only)

šŸ¤– Generated with Claude Code


Summary by cubic

Makes docker-free-e2e.yml a reusable lane of the E2E Tests parent workflow, giving the Docker-free pytest suite the same smart-testing pipeline as the Docker lane: one PR classification, batches planned on the lane's own weights, its own sticky PR comment, and PostHog events tagged with a lane property.

  • The lane loses its own push/pull_request triggers and the docker-free:pytests label. For now e2e-tests.yml calls it only on every push to master as a temporary stability window, so docker / … and docker-free / … jobs run side by side. The PR wiring (the Docker lane's run_pytest decision, tier, changed tests, and classifier tags) is in place, so enabling PRs later is one condition on the calling job. workflow_dispatch still runs the lane alone with smart testing off.
  • New smoke_test_matrix and comment_smart_testing jobs mirror the Docker lane's planning and comment logic: batches are planned on pytest_test_weights_docker_free.json via SMOKE_BACKEND=local, with the same fallbacks (9 batches full, 3 for p0), and each lane keeps its own comment marker.
  • post-workflow-actions.yml now bases the Docker build success Slack message for E2E Tests pushes on the run's docker / * jobs, so a Docker-free-only failure doesn't suppress it; it waits for retry-on-failure before notifying. The escape check uses only the Docker lane's pytest results.
  • update-test-weights.yml reads Docker-free results from e2e-tests.yml; ci-optimization's pytest-workflow filter now covers the lane and its stack action.

What changes for contributors

  • master pushes now run the Docker-free lane next to the Docker lane, adding docker-free / … jobs. The docker-free:pytests label is no longer used.
  • To run the lane alone, dispatch Docker-free E2E from the Actions tab.