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

fix: detect mergify is enabled with new mergebox #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MattSturgeon
Copy link

The <a href="/apps/mergify"> element is not present in the new mergebox, however the mergify icon is present in both mergeboxes.

Fixes #29 (for real)

The `<a href="/apps/mergify">` element is not present in the new
mergebox, however the mergify icon is present in both mergeboxes.
Copy link
Contributor

mergify bot commented Dec 21, 2024

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Changelog requirements

Wonderful, this rule succeeded.
  • any of:
    • -title ~= ^feat
    • label = need changelog
    • label = skip changelog

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

@MattSturgeon
Copy link
Author

MattSturgeon commented Dec 21, 2024

Interestingly this fix isn't always needed.

If the @mergify app has commented on the PR, then document.querySelector('a[href="/apps/mergify"]') will match the icon next to the comment.

Therefore, even without the fix, I see the icons added in this PR, because of #32 (comment).

However if the app has not commented on the PR, there will be no matching <a> tags, since the new mergebox does not wrap the status-check app-icons with links.

Regardless, explicitly checking if the icon is present on the page is more robust and handles both mergeboxes, regardless of whether comments are present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support GitHub's preview mergebox ("new merge experience")
1 participant