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

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

Closed
laeubi opened this issue Aug 14, 2024 · 4 comments · Fixed by #3057
Closed

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

laeubi opened this issue Aug 14, 2024 · 4 comments · Fixed by #3057
Labels
bug Something isn't working

Comments

@laeubi
Copy link

laeubi commented Aug 14, 2024

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
@peter-evans
Copy link
Owner

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
Copy link
Owner

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 peter-evans added the bug Something isn't working label Aug 14, 2024
@timteka
Copy link

timteka commented Aug 27, 2024

@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 ((

@peter-evans peter-evans mentioned this issue Aug 28, 2024
39 tasks
@peter-evans
Copy link
Owner

This now has a fix in the upcoming v7 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants