← Back to Pull requests

ci: reduce CI duration from 1h15m to 43m #20270

Closed
unknown closed this pull request without merging on Sep 08, 2026 01:57 UTC
View on GitHub
unknown unknown commented on Sep 06, 2026 09:38 UTC
Author

Summary

Re-orchestrate the CI jobs and remove redundant build work to reduce the time
required to validate a change.

Current job dependencies

Before this change, the workflow was effectively:

unit-tests (including validate-dist) -> docker-tests -> actions-timeline

The docker-tests job had needs: [unit-tests], so it waited for the complete
unit-test reusable workflow, including distribution validation, before it could
start.

After this change:

unit-tests ─┐
            ├─ actions-timeline
docker-tests ┘

The unit-test and Docker-test workflows run independently. The timeline job
remains reporting-only and waits for both workflows.

Key problems

  • Docker tests were unnecessarily gated by all unit-test shards.

  • The distribution was built in a separate validate-dist job and transferred

  • through an artifact before Docker testing.
  • The Docker workflow performed unnecessary image save/load/prune operations.

  • The Docker image could rebuild the application from source.

  • Docker-test Maven execution verified the entire reactor instead of the

  • required embedded-tests module and its dependencies.
  • JavaScript and Python CodeQL jobs performed unnecessary Java setup and Maven

  • compilation.
  • The distribution build was single-threaded.
  • Changes

  • Remove the separate distribution-validation job from the unit-test workflow.

  • Rename .github/scripts/validate-dist to .github/scripts/build-dist and run

  • it in the Docker job.
  • Use Maven -T1C for the distribution build.

  • Build the Docker image from the host-built distribution with

  • BUILD_FROM_SOURCE=false.
  • Remove the Docker image save/load/prune cycle and distribution artifact

  • handoff.
  • Allow the host-built distribution tarball into the Docker build context.

  • Limit Docker-test Maven execution to embedded-tests and its dependencies

  • with -pl embedded-tests -am.
  • Remove the Docker job dependency on the unit-test workflow.

  • Skip Java setup and Maven compilation for JavaScript and Python CodeQL jobs.
  • Measured outcome

    Successful upstream master baseline

    The baseline is commit e9db64b6e97c974975321f51085936f9c27e13f9 on the
    Apache Druid master branch. All three relevant workflows completed
    successfully:

  • Unit & Integration tests CI

  • Static Checks CI

  • CodeQL
  • The complete upstream CI window was 1h15m55s. The Docker job started
    40m18s after the Unit & Integration workflow began because of the existing
    dependency.

    Current branch benchmark

    The current branch benchmark is the successful run for commit
    3361d2d50b8024b8cbf72bd53b18b9f5c7b07ac6:

  • Unit & Integration tests CI

  • Static Checks CI

  • CodeQL
  • The complete CI window was 43m15s. The Docker job started 3s after the
    Unit & Integration workflow and completed successfully. All relevant checks
    were green.

    | Metric | Successful upstream master | Current branch benchmark | Difference |
    | --- | ---: | ---: | ---: |
    | Complete CI window | 1h15m55s | 43m15s | 32m40s faster |
    | Docker job runtime | 35m27s | 34m40s | 47s faster |
    | Docker job start delay | 40m18s | 3s | 40m15s earlier |
    | CodeQL workflow | 30m41s | 23m04s | 7m37s faster |

    For the current Docker job, the key steps were:

    | Docker step | Duration |
    | --- | ---: |
    | Build the Druid distribution | 12m34s |
    | Build the Docker image | 2m25s |
    | Run Docker tests | 19m01s |

    The Docker job is slightly longer because it now performs the host distribution
    build, but the job becomes available immediately instead of waiting for the
    unit-test workflow.

    CodeQL breakdown

    | CodeQL job | Successful upstream master | Current branch benchmark | Difference |
    | --- | ---: | ---: | ---: |
    | Analyze (JavaScript) | 6m46s | 1m39s | 5m07s faster |
    | Analyze (Python) | 6m41s | 1m08s | 5m33s faster |
    | Analyze (Java) | 30m37s | 23m00s | Not attributed to this change |

    The JavaScript and Python improvements result from skipping Java setup and
    Maven compilation for interpreted-language analysis. The Java timing
    difference is not an intended optimization.

    Same-workflow -T1C comparison

    Compared with the preceding no--T1C benchmark:

    | Metric | No -T1C | Current branch | Improvement |
    | --- | ---: | ---: | ---: |
    | Distribution build | 29m25s | 12m34s | 16m51s faster |
    | Docker job | 50m15s | 34m40s | 15m35s faster |
    | End-to-end workflow | 55m43s | 43m15s | 12m28s faster |

    These are single-run measurements and can vary with GitHub Actions runner
    scheduling.

    CI duration visualization

    !Master branch - Critical execution path

    !PR #20270 - Critical execution path

    Validation

  • git diff --check

  • Shell syntax validation for build-dist and run_docker-tests

  • Unit & Integration tests, Static Checks, CodeQL, and PR checks completed successfully for the current head
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: GWphua Review duration: 2419m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #20270"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository