From 1939e585c0c209b4b1790c1d1340a3adc6f804da Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 26 Jan 2023 13:03:12 +0100 Subject: [PATCH 1/2] danger: update CHANGES rule to work with -S edition When updating the -S edition, the CHANGES.SE file is modified. Make sure danger accepts that. --- dangerfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dangerfile.py b/dangerfile.py index 6d80db4d24..f706d58389 100644 --- a/dangerfile.py +++ b/dangerfile.py @@ -288,7 +288,7 @@ elif not approved: # * The merge request adds a new CHANGES entry that is not a placeholder and # does not contain any GitLab/RT issue/MR identifiers. -changes_modified = "CHANGES" in modified_files +changes_modified = "CHANGES" in modified_files or "CHANGES.SE" in modified_files no_changes_label_set = "No CHANGES" in mr_labels if not changes_modified and not no_changes_label_set: fail( @@ -301,7 +301,7 @@ if changes_modified and no_changes_label_set: "Revert `CHANGES` modifications or unset the *No Changes* label." ) -changes_added_lines = added_lines(target_branch, ["CHANGES"]) +changes_added_lines = added_lines(target_branch, ["CHANGES", "CHANGES.SE"]) placeholders_added = lines_containing(changes_added_lines, "[placeholder]") identifiers_found = filter(changes_issue_or_mr_id_regex.search, changes_added_lines) if changes_added_lines: From 79ae467973fc2d97eadf3c038ef892f7e40e0f0a Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Thu, 26 Jan 2023 13:04:40 +0100 Subject: [PATCH 2/2] danger: relax rules for single-line commits The following are not also accepted as single-line commits without generating warnings: - CHANGES/release note may appear in the beginning of the commit message - Release note may be capitalized - Allow commits with "GL #" (e.g. Update documentation for [GL #XXXX]) --- dangerfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dangerfile.py b/dangerfile.py index f706d58389..925d0a4214 100644 --- a/dangerfile.py +++ b/dangerfile.py @@ -127,8 +127,9 @@ for commit in danger.git.commits: if ( len(message_lines) < 3 and "fixup! " not in subject - and " CHANGES " not in subject - and " release note" not in subject + and "CHANGES " not in subject + and "release note" not in subject.lower() + and "GL #" not in subject ): warn(f"Please write a log message for commit {commit.sha}.") for line in message_lines[2:]: