Skip to content

Migrate validate codeowners from datadog_checks_dev to ddev#23651

Open
AAraKKe wants to merge 3 commits intomasterfrom
aarakke/migrate-validate-codeowners
Open

Migrate validate codeowners from datadog_checks_dev to ddev#23651
AAraKKe wants to merge 3 commits intomasterfrom
aarakke/migrate-validate-codeowners

Conversation

@AAraKKe
Copy link
Copy Markdown
Contributor

@AAraKKe AAraKKe commented May 10, 2026

What does this PR do?

Migrates the validate codeowners command from datadog_checks_dev/.../tooling/commands/validate/codeowners.py to ddev/src/ddev/cli/validate/codeowners.py, rewrites the implementation to use ddev's Application output style and ddev modules, and ports the CodeOwners helper class out of tooling/codeowners.py into ddev/src/ddev/utils/codeowners.py. The legacy command file is deleted; the registry entry in tooling/commands/validate/__init__.py::ALL_COMMANDS is removed.

Helper gap notes

  • tooling/codeowners.py::CodeOwners had no ddev equivalent. Ported to ddev/src/ddev/utils/codeowners.py with modernized type hints (list[...], tuple[...], X | None, Iterator). Unit tests added at ddev/tests/utils/test_codeowners.py.
  • ddev/src/ddev/cli/ci/codeowners.py was the only other consumer of legacy tooling.codeowners. Its import was updated to the new ddev.utils.codeowners in this PR (call-out flagged in 02-validate-wave.md).
  • tooling.utils.get_codeowners / get_codeowners_file / get_valid_integrations collapsed into inline private helpers. Path resolution uses app.repo.path / '.github' / 'CODEOWNERS'; integration enumeration uses app.repo.integrations.iter(['all']).
  • tooling.constants.get_rootapp.repo.path.
  • tooling.commands.console.{abort, echo_failure, echo_success, annotate_error}app.abort, app.display_error, app.display_success. ddev's Application does not surface a dedicated GitHub Actions annotation primitive; legacy annotate_error emitted an annotation alongside the same failure message, so dropping it does not change local behaviour. (Tracked separately: an app.annotate_* primitive will be added in a follow-up infrastructure PR; this command will be retrofitted then.)
  • Repo type check (ctx.obj['repo_choice']) → app.repo.name. ddev's Application.set_repo normalises the same set of values (core / extras / marketplace / agent / local / env-driven).

Test plan

  • ddev validate codeowners --help output unchanged from master
  • ddev validate codeowners produces the same exit code (0) and substantive output ("All integrations have valid codeowners.") as master
  • ddev --no-interactive test ddev -- -k codeowners passes (19/19)
  • ddev --no-interactive test ddev passes (3 pre-existing GitHub VCR failures in tests/utils/test_github.py are unrelated; they stem from GitHubManager deriving the GitHub repo name from the local directory, which in a worktree named migrate-validate-codeowners produces requests against repos/DataDog/migrate-validate-codeowners instead of integrations-core and misses the recorded cassettes — fixed separately in a parallel infrastructure PR)

Motivation

Part of the datadog_checks_devddev CLI migration wave (PR 1.3). Every CLI command currently registered in datadog_checks_dev's legacy tooling tree is being moved into ddev as native code, with the legacy tooling/ directory deleted at the end of the multi-phase migration. This PR ports validate codeowners and its supporting CodeOwners helper, removing one more dependency on the legacy CLI surface and freeing datadog_checks_dev to become a pure pytest plugin.

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 AAraKKe added the qa/skip-qa Automatically skip this PR for the next QA label May 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Major version bump
The changelog type changed or removed was used in this Pull Request, so the next release will bump major version. Please make sure this is a breaking change, or use the fixed or added type instead.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

❌ Patch coverage is 76.04790% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.84%. Comparing base (03b790e) to head (060b08b).

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.

@datadog-prod-us1-6
Copy link
Copy Markdown

datadog-prod-us1-6 Bot commented May 10, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 76.05%
Overall Coverage: 87.32% (+0.07%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 060b08b | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 10, 2026

Validation Report

All 20 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and Codecov settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@AAraKKe AAraKKe marked this pull request as ready for review May 10, 2026 21:44
@AAraKKe AAraKKe requested a review from a team as a code owner May 10, 2026 21:44
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