Skip to content

Replace sequential CI validations with parallel ddev validate all command#23249

Open
AAraKKe wants to merge 15 commits intomasterfrom
parallel-validation-orchestrator
Open

Replace sequential CI validations with parallel ddev validate all command#23249
AAraKKe wants to merge 15 commits intomasterfrom
parallel-validation-orchestrator

Conversation

@AAraKKe
Copy link
Copy Markdown
Contributor

@AAraKKe AAraKKe commented Apr 9, 2026

What does this PR do?

Replaces the 25 sequential CI validation steps in the GitHub workflow with a single ddev validate all command that runs every validation in parallel using the EventBusOrchestrator. When any validation fails in a PR context, a structured comment is posted to the PR with failure details and fix instructions.

Key changes:

  • New ddev validate all [TARGET] command structured as a package (ddev/src/ddev/cli/validate/all/):
    • __init__.py — click command with lazy imports to keep ddev --help fast
    • github.py — GitHub Actions helpers (PR number detection, workflow URL, step summary, PR comment formatting)
    • orchestrator.pyValidationProcessor, ValidationOrchestrator, unified VALIDATIONS config dict
  • Unified VALIDATIONS dict with ValidationConfig(repo_wide, fix_flag) replaces separate ALL_CORE_VALIDATIONS, REPO_WIDE_VALIDATIONS, and FIX_FLAGS constants
  • --fix flag that passes the appropriate --sync/--fix to each validation that supports it
  • Configurable orchestrator timeouts via --grace-period, --max-timeout, --subprocess-timeout CLI options
  • validations parameter defaults to all validations when not supplied, ready for future per-validation selection
  • Console failure summary with full output and per-validation fix commands
  • Auto-fix hint (ddev validate all --fix) shown in both console output and PR comments on failure
  • Previous validation PR comments are deleted before posting a new one to avoid duplicates
  • AppLoggingHandler + app.logger property on Application to route orchestrator diagnostics through app.display_*
  • GitHubManager.get_pull_request_comments(), delete_comment(), and post_pull_request_comment() methods
  • PR context detection from GITHUB_EVENT_PATH / GITHUB_REF with comprehensive edge-case handling
  • New octo-sts policy (.github/chainguard/self.validate.pull-request.sts.yaml) for PR comment permissions
  • Simplified validate.yml and run-validations.yml workflows — removed all per-validation boolean inputs and 25 individual steps, replaced with a single ddev validate all "$TARGET" step

Test 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, --fix flag 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.yml reusable workflow from integrations-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 until ddev is released to PyPI with the new validate all command:

  • DataDog/integrations-extras — already pinned to a commit, but still passes per-validation boolean inputs that the new workflow no longer accepts. Needs re-pinning and input cleanup.
    validate.yml#L13
  • DataDog/marketplace — references @master directly.
    validate.yml#L17
  • DataDog/integrations-internal — references @master directly.
    validate.yml#L13

Cleanup after merging

The old validate all command in datadog-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)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

AAraKKe added 5 commits April 10, 2026 11:26
- 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
@datadog-prod-us1-4
Copy link
Copy Markdown
Contributor

datadog-prod-us1-4 bot commented Apr 10, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Other Violations

🧪 1 Test failed

test_e2e from test_cisco.py   View in Datadog   (Fix with Cursor)
Needed at least 1 candidates for 'cisco_aci.can_connect', got 0
Expected:
        ServiceCheckStub(check_id=None, name='cisco_aci.can_connect', status=2, tags=None, hostname=None, message=None)
Difference to closest:


Similar submitted:
Score   Most similar

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 96.76%
Overall Coverage: 86.85%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b942adf | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

AAraKKe added 3 commits April 10, 2026 11:59
- 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
@AAraKKe AAraKKe marked this pull request as ready for review April 10, 2026 10:29
@AAraKKe AAraKKe requested a review from a team as a code owner April 10, 2026 10:29
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 96.75768% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.35%. Comparing base (da68177) to head (b942adf).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Recommendation: Add qa/skip-qa label

This PR does not modify any files shipped with the agent.

To help streamline the release process, please consider adding the qa/skip-qa label if these changes do not require QA testing.

@AAraKKe AAraKKe added the qa/skip-qa Automatically skip this PR for the next QA label Apr 10, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts bot commented Apr 10, 2026

Validation Report

Validation Status
agent-reqs
ci
codeowners
config
dep
http
imports
integration-style
jmx-metrics
labeler
legacy-signature
license-headers
licenses
metadata
models
openmetrics
package
readmes
saved-views
version

View full run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant