Migrate validate codeowners from datadog_checks_dev to ddev#23651
Open
Migrate validate codeowners from datadog_checks_dev to ddev#23651
Conversation
Contributor
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 060b08b | Docs | Datadog PR Page | Give us feedback! |
6 tasks
Contributor
Validation ReportAll 20 validations passed. Show details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Migrates the
validate codeownerscommand fromdatadog_checks_dev/.../tooling/commands/validate/codeowners.pytoddev/src/ddev/cli/validate/codeowners.py, rewrites the implementation to use ddev'sApplicationoutput style and ddev modules, and ports theCodeOwnershelper class out oftooling/codeowners.pyintoddev/src/ddev/utils/codeowners.py. The legacy command file is deleted; the registry entry intooling/commands/validate/__init__.py::ALL_COMMANDSis removed.Helper gap notes
tooling/codeowners.py::CodeOwnershad no ddev equivalent. Ported toddev/src/ddev/utils/codeowners.pywith modernized type hints (list[...],tuple[...],X | None,Iterator). Unit tests added atddev/tests/utils/test_codeowners.py.ddev/src/ddev/cli/ci/codeowners.pywas the only other consumer of legacytooling.codeowners. Its import was updated to the newddev.utils.codeownersin this PR (call-out flagged in02-validate-wave.md).tooling.utils.get_codeowners/get_codeowners_file/get_valid_integrationscollapsed into inline private helpers. Path resolution usesapp.repo.path / '.github' / 'CODEOWNERS'; integration enumeration usesapp.repo.integrations.iter(['all']).tooling.constants.get_root→app.repo.path.tooling.commands.console.{abort, echo_failure, echo_success, annotate_error}→app.abort,app.display_error,app.display_success. ddev'sApplicationdoes not surface a dedicated GitHub Actions annotation primitive; legacyannotate_erroremitted an annotation alongside the same failure message, so dropping it does not change local behaviour. (Tracked separately: anapp.annotate_*primitive will be added in a follow-up infrastructure PR; this command will be retrofitted then.)ctx.obj['repo_choice']) →app.repo.name. ddev'sApplication.set_reponormalises the same set of values (core/extras/marketplace/agent/local/ env-driven).Test plan
ddev validate codeowners --helpoutput unchanged from masterddev validate codeownersproduces the same exit code (0) and substantive output ("All integrations have valid codeowners.") as masterddev --no-interactive test ddev -- -k codeownerspasses (19/19)ddev --no-interactive test ddevpasses (3 pre-existing GitHub VCR failures intests/utils/test_github.pyare unrelated; they stem fromGitHubManagerderiving the GitHub repo name from the local directory, which in a worktree namedmigrate-validate-codeownersproduces requests againstrepos/DataDog/migrate-validate-codeownersinstead ofintegrations-coreand misses the recorded cassettes — fixed separately in a parallel infrastructure PR)Motivation
Part of the
datadog_checks_dev→ddevCLI migration wave (PR 1.3). Every CLI command currently registered indatadog_checks_dev's legacy tooling tree is being moved into ddev as native code, with the legacytooling/directory deleted at the end of the multi-phase migration. This PR portsvalidate codeownersand its supportingCodeOwnershelper, removing one more dependency on the legacy CLI surface and freeingdatadog_checks_devto become a pure pytest plugin.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