Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow "changelog" in release notes for breaking changelog guideline #587

Merged
merged 1 commit into from
Dec 17, 2024
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 Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RegistryCI"
uuid = "0c95cc5f-2f7e-43fe-82dd-79dbcba86b32"
authors = ["Dilum Aluthge <dilum@aluthge.com>", "Fredrik Ekre <ekrefredrik@gmail.com>", "contributors"]
version = "10.10.0"
version = "10.10.1"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
6 changes: 3 additions & 3 deletions src/AutoMerge/guidelines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/automerge-unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ end
`````
<!-- END RELEASE NOTES -->
"""
body_good_changelog = """
<!-- BEGIN RELEASE NOTES -->
`````
See the changelog at xyz for a list of changes.
`````
<!-- END RELEASE NOTES -->
"""
body_bad = """
<!-- BEGIN RELEASE NOTES -->
`````
Expand All @@ -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]

Expand Down
Loading