Skip to content

Run PR Build based on merge commit #452

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

Merged
merged 2 commits into from
Mar 30, 2023
Merged

Conversation

aholstrup1
Copy link
Collaborator

Sometimes it can be an issue that the PR Build is not running with the latest changes from the base branch. This build https://github.com/microsoft/ALAppExtensions/actions/runs/4500507606 is complaining about breaking changes even though, the PR doesn't touch the SignedXml codeunit. The issue here is that the head branch doesn't contain all the latest changes from the base branch.

A fix for this could be to use the merge branch created by GitHub since it contains the changes from both head and base branch.

@aholstrup1 aholstrup1 requested review from a team as code owners March 24, 2023 15:01
@freddydk
Copy link
Contributor

freddydk commented Mar 26, 2023

Does this always exist when creating a PR?
What happens if there are merge conflicts?

Copy link
Collaborator

@mazhelez mazhelez left a comment

Choose a reason for hiding this comment

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

Nice one!

@aholstrup1
Copy link
Collaborator Author

The ref should always exist, unless the PR is created with a merge conflict. Once the merge conflict is resolved, the ref will be created.

Once the ref is created it is updated on every push into the head branch, unless there are merge conflicts between the head and base branch. Once the merge conflicts are resolved it will again contain the latest changes from the head branch and the base branch.

If there are merge conflicts, the default behavior of the pull_request_target trigger is to trigger a build anyway. Once/if we switch to the pull_request trigger, a workflow won't be submitted until the merge conflict is resolved (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).

@freddydk
Copy link
Contributor

The ref should always exist, unless the PR is created with a merge conflict. Once the merge conflict is resolved, the ref will be created.

Once the ref is created it is updated on every push into the head branch, unless there are merge conflicts between the head and base branch. Once the merge conflicts are resolved it will again contain the latest changes from the head branch and the base branch.

If there are merge conflicts, the default behavior of the pull_request_target trigger is to trigger a build anyway. Once/if we switch to the pull_request trigger, a workflow won't be submitted until the merge conflict is resolved (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).

So, what happens right now (with PR_target) if there is a PR conflict?
What is the experience?

@aholstrup1
Copy link
Collaborator Author

GitHub will show a warning in the PR about merge conflicts, but it will still trigger the PR Build. The PR Build will run directly on the head branch, so the build won't be affected by the merge conflict.

@freddydk freddydk merged commit 049bb7e into main Mar 30, 2023
@freddydk freddydk deleted the aholstrup/merge_pr_with_base branch March 30, 2023 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants