Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
/d:sonar.token="$SONAR_TOKEN" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.exclusions="**/bin/**,**/obj/**,docs/**" \
/d:sonar.coverage.exclusions="Pulse/PulseModSystem.cs,Pulse.Otlp/PulseOtlpModSystem.cs,Pulse/EngineProbe.cs" \
/d:sonar.coverage.exclusions="Pulse/PulseModSystem.cs,Pulse.Otlp/PulseOtlpModSystem.cs,Pulse/EngineProbe.cs,contrib/**,tools/**" \
/d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml"

- name: Build
Expand Down
17 changes: 17 additions & 0 deletions contrib/grafana/check-dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@
"""

import json
import pathlib
import sys

COLUMNS = 24

# The dashboards this script exists to check live in the repository, so that is
# the only place it will read from: a stray argument cannot walk it out to an
# arbitrary file.
REPO = pathlib.Path(__file__).resolve().parent.parent.parent


def inside_repo(path):
try:
return pathlib.Path(path).resolve().is_relative_to(REPO)
except OSError:
return False


def panels(dashboard):
"""Every panel with a flag for whether it sits on the dashboard's own grid.
Expand Down Expand Up @@ -81,6 +94,10 @@ def main(paths):

failed = False
for path in paths:
if not inside_repo(path):
print(f"{path}: outside the repository, refusing to read it")
failed = True
continue
try:
problems = check(path)
except (OSError, json.JSONDecodeError) as e:
Expand Down
Loading