Skip to content
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

Skip metadata validation for non-metrics integrations. #14211

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def metadata(check, check_duplicates, show_warnings):

# only abort if we have an integration and require a manifest file
manifest = Manifest.load_manifest(check)
if manifest.has_integration():
if manifest.has_metrics_integration():
abort(f'Metadata file for {check} not found.')

errors = False
Expand All @@ -297,8 +297,8 @@ def metadata(check, check_duplicates, show_warnings):

# get any manifest info needed for validation - and skip if no integration included in manifest
manifest = Manifest.load_manifest(current_check)
if not manifest.has_integration():
echo_success(f"Skipping {check} - metadata not required since this check doesn't contain an integration.")
if not manifest.has_metrics_integration():
echo_success(f"Skipping {check} - not validating metadata since this check's manifest doesn't contain a metrics section.")
continue

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,6 @@ def get_config_spec(self):

def has_integration(self):
return self._manifest_json.get_path("/assets/integration") is not None

def has_metrics_integration(self):
return self._manifest_json.get_path("/assets/integration/metrics") is not None