Skip to content

Commit 0af05f0

Browse files
committed
Stop relying on manifest.json to validate spec.yaml
1 parent d3aec8d commit 0af05f0

File tree

4 files changed

+14
-164
lines changed

4 files changed

+14
-164
lines changed

datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from ...config_validator.validator_errors import SEVERITY_ERROR, SEVERITY_WARNING
1313
from ...configuration import ConfigSpec
1414
from ...configuration.consumers import ExampleConsumer
15+
from ...constants import get_root
1516
from ...manifest_utils import Manifest
1617
from ...testing import process_checks_option
1718
from ...utils import complete_valid_checks, get_config_files, get_data_directory, get_version_string
@@ -67,7 +68,7 @@ def config(ctx, check, sync, verbose):
6768
echo_debug(f"Skipping validation for check: {check}; can't process manifest")
6869
continue
6970

70-
spec_file_path = manifest.get_config_spec()
71+
spec_file_path = path_join(get_root(), check, 'assets', 'configuration', 'spec.yaml')
7172
if not file_exists(spec_file_path):
7273
example_location = get_data_directory(check)
7374

datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/models.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from ...configuration import ConfigSpec
1717
from ...configuration.consumers import ModelConsumer
1818
from ...constants import get_root
19-
from ...manifest_utils import Manifest
2019
from ...testing import process_checks_option
2120
from ...utils import (
2221
CUSTOM_FILES,
@@ -31,7 +30,6 @@
3130
abort,
3231
annotate_display_queue,
3332
annotate_error,
34-
echo_debug,
3533
echo_failure,
3634
echo_info,
3735
echo_success,
@@ -108,11 +106,7 @@ def models(ctx, check, sync, verbose):
108106
source = 'test'
109107
version = '0.0.1'
110108
else:
111-
manifest = Manifest.load_manifest(check)
112-
if not manifest:
113-
echo_debug(f"Skipping validation for check: {check}; can't process manifest")
114-
continue
115-
spec_path = manifest.get_config_spec()
109+
spec_path = path_join(root, check, 'assets', 'configuration', 'spec.yaml')
116110
if not file_exists(spec_path):
117111
continue
118112

datadog_checks_dev/datadog_checks/dev/tooling/configuration/spec.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ def spec_validator(spec: dict, loader) -> None:
1010
loader.errors.append(f'{loader.source}: Configuration specifications must be a mapping object')
1111
return
1212

13-
if 'name' not in spec:
14-
loader.errors.append(f'{loader.source}: Configuration specifications must contain a top-level `name` attribute')
15-
return
16-
17-
name = spec['name']
18-
if not isinstance(name, str):
19-
loader.errors.append(f'{loader.source}: The top-level `name` attribute must be a string')
20-
return
21-
2213
release_version = spec.setdefault('version', loader.version)
2314
if not release_version:
2415
loader.errors.append(

0 commit comments

Comments
 (0)