Skip to content

Commit

Permalink
Fix breaking label lookup (#588)
Browse files Browse the repository at this point in the history
* fix breaking label lookup

* patch bump

* fix tests
  • Loading branch information
IanButterworth authored Dec 18, 2024
1 parent f1b87a6 commit 3dde8c5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 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 <[email protected]>", "Fredrik Ekre <[email protected]>", "contributors"]
version = "10.10.1"
version = "10.10.2"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
1 change: 1 addition & 0 deletions src/AutoMerge/cron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ using GitHub: GitHub

const OVERRIDE_BLOCKS_LABEL = "Override AutoMerge: ignore blocking comments"
const BLOCKED_LABEL = "AutoMerge: last run blocked by comment"
const BREAKING_LABEL = "BREAKING"

function all_specified_statuses_passed(
api::GitHub.GitHubAPI,
Expand Down
2 changes: 1 addition & 1 deletion src/AutoMerge/guidelines.jl
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function breaking_explanation_message(has_release_notes)
end

function meets_breaking_explanation_check(labels::Vector, body::AbstractString)
if any(==("BREAKING"), labels)
if has_label(labels, BREAKING_LABEL)
release_notes = get_release_notes(body)
if release_notes === nothing
msg = breaking_explanation_message(false)
Expand Down
10 changes: 5 additions & 5 deletions test/automerge-unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ end
<!-- END RELEASE NOTES -->
"""
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]
breaking_label = GitHub.Label(; name="BREAKING")
@test AutoMerge.meets_breaking_explanation_check([breaking_label], body_good)[1]
@test AutoMerge.meets_breaking_explanation_check([breaking_label], body_good_changelog)[1]
@test !AutoMerge.meets_breaking_explanation_check([breaking_label], body_bad)[1]
@test !AutoMerge.meets_breaking_explanation_check([breaking_label], body_bad_no_notes)[1]

# Maybe this should fail as the label isn't applied by JuliaRegistrator, so the version isn't breaking?
@test AutoMerge.meets_breaking_explanation_check([], body_good)[1]
Expand Down

2 comments on commit 3dde8c5

@IanButterworth
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/121627

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.2 -m "<description of version>" 3dde8c538bcc65ad720799e4b537473e6880629d
git push origin v10.10.2

Please sign in to comment.