From f1b87a6f2b29f8f1129bced7b22d5586ca21e608 Mon Sep 17 00:00:00 2001 From: Eric Hanson <5846501+ericphanson@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:19:37 +0100 Subject: [PATCH] allow changelog in breaking changes req (#587) --- Project.toml | 2 +- src/AutoMerge/guidelines.jl | 6 +++--- test/automerge-unit.jl | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 0aabcb85..c4e34b1e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RegistryCI" uuid = "0c95cc5f-2f7e-43fe-82dd-79dbcba86b32" authors = ["Dilum Aluthge ", "Fredrik Ekre ", "contributors"] -version = "10.10.0" +version = "10.10.1" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/src/AutoMerge/guidelines.jl b/src/AutoMerge/guidelines.jl index 0044a6c8..8ac337ee 100644 --- a/src/AutoMerge/guidelines.jl +++ b/src/AutoMerge/guidelines.jl @@ -8,7 +8,7 @@ using HTTP: HTTP const _AUTOMERGE_REQUIRE_STDLIB_COMPAT = false const guideline_registry_consistency_tests_pass = Guideline(; - info="Registy consistency tests", + info="Registry consistency tests", docs=nothing, check=data -> meets_registry_consistency_tests_pass(data.registry_head, data.registry_deps), @@ -325,7 +325,7 @@ end # This check checks for an explanation of why a breaking change is breaking const guideline_breaking_explanation = Guideline(; info = "Release notes have not been provided that explain why this is a breaking change.", - docs = "If this is a breaking change, release notes must be given that explain why this is a breaking change (i.e. mention \"breaking\"). To update the release notes, please see the \"Providing and updating release notes\" subsection under \"Additional information\" below.", + docs = "If this is a breaking change, release notes must be given that explain why this is a breaking change (i.e. mention \"breaking\" or \"changelog\"). To update the release notes, please see the \"Providing and updating release notes\" subsection under \"Additional information\" below.", check=data -> meets_breaking_explanation_check(data)) function meets_breaking_explanation_check(data::GitHubAutoMergeData) @@ -374,7 +374,7 @@ function meets_breaking_explanation_check(labels::Vector, body::AbstractString) if release_notes === nothing msg = breaking_explanation_message(false) return false, msg - elseif !occursin(r"breaking", lowercase(release_notes)) + elseif !occursin(r"breaking|changelog", lowercase(release_notes)) msg = breaking_explanation_message(true) return false, msg else diff --git a/test/automerge-unit.jl b/test/automerge-unit.jl index 1eba11de..08d4fcac 100644 --- a/test/automerge-unit.jl +++ b/test/automerge-unit.jl @@ -334,6 +334,13 @@ end ````` """ + body_good_changelog = """ + + ````` + See the changelog at xyz for a list of changes. + ````` + + """ body_bad = """ ````` @@ -346,6 +353,7 @@ end body_bad_no_notes = "" @test AutoMerge.meets_breaking_explanation_check(["BREAKING"], body_good)[1] + @test AutoMerge.meets_breaking_explanation_check(["BREAKING"], body_good_changelog)[1] @test !AutoMerge.meets_breaking_explanation_check(["BREAKING"], body_bad)[1] @test !AutoMerge.meets_breaking_explanation_check(["BREAKING"], body_bad_no_notes)[1]