Skip to content

Commit

Permalink
allow changelog in breaking changes req (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericphanson authored Dec 17, 2024
1 parent 7eda9e9 commit f1b87a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
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

2 comments on commit f1b87a6

@ericphanson
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/121586

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v10.10.1 -m "<description of version>" f1b87a6f2b29f8f1129bced7b22d5586ca21e608
git push origin v10.10.1

Please sign in to comment.