Skip to content

chore: add a registry for supported integrations #13215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 59 commits into
base: main
Choose a base branch
from

Conversation

wconti27
Copy link
Contributor

@wconti27 wconti27 commented Apr 16, 2025

Description

This PR introduces an integration registry, that contains information for all supported integrations.

registry.yml located in ddtrace/contrib/integration_registry/

  • Integration name
  • Dependency names for all packages patched by this integration
  • Is_External: whether the patched dependency is an external package downloadable via Pypi or False for stdlib Python packages or abstract integrations such as dbapi
  • Is_Tested: Optional, only present if the integration lacks testing, e.g. aioredis which is untested and planned to be deprecated
  • Tested Version to Dependency Mapping: Each dependency this integration patches, with min and max versions for what is tested

Along with the registry.yaml, this PR makes quite a few changes to setup the necessary information to connect Riot testing venvs, the dependencies in those tests, to the integration being tested.

  • riotfile.py updates:
    • any contrib with multiple sub-test suites now shares a common venv naming schema of: integration_name:sub-test
      • django_hosts -> django:django_hosts
      • psycopg2 (our integration name is psycopg) -> psycopg:psycopg2
      • graphene -> graphql:graphene
  • All integration to dependency or module name mappings moved to ddtrace/contrib/integration_registry/mappings.py
  • Update suitespec to use new venv names
  • scripts/freshvenvs.py updates
    • Uses riot to build a mapping of venv names to riot hashes, allowing us to correlate files from .riot/requirements/*.txt to the respective test environment name. This change ensures that dependency versions collected are actually correlated with the test suite venv being tested (as opposed to test suite X relying on dependency Y==0.1, while test suite Y tests dependencyY>1.0, previously the tested version of Y would be recorded as 0.1, now its >1.0.
    • Other changes include:
      • Using new dependency name to integration name mappings within ddtrace/integration_registry/mappings.py, instead of storing the mapping in this script file

Automatic updates of integration registry.yml for contrib testing

  • For all tests testing tests/contrib/*, we patch the getattr function and listen for getattr calls where _datadog_patch is being called on an object. This call is used in most of our contribs, and allows us access to the modules being patched during tests. If this attribute was used in the getattr call, we store the object it was called on, as well as the callstack, for later processing.
  • After the test session concludes, we do some processing to automatically update our registry.yaml with data collected from the patched object and traceback.
  • registry.yaml update process during testing:
    • Patched objects are stored by IntegrationRegistryManager class, which later processes the objects, checks if they were valid contribs, gets the dependency name of the patched top level module, ie: module kafka -> (using importlib.metadata) -> we get package names producing this module -> ie: confluent-kafka``.
      • Also gets the version of the module being patched and stores for later processing.
        - After IntegrationRegistryManager runs, we run the IntegrationRegistryUpdater class in a separate virtual environment, since the class relies on riot and pyyaml, both of which are not available in riot virtual environments, so we make our own.
        - IntegrationRegistryUpdater:
      • Parses our data exported by IntegrationRegistryManager, which includes tested integration, patched dependency name, patched dependency version
      • Reads our current registry.yml, and decides whether to update the file, depending on if the dependency / integration combo is already present in the file, or if the tested version is outside the current files version range for the dependency, if True, runs scripts/integration_registry/update_and_format_registry.py.
      • Updates and formats the registry automatically for new integrations, dependencies, or dependency versions!

New Scripting:

  • scripts/integration_registry/_format_integration_registry.py: Formats the integration registry with spaces between integration registries, since no python yaml packages offer this functionality. Done for readability
  • scripts/integration_registry/_update_integration_registry_versions.py: Updates the registry with new data from supported_versions_output.json, which is generated from the scripts/freshvenvs.py script.
  • scripts/integration_registry/update_and_format_registry.py: Runs scripts/freshvenvs.py, and the former two scripts to update all of our test information and resave the new registry. This is the main script to call.

Other updates:

  • Adds a git diff check to CI runs for contrib tests. If the registry.yml was updated during CI, the new check fails the CI job, similar to riot lockfile check, and tells the user to update the registry.yml with the new information.

Several tests have been added to ensure that the registry.yaml stays updated when new contribs are added:

Registry Tests

  • test that every dir within ddtrace/contrib/internal has an associated registry entry
  • test that registry.yaml conforms to strict schema
  • test that every external dependency has corresponding tested version information in registry.yaml
  • test that every external dependency exists on Pypi

Riotfile Tests

  • test that every directory within ddtrace/contrib/internal has a corresponding riot venv name associated with it
  • test that every riot venv with a test path containing tests/contrib/ uses a venv name that is a directory within ddtrace/contrib/internal, if the venv name is a subtest in the form of integration[sub-test], tests that the integration is located within ddtrace/contrib/internal.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Copy link
Contributor

github-actions bot commented Apr 17, 2025

CODEOWNERS have been resolved as:

.riot/requirements/1079860.txt                                          @DataDog/apm-python
.riot/requirements/10853b3.txt                                          @DataDog/apm-python
.riot/requirements/109f96d.txt                                          @DataDog/apm-python
.riot/requirements/10b643c.txt                                          @DataDog/apm-python
.riot/requirements/1200a2a.txt                                          @DataDog/apm-python
.riot/requirements/122e427.txt                                          @DataDog/apm-python
.riot/requirements/13c380c.txt                                          @DataDog/apm-python
.riot/requirements/1435097.txt                                          @DataDog/apm-python
.riot/requirements/1437520.txt                                          @DataDog/apm-python
.riot/requirements/14b9202.txt                                          @DataDog/apm-python
.riot/requirements/1560ba9.txt                                          @DataDog/apm-python
.riot/requirements/1588200.txt                                          @DataDog/apm-python
.riot/requirements/1591bf5.txt                                          @DataDog/apm-python
.riot/requirements/15996f6.txt                                          @DataDog/apm-python
.riot/requirements/160ea38.txt                                          @DataDog/apm-python
.riot/requirements/16313f3.txt                                          @DataDog/apm-python
.riot/requirements/169b006.txt                                          @DataDog/apm-python
.riot/requirements/16a5a2e.txt                                          @DataDog/apm-python
.riot/requirements/16ac1f1.txt                                          @DataDog/apm-python
.riot/requirements/16bd71d.txt                                          @DataDog/apm-python
.riot/requirements/16ea438.txt                                          @DataDog/apm-python
.riot/requirements/1726db0.txt                                          @DataDog/apm-python
.riot/requirements/173260e.txt                                          @DataDog/apm-python
.riot/requirements/1746c1c.txt                                          @DataDog/apm-python
.riot/requirements/17f0d68.txt                                          @DataDog/apm-python
.riot/requirements/17f2a52.txt                                          @DataDog/apm-python
.riot/requirements/1878fa7.txt                                          @DataDog/apm-python
.riot/requirements/18e5cae.txt                                          @DataDog/apm-python
.riot/requirements/1a21d86.txt                                          @DataDog/apm-python
.riot/requirements/1a84cc2.txt                                          @DataDog/apm-python
.riot/requirements/1b6ed54.txt                                          @DataDog/apm-python
.riot/requirements/1c7bf82.txt                                          @DataDog/apm-python
.riot/requirements/1cf47d6.txt                                          @DataDog/apm-python
.riot/requirements/1d07c9f.txt                                          @DataDog/apm-python
.riot/requirements/1d282b1.txt                                          @DataDog/apm-python
.riot/requirements/1d915ff.txt                                          @DataDog/apm-python
.riot/requirements/1db0994.txt                                          @DataDog/apm-python
.riot/requirements/1f1d3a0.txt                                          @DataDog/apm-python
.riot/requirements/1f280ce.txt                                          @DataDog/apm-python
.riot/requirements/25cad6d.txt                                          @DataDog/apm-python
.riot/requirements/273fcaf.txt                                          @DataDog/apm-python
.riot/requirements/3185459.txt                                          @DataDog/apm-python
.riot/requirements/37646c9.txt                                          @DataDog/apm-python
.riot/requirements/4288d15.txt                                          @DataDog/apm-python
.riot/requirements/4396c33.txt                                          @DataDog/apm-python
.riot/requirements/4ad5317.txt                                          @DataDog/apm-python
.riot/requirements/4ce4ec1.txt                                          @DataDog/apm-python
.riot/requirements/51d9412.txt                                          @DataDog/apm-python
.riot/requirements/53b1ba3.txt                                          @DataDog/apm-python
.riot/requirements/57549f7.txt                                          @DataDog/apm-python
.riot/requirements/58d7730.txt                                          @DataDog/apm-python
.riot/requirements/5e79012.txt                                          @DataDog/apm-python
.riot/requirements/65aafe7.txt                                          @DataDog/apm-python
.riot/requirements/690aeca.txt                                          @DataDog/apm-python
.riot/requirements/6d820e6.txt                                          @DataDog/apm-python
.riot/requirements/7613d04.txt                                          @DataDog/apm-python
.riot/requirements/7a4893e.txt                                          @DataDog/apm-python
.riot/requirements/8ba611b.txt                                          @DataDog/apm-python
.riot/requirements/8f9b04b.txt                                          @DataDog/apm-python
.riot/requirements/91c10ff.txt                                          @DataDog/apm-python
.riot/requirements/93b1e3b.txt                                          @DataDog/apm-python
.riot/requirements/a4331a5.txt                                          @DataDog/apm-python
.riot/requirements/a61304c.txt                                          @DataDog/apm-python
.riot/requirements/aa76239.txt                                          @DataDog/apm-python
.riot/requirements/b0d5dee.txt                                          @DataDog/apm-python
.riot/requirements/b570f17.txt                                          @DataDog/apm-python
.riot/requirements/b58b8b2.txt                                          @DataDog/apm-python
.riot/requirements/c32fba4.txt                                          @DataDog/apm-python
.riot/requirements/c8ba76f.txt                                          @DataDog/apm-python
.riot/requirements/e7a63a3.txt                                          @DataDog/apm-python
.riot/requirements/e8fbd30.txt                                          @DataDog/apm-python
.riot/requirements/fd6d189.txt                                          @DataDog/apm-python
ddtrace/contrib/integration_registry/README.md                          @DataDog/python-guild @DataDog/apm-core-python
ddtrace/contrib/integration_registry/__init__.py                        @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/integration_registry/_registry_schema.json              @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/integration_registry/mappings.py                        @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/integration_registry/registry.yaml                      @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/integration_registry/utils.py                           @DataDog/apm-core-python @DataDog/apm-idm-python
scripts/integration_registry/_format_integration_registry.py            @DataDog/apm-core-python
scripts/integration_registry/_update_integration_registry_versions.py   @DataDog/apm-core-python
scripts/integration_registry/update_and_format_registry.py              @DataDog/apm-core-python
tests/contrib/conftest.py                                               @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/__init__.py                          @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/conftest.py                          @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/registry_update_helpers/__init__.py  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/registry_update_helpers/integration_registry_manager.py  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/registry_update_helpers/integration_registry_updater.py  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/registry_update_helpers/integration_update_orchestrator.py  @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/test_external_dependencies.py        @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/test_registry_schema.py              @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/integration_registry/test_riotfile.py                     @DataDog/apm-core-python @DataDog/apm-idm-python
.gitlab/tests.yml                                                       @DataDog/python-guild @DataDog/apm-core-python
lib-injection/sources/min_compatible_versions.csv                       @DataDog/apm-core-python
min_compatible_versions.csv                                             @DataDog/apm-core-python
riotfile.py                                                             @DataDog/apm-python
scripts/freshvenvs.py                                                   @DataDog/apm-core-python
scripts/generate_table.py                                               @DataDog/apm-core-python
scripts/run-test-suite                                                  @DataDog/apm-core-python
supported_versions_output.json                                          @DataDog/apm-core-python
supported_versions_table.csv                                            @DataDog/apm-core-python
tests/contrib/celery/test_integration.py                                @DataDog/apm-core-python @DataDog/apm-idm-python
tests/contrib/pytest_bdd/test_pytest_bdd.py                             @DataDog/ci-app-libraries
tests/contrib/suitespec.yml                                             @DataDog/apm-core-python @DataDog/apm-idm-python
tests/internal/test_module.py                                           @DataDog/debugger-python @DataDog/apm-core-python
tests/suitespec.yml                                                     @DataDog/python-guild @DataDog/apm-core-python
.riot/requirements/103234b.txt                                          @DataDog/apm-python
.riot/requirements/1089a44.txt                                          @DataDog/apm-python
.riot/requirements/10c216c.txt                                          @DataDog/apm-python
.riot/requirements/11cd1a5.txt                                          @DataDog/apm-python
.riot/requirements/11e6ad6.txt                                          @DataDog/apm-python
.riot/requirements/11f9495.txt                                          @DataDog/apm-python
.riot/requirements/121fc8d.txt                                          @DataDog/apm-python
.riot/requirements/13180f0.txt                                          @DataDog/apm-python
.riot/requirements/132915c.txt                                          @DataDog/apm-python
.riot/requirements/132ab47.txt                                          @DataDog/apm-python
.riot/requirements/13ff868.txt                                          @DataDog/apm-python
.riot/requirements/1407476.txt                                          @DataDog/apm-python
.riot/requirements/14a4ad8.txt                                          @DataDog/apm-python
.riot/requirements/1611a53.txt                                          @DataDog/apm-python
.riot/requirements/16240ae.txt                                          @DataDog/apm-python
.riot/requirements/16cebb7.txt                                          @DataDog/apm-python
.riot/requirements/171cc7d.txt                                          @DataDog/apm-python
.riot/requirements/178199b.txt                                          @DataDog/apm-python
.riot/requirements/189028b.txt                                          @DataDog/apm-python
.riot/requirements/195a93b.txt                                          @DataDog/apm-python
.riot/requirements/19fca43.txt                                          @DataDog/apm-python
.riot/requirements/1a1efbd.txt                                          @DataDog/apm-python
.riot/requirements/1ac29e1.txt                                          @DataDog/apm-python
.riot/requirements/1b2137c.txt                                          @DataDog/apm-python
.riot/requirements/1b7c78f.txt                                          @DataDog/apm-python
.riot/requirements/1dfbbf5.txt                                          @DataDog/apm-python
.riot/requirements/1e77d23.txt                                          @DataDog/apm-python
.riot/requirements/1f4c63a.txt                                          @DataDog/apm-python
.riot/requirements/1f67448.txt                                          @DataDog/apm-python
.riot/requirements/2215008.txt                                          @DataDog/apm-python
.riot/requirements/2877cc1.txt                                          @DataDog/apm-python
.riot/requirements/2f08515.txt                                          @DataDog/apm-python
.riot/requirements/4c32dc0.txt                                          @DataDog/apm-python
.riot/requirements/50b70d9.txt                                          @DataDog/apm-python
.riot/requirements/5a79a6b.txt                                          @DataDog/apm-python
.riot/requirements/5eb6b4f.txt                                          @DataDog/apm-python
.riot/requirements/6f12901.txt                                          @DataDog/apm-python
.riot/requirements/70dec77.txt                                          @DataDog/apm-python
.riot/requirements/7179876.txt                                          @DataDog/apm-python
.riot/requirements/792f843.txt                                          @DataDog/apm-python
.riot/requirements/8567c69.txt                                          @DataDog/apm-python
.riot/requirements/8848464.txt                                          @DataDog/apm-python
.riot/requirements/a3b8bb8.txt                                          @DataDog/apm-python
.riot/requirements/a9b5fed.txt                                          @DataDog/apm-python
.riot/requirements/ad2a94e.txt                                          @DataDog/apm-python
.riot/requirements/c59d61b.txt                                          @DataDog/apm-python
.riot/requirements/d188248.txt                                          @DataDog/apm-python
.riot/requirements/d65551b.txt                                          @DataDog/apm-python
.riot/requirements/d78868d.txt                                          @DataDog/apm-python
.riot/requirements/e5e30b6.txt                                          @DataDog/apm-python
.riot/requirements/e6e4cca.txt                                          @DataDog/apm-python
.riot/requirements/fa67e31.txt                                          @DataDog/apm-python
.riot/requirements/fadb064.txt                                          @DataDog/apm-python

Copy link
Contributor

github-actions bot commented Apr 17, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 233 ± 2 ms.

The average import time from base is: 235 ± 2 ms.

The import time difference between this PR and base is: -1.9 ± 0.1 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 2.027 ms (0.87%)
ddtrace.bootstrap.sitecustomize 1.319 ms (0.57%)
ddtrace.bootstrap.preload 1.319 ms (0.57%)
ddtrace.internal.products 1.319 ms (0.57%)
ddtrace.internal.remoteconfig.client 0.627 ms (0.27%)
ddtrace 0.708 ms (0.30%)
ddtrace._logger 0.035 ms (0.01%)
logging 0.035 ms (0.01%)
traceback 0.035 ms (0.01%)
contextlib 0.035 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented Apr 17, 2025

Benchmarks

Benchmark execution time: 2025-04-24 21:32:37

Comparing candidate commit f174820 in PR branch conti/integration-registry-versioning with baseline commit 355dd87 in branch main.

Found 0 performance improvements and 5 performance regressions! Performance is the same for 491 metrics, 4 unstable metrics.

scenario:iast_aspects-format_map_aspect

  • 🟥 execution_time [+328.963ns; +449.592ns] or [+10.010%; +13.681%]

scenario:iast_aspects-modulo_aspect_for_bytes_bytearray

  • 🟥 execution_time [+73.260ns; +111.518ns] or [+7.103%; +10.812%]

scenario:iast_aspects-replace_aspect

  • 🟥 execution_time [+508.434ns; +670.924ns] or [+10.928%; +14.421%]

scenario:iast_aspects-swapcase_aspect

  • 🟥 execution_time [+180.128ns; +238.700ns] or [+7.316%; +9.695%]

scenario:telemetryaddmetric-1-distribution-metric-1-times

  • 🟥 execution_time [+276.749ns; +394.406ns] or [+9.375%; +13.361%]

@wconti27 wconti27 changed the title DRAFT Conti/integration registry versioning chore: add a registry for supported integrations Apr 23, 2025
@wconti27 wconti27 marked this pull request as ready for review April 23, 2025 14:58
@wconti27 wconti27 requested review from a team as code owners April 23, 2025 14:58
Copy link
Collaborator

@wantsui wantsui left a comment

Choose a reason for hiding this comment

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

🔥 LGTM - I left some nits but they shouldn't be blocking. (Though I think the README links should be fixed if possible).

Comment on lines +175 to +183
# UNCOMMENT TO RUN THE UPDATER LOCALLY, and comment out the above few lines, requires updating riotfile.py
# to include the following within the riot env:
# - "filelock"
# - "pyyaml"
# from tests.contrib.integration_registry.registry_update_helpers.integration_registry_updater import (
# IntegrationRegistryUpdater
# )
# updater = IntegrationRegistryUpdater()
# updater_succeeded = updater.run(data_file_path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Is it possible to have an environment variable for running it locally, that applies these changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because uncommenting this requires the user to add pyyaml and filelock to the riot dependencies for the venv suite they are running.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe call this out in the README if we can't make it an env var flag?

Copy link
Contributor

@erikayasuda erikayasuda left a comment

Choose a reason for hiding this comment

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

A few nits, otherwise LGTM 👍

Comment on lines +238 to +241
elif (
package in DEPENDENCY_TO_INTEGRATION_MAPPING
and DEPENDENCY_TO_INTEGRATION_MAPPING[package] == integration
):
Copy link
Contributor

Choose a reason for hiding this comment

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

Check if this is redundant with the previous check?

Comment on lines 112 to 116
min_final = min_v if min_v and min_v != "N/A" else None
max_final = max_v if max_v and max_v != "N/A" else None
if min_final is None and max_final is None:
return None
return {"min": min_final or "N/A", "max": max_final or "N/A"}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
min_final = min_v if min_v and min_v != "N/A" else None
max_final = max_v if max_v and max_v != "N/A" else None
if min_final is None and max_final is None:
return None
return {"min": min_final or "N/A", "max": max_final or "N/A"}
min_final = min_v if min_v and min_v != "N/A" else "N/A"
max_final = max_v if max_v and max_v != "N/A" else "N/A"
if min_final is "N/A" and max_final is "N/A":
return None
return {"min": min_final, "max": max_final}

Comment on lines 153 to 154
for entry in current_integrations:
if not isinstance(entry, dict):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe refactor so it's less nested?


@pytest.fixture(scope="module")
def riot_venv_names() -> set[str]:
"""Recursively finds all Venv names defined in riotfile.py."""
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
"""Recursively finds all Venv names defined in riotfile.py."""
"""Finds all Venv names defined in riotfile.py."""

- '@core'
- '@contrib'
- '@tracing'
- '@integration_registry'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you added this above?

* Runs [`scripts/integration_registry/_update_integration_registry_versions.py`](../../../scripts/integration_registry/_update_integration_registry_versions.py) to update the registry
* Formats the registry YAML for consistency

* NOTE: Manual script update does not guarantee that newly added patched dependencies (such as for a new integration) will be added to the registry.yaml. A full test run is required for this process.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm slightly confused by this. So running the script manually would only take the existing registry and update its values, but won't recognize that the riotfile has been updated with new tests/integrations?

Comment on lines +135 to +137
if entry.get("is_external_package") is True:
integration_name = entry.get("integration_name", "UNKNOWN_ENTRY")
dependency_names = entry.get("dependency_name", [])
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
if entry.get("is_external_package") is True:
integration_name = entry.get("integration_name", "UNKNOWN_ENTRY")
dependency_names = entry.get("dependency_name", [])
if not entry.get("is_external_package"):
continue
integration_name = entry.get("integration_name", "UNKNOWN_ENTRY")
dependency_names = entry.get("dependency_name", [])
...

Comment on lines +150 to +155
if not isinstance(dep_name, str) or not dep_name:
errors.append(
f"External integration '{integration_name}' has invalid item in dependency_name list: "
f"{dep_name}"
)
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this not guaranteed by the schema you're defining? 🤔

Comment on lines +175 to +183
# UNCOMMENT TO RUN THE UPDATER LOCALLY, and comment out the above few lines, requires updating riotfile.py
# to include the following within the riot env:
# - "filelock"
# - "pyyaml"
# from tests.contrib.integration_registry.registry_update_helpers.integration_registry_updater import (
# IntegrationRegistryUpdater
# )
# updater = IntegrationRegistryUpdater()
# updater_succeeded = updater.run(data_file_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe call this out in the README if we can't make it an env var flag?

contrib directory.
"""

UNTESTED_INTEGRATIONS = ["asynctest", "dbapi", "dbapi_async", "integration_registry", "gunicorn"]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should we just have these in some kind of const.py file so you only have to update one place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants