Skip to content

Commit

Permalink
Rebase with master
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTChen committed Aug 18, 2021
1 parent 04fb807 commit a973f82
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

import click

from datadog_checks.dev.utils import print_github_annotation

from ....utils import read_file
from ...testing import process_checks_option
from ...utils import complete_valid_checks, get_assets_from_manifest, get_manifest_file
from ..console import CONTEXT_SETTINGS, abort, echo_failure, echo_info, echo_success
from ...annotations import annotate_error

REQUIRED_ATTRIBUTES = {"description", "template_variables", "widgets"}
DASHBOARD_ONLY_FIELDS = {"layout_type", "title", "created_at"}
Expand Down Expand Up @@ -56,7 +55,7 @@ def dashboards(check):
echo_info(' FAILED')
echo_failure(' ' + message)
failed_checks += 1
print_github_annotation(manifest_file, message)
annotate_error(manifest_file, message)

for dashboard_file in dashboard_relative_locations:
try:
Expand All @@ -67,7 +66,7 @@ def dashboards(check):
echo_info(f'{check_name}... ', nl=False)
echo_failure(' FAILED')
echo_failure(' ' + message)
print_github_annotation(dashboard_file, message)
annotate_error(dashboard_file, message)
continue

all_keys = set(decoded.keys())
Expand All @@ -77,15 +76,15 @@ def dashboards(check):
display_queue.append(
(echo_failure, f" {dashboard_file} does not contain the required fields: {missing_fields}"),
)
print_github_annotation(dashboard_file, "Detected missing required fields: {}".format(missing_fields))
annotate_error(dashboard_file, "Detected missing required fields: {}".format(missing_fields))

# Confirm the dashboard payload comes from the old API for now
if not _is_dashboard_format(decoded):
file_failed = True
display_queue.append(
(echo_failure, f' {dashboard_file} is not using the new /dashboard payload format.'),
)
print_github_annotation(dashboard_file, "This dashboard payload is not using the new /dashboard format")
annotate_error(dashboard_file, "This dashboard payload is not using the new /dashboard format")

if file_failed:
failed_checks += 1
Expand Down

0 comments on commit a973f82

Please sign in to comment.