Replace sequential CI validations with parallel ddev validate all command#23249
Replace sequential CI validations with parallel ddev validate all command#23249
Conversation
…mand Made-with: Cursor
- Split all.py into all/ package: __init__.py (click command), github.py (CI helpers, PR comment formatting), orchestrator.py (processor, orchestrator, constants) - Make orchestrator timeouts configurable via --grace-period, --max-timeout, --subprocess-timeout CLI options - Default validations to ALL_CORE_VALIDATIONS when not supplied - Improve test coverage: parametrize processor tests, extract CapturingOrchestrator, add integration tests through ddev CLI
- Consolidate ALL_CORE_VALIDATIONS, REPO_WIDE_VALIDATIONS, and FIX_FLAGS into a single VALIDATIONS dict with ValidationConfig dataclass - Add --fix flag that passes --sync/--fix to each validation that supports it - Print failure output and fix commands in console summary - Show auto-fix hint in both console output and PR comments on failure
- Add get_pull_request_comments and delete_comment to GitHubManager - Delete previous Validation Report comments before posting a new one - Split test_all.py into tests/cli/validate/all/ package: conftest.py, test_github.py, test_orchestrator.py, test_command.py
d284a0e to
10c83ce
Compare
|
✨ Fix all issues with BitsAI or with Cursor
|
- Post PR comment on every run (not just on failures) - Replace verbose collapsible output with a concise markdown table (validation name + ✅/❌) - Remove individual validation output from comment/summary since the run link is available - Simplify console output to match the table format
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2928d6fc22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
|
This PR does not modify any files shipped with the agent. To help streamline the release process, please consider adding the |
Validation Report
|
What does this PR do?
Replaces the 25 sequential CI validation steps in the GitHub workflow with a single
ddev validate allcommand that runs every validation in parallel using theEventBusOrchestrator. When any validation fails in a PR context, a structured comment is posted to the PR with failure details and fix instructions.Key changes:
ddev validate all [TARGET]command structured as a package (ddev/src/ddev/cli/validate/all/):__init__.py— click command with lazy imports to keepddev --helpfastgithub.py— GitHub Actions helpers (PR number detection, workflow URL, step summary, PR comment formatting)orchestrator.py—ValidationProcessor,ValidationOrchestrator, unifiedVALIDATIONSconfig dictVALIDATIONSdict withValidationConfig(repo_wide, fix_flag)replaces separateALL_CORE_VALIDATIONS,REPO_WIDE_VALIDATIONS, andFIX_FLAGSconstants--fixflag that passes the appropriate--sync/--fixto each validation that supports it--grace-period,--max-timeout,--subprocess-timeoutCLI optionsvalidationsparameter defaults to all validations when not supplied, ready for future per-validation selectionddev validate all --fix) shown in both console output and PR comments on failureAppLoggingHandler+app.loggerproperty onApplicationto route orchestrator diagnostics throughapp.display_*GitHubManager.get_pull_request_comments(),delete_comment(), andpost_pull_request_comment()methodsGITHUB_EVENT_PATH/GITHUB_REFwith comprehensive edge-case handling.github/chainguard/self.validate.pull-request.sts.yaml) for PR comment permissionsvalidate.ymlandrun-validations.ymlworkflows — removed all per-validation boolean inputs and 25 individual steps, replaced with a singleddev validate all "$TARGET"stepTest coverage:
Tests are organized as a package (
tests/cli/validate/all/):test_github.py— PR number parsing (event file + ref), workflow URL, step summary, PR comment formatting (all-pass, failures, trimming, stderr fallback, errors/warnings)test_orchestrator.py— processor result capture and display, orchestrator message submission, on_finalize behavior (step summary, PR comment posting, comment deduplication, exception handling)test_command.py— integration tests through the full CLI → orchestrator → subprocess.run path (all-pass, failure with details, target forwarding,--fixflag propagation)Motivation
The current CI validation workflow runs 25 validations sequentially, meaning a failure in the first validation blocks visibility into all subsequent ones. This forces contributors to fix issues one at a time, re-run CI, and wait again. Running all validations in parallel surfaces all failures at once and posts them as a structured PR comment so contributors can fix everything in a single pass.
Before merging
The following repos reference the
run-validations.ymlreusable workflow fromintegrations-core. They must be updated to pin to the latest commit in master before this PR is merged, so they continue using the old workflow untilddevis released to PyPI with the newvalidate allcommand:validate.yml#L13@masterdirectly.validate.yml#L17@masterdirectly.validate.yml#L13Cleanup after merging
The old
validate allcommand indatadog-checks-dev(datadog_checks.dev.tooling.commands.validate.all) is unused and can be deleted once this lands.Review checklist (to be filled by reviewers)
qa/skip-qalabel if the PR doesn't need to be tested during QA.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged