create-pull-request icon indicating copy to clipboard operation
create-pull-request copied to clipboard

PR is not updated even there are changes after new incoming changes on master

Open laeubi opened this issue 1 year ago • 2 comments
trafficstars

Subject of the issue

While previously it has worked to update a PR, now the file itself changed in master the PR is not updated and the action claims everything is even.

Steps to reproduce

I have an action here is has run and created a PR successful (:+1: ) that I have replayed because of infra issue and the PR was updated (:+1: ).

Then we have split and merged a part of it and I replayed it again but now it claims that nothing is to do and the PR is even with master.

I see the following issues

  1. According to the docs I would have expected that the PR is closed if nothing is needed anymore but the PR is still open
  2. I'm quite sure from the log output that there actually are changes:

The Maven log reports:

[INFO] update Dependency {groupId=jakarta.inject, artifactId=jakarta.inject-api, version=[,3-alpha), type=jar} to version 2.0.1.MR

The Action itself reports:

 M eclipse.platform.releng.prereqs.sdk/eclipse-sdk-prereqs.target
 Uncommitted changes found. Adding a commit.
 1 file changed, 1 insertion(+), 1 deletion(-)

but in the end it tells

 Branch 'update_target' is even with its remote and will not be updated

laeubi avatar Aug 14 '24 08:08 laeubi

Hi @laeubi

This is very strange because it looks like this run ran against the correct commit on master with the changes you merged.

The action thinks there is no diff between the changes that were made during the workflow and the update_target branch. To check this, you could add a step to the workflow just before the action runs:

- run: git --no-pager diff

Effectively, the action should rebase changes when creates a commit. So I'm confused why this has happened.

peter-evans avatar Aug 14 '24 09:08 peter-evans

Oh wait. I see what's happening now. I think you've run into an edge case that I've not considered. Partially merging content from within a single commit.

There is no overall diff, that is correct. There is, however, a diff for that specific commit on the branch. I need to make a test for this and find a way to catch this edge case.

You can fix this by just deleting the update_target branch and running the workflow again. It will recreate the branch with any remaining diff.

peter-evans avatar Aug 14 '24 09:08 peter-evans

@peter-evans Dear Peter, seems like that's my case. I've created a trigger workflow with matrix, it runs properly twice, temporarily creates new files per each run, but... only 1 file in commit in PR by the end of run. Aaah, I got it. The subsequent iterations through the matrix replaces previous changes ((

timteka avatar Aug 27 '24 10:08 timteka

This now has a fix in the upcoming v7 release.

peter-evans avatar Aug 28 '24 16:08 peter-evans