Thanks to visit codestin.com
Credit goes to github.com

Skip to content

update-pr-from-base-branch - Fix wrong position when check failed #8410

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

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

Conversation

kovsu
Copy link
Member

@kovsu kovsu commented Apr 17, 2025

Test URLs

#8407

Screenshot

Before:

CleanShot 2025-04-17 at 15 06 03

After:

image

@@ -115,9 +115,11 @@ async function addButton(mergeBar: Element): Promise<void> {
</div>,
);
} else {
// We need to create a new row when `Checks` is present
const checkFailed = $optional('[aria-label="Checks"]');
Copy link
Member Author

Choose a reason for hiding this comment

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

If we add this in mergeabilityRow, we will get this. So obviously we need a new row.

image

Copy link
Member

@fregante fregante Apr 17, 2025

Choose a reason for hiding this comment

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

This check seems rather arbitrary, the issue is that we use .before() on the wrong element. I think just mergeBar needs to be update and then maybe use .prepend()

The comment also mentions "old view PR" so maybe the check is failing altogether? According to the existing code, this line should not be reached at all.

Also after this PR it would be great to see pr-commit working again

Copy link
Member

Choose a reason for hiding this comment

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

Feel free to drop old code and just work on the new version. The widget is already complex as is, we don't need to be slowed down by GitHub Enterprise.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't have this [aria-label="Conflicts"] if check faild. But if check passed, we will get [aria-label="Conflicts"].

Copy link
Member

Choose a reason for hiding this comment

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

I'm seeing it in mozilla/addons-linter#5426, I don’t think the two things are related

Screenshot 1 Screenshot 2

Copy link
Member

Choose a reason for hiding this comment

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

I don’t think the two things are related

I think the opposite is true: if there are conflicts, the button appears, but the checks don't run on pull_request events

Copy link
Member Author

Choose a reason for hiding this comment

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

I don’t think the two things are related

I mean if there has Conflict row, we just need to add a update branch button here. But if we don't have this row, we have to creat a new row here.

Copy link
Member

Choose a reason for hiding this comment

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

If there's a "resolve conflicts" button, the feature must be disabled. That button is already an "update branch" config

Copy link
Member Author

Choose a reason for hiding this comment

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

Google.Chrome.mp4

@kovsu
Copy link
Member Author

kovsu commented Apr 18, 2025

Check Failed Check Passed
No Conflict CleanShot 2025-04-18 at 08 38 36 CleanShot 2025-04-18 at 08 37 50

When the PR has conflicts the feature will return early.

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.

2 participants