fail on broken metadata.yaml (#21920)
Fotis Voutsas committed
Mar 9, 2026 at 12:16 UTC
c8ffe63845956db778d32d9222e05e12da901400
2 files changed
+18
-2
integrations/gen_integrations.py
+18
@@ -103,6 +103,7 @@ FIXUP_BLANK_PATTERN = re.compile('\\\\\\n *\\n')
103
104
GITHUB_ACTIONS = os.environ.get('GITHUB_ACTIONS', False)
105
DEBUG = os.environ.get('DEBUG', False)
106
+WARNINGS = []
107
108
109
def debug(msg):
@@ -115,12 +116,27 @@ def debug(msg):
116
117
118
def warn(msg, path):
119
+ WARNINGS.append((str(path), msg))
120
+
121
if GITHUB_ACTIONS:
122
print(f':warning file={path}:{msg}')
123
else:
124
print(f'!!! WARNING:{path}:{msg}')
125
126
127
+def fail_on_warnings():
128
+ if not WARNINGS:
129
+ return 0
130
+
131
+ warned_files = sorted({path for path, _ in WARNINGS})
132
+ print(f':error:Integrations generation failed with {len(WARNINGS)} warning(s) across {len(warned_files)} file(s).')
133
+
134
+ for path in warned_files:
135
+ print(f':error file={path}:Metadata warnings in this file are now fatal for integrations generation.')
136
+
137
+ return 1
138
+
139
+
140
def retrieve_from_filesystem(uri):
141
path = SCHEMA_PATH / Path(uri)
142
contents = json.loads(path.read_text())
@@ -1077,6 +1093,8 @@ def main():
1093
clean_integrations = clean_collectors + clean_deploy + clean_exporters + clean_agent_notifications + clean_cloud_notifications + clean_logs + clean_authentications
1094
render_json(categories, clean_integrations)
1095
1096
+ return fail_on_warnings()
1097
+
1098
1099
if __name__ == '__main__':
1100
sys.exit(main())
src/go/plugin/scripts.d/modules/scheduler/metadata.yaml
-2
@@ -15,8 +15,6 @@ modules:
15
list:
16
- plugin_name: scripts.d.plugin
17
module_name: nagios
18
- - plugin_name: scripts.d.plugin
19
- module_name: zabbix
18
info_provided_to_referring_integrations:
19
description: ""
20
keywords: