Skip to content

feat: Add Datadog schema hooks - #701

Open
lannuttia wants to merge 7 commits into
python-jsonschema:mainfrom
lannuttia:feat/add-datadog-support
Open

feat: Add Datadog schema hooks#701
lannuttia wants to merge 7 commits into
python-jsonschema:mainfrom
lannuttia:feat/add-datadog-support

Conversation

@lannuttia

@lannuttia lannuttia commented Aug 5, 2026

Copy link
Copy Markdown

Add Datadog schema hooks from https://github.com/DataDog/schema.

Closes #702.

This PR adds three new pre-commit hooks for validating Datadog configuration files:

  • check-datadog-continuous-testing - Validates Datadog Continuous Testing configuration files
  • check-datadog-service-definition - Validates Datadog Service Definition files
  • check-datadog-software-catalog - Validates Datadog Software Catalog entity files

All schemas are sourced from the official DataDog/schema repository on GitHub.

- Add check-datadog-continuous-testing hook for datadog-ci.(json|yml|yaml)
- Add check-datadog-service-definition hook for service.datadog.(json|yml|yaml)
- Add check-datadog-software-catalog hook for entity.datadog.(json|yml|yaml)

All three schemas are from DataDog/schema repository under Apache 2.0 license.
Schemas support remote $ref dependencies which are resolved automatically.

@sirosen sirosen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems like a perfectly good addition; can we add a bit of testing to make sure that the hooks are, and stay, in good working order?

You can see some tests for hook patterns here, and there's a suite of tests here which automatically check schemas against examples in tests/example-files/hooks/.

I also had a minor note for the changelog.

Comment thread CHANGELOG.rst Outdated
``check-datadog-service-definition``, and ``check-datadog-software-catalog``.
Thanks :user:`lannuttia`! (:issue:`702`, :pr:`701`)

.. vendor-insert-here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor, but let's put this note down below this comment; the vendoring script uses the comment to insert the Update vendored schemas: ... entries.

lannuttia and others added 2 commits August 9, 2026 23:35
Add positive and negative example files for all three Datadog schema hooks:
- datadog-continuous-testing (2 positive, 1 negative)
- datadog-service-definition (3 positive, 1 negative)
- datadog-software-catalog (4 positive, 1 negative)

All positive examples validate successfully with the CLI tool.
Some tests fail due to external schema refs blocked by HTTP mocking.

Fixes CHANGELOG.rst placement (moved below vendor-insert-here marker).

Addresses feedback from PR python-jsonschema#701 review.
@lannuttia

Copy link
Copy Markdown
Author

It appears my positive tests are failing because the vendored schemas have external schema references and as a result are not self contained. The network isolation during the test suite prevents the schema from being downloaded over the network (as it should) and as a result is causing test failures.

It looks like this is going to be more involved than I would have personally hoped. I don't know how exactly to solve this problem. If you have any ideas for how to proceed, I'm open to suggestions. If you don't have any ideas, I'll try to pick this up again soon and figure out what would be the best way to address this issue after I've had some time to sleep on the issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New vendored schemas: Datadog

2 participants