Skip to content

Conversation

eric-weaver
Copy link
Contributor

What does this PR do?

This fixes an issue where our config model_file generation currently uses an incorrect package for executing validators defined in spec.yaml stanzas. We're currently incorrectly using validation package (from datadog_checks.base.utils.models import validation) instead of validators (from . import defaults, validators) so we get an AttributeError

The fix is clearer if you expand the test that was modified. You can see how the input spec maps to the generated instance_model_contents

Searching across integrations-core and integrations-extras for validators usage in yaml files seems to show that no integration currently uses this functionality which is why its been missed until now

Motivation

We're working on fixing up the Postgres / DBM integration configs to be fully using the Pydantic models and validate the configs for exposing DBM healthcheck events and unable to use these validators files.

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

Copy link

⚠️ 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.

@eric-weaver eric-weaver changed the title Fix additional field validators package in model generation Fixes InstanceConfig model generation when validators functions are defined in spec.yaml Sep 19, 2025
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.01%. Comparing base (227427f) to head (13374b6).

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.

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

Successfully merging this pull request may close these issues.

1 participant