Skip to content

Commit

Permalink
Fix gitlab configuration check to not crash on job without rules (#29558
Browse files Browse the repository at this point in the history
)
  • Loading branch information
KevinFairise2 authored and grantseltzer committed Oct 4, 2024
1 parent cb780f7 commit 147b4a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ def contains_valid_change_rule(rule):
tests_without_change_path = defaultdict(list)
tests_without_change_path_allowed = defaultdict(list)
for test, filepath in tests:
if not any(contains_valid_change_rule(rule) for rule in config[test]['rules'] if isinstance(rule, dict)):
if "rules" in config[test] and not any(
contains_valid_change_rule(rule) for rule in config[test]['rules'] if isinstance(rule, dict)
):
if test in tests_without_change_path_allow_list:
tests_without_change_path_allowed[filepath].append(test)
else:
Expand Down

0 comments on commit 147b4a5

Please sign in to comment.