cirrus-actions / rebase

GitHub Action to automatically rebase PRs
MIT License
682 stars 138 forks source link

GitHub doesn't think that the PR is rebaseable! #72

Closed bgrosse-midokura closed 3 years ago

bgrosse-midokura commented 3 years ago

But locally I can do git rebase origin/master just fine:

Successfully rebased and updated refs/heads/my-cool-branch.
fkorotkov commented 3 years ago

Did you comment /rebase just after creating the PR?

bgrosse-midokura commented 3 years ago

no, the PR was "based on" another PR, which had been merged just before.

PR in question (PR2):

c1 - in PR1, PR2
c2 - in PR1, PR2
c3 - in PR2
c4 - in PR2

PR1 had been merged, with "Rebase and merge" button of github. I just checked and github rewrites the date and committer (not author) to something like 48123182+yourgithubusername@users.noreply.github.com and thus the sha1s differ. However, CLI git seems smart enough to treat those commits as the same.

nzjony commented 3 years ago

I have a similar issue with this PR: https://github.com/heremaps/harp.gl/pull/2050

The GitHub API says it isn't rebasable, see:

Screenshot 2021-02-03 at 10 27 43

However locally, it is no problem to rebase, i.e. in a fresh checkout:

🕙 10:38:08 ❯ git clone git@github.com:heremaps/harp.gl.git harp.gl5
Cloning into 'harp.gl5'...
remote: Enumerating objects: 66, done.
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 29351 (delta 29), reused 27 (delta 13), pack-reused 29285
Receiving objects: 100% (29351/29351), 114.37 MiB | 3.57 MiB/s, done.
Resolving deltas: 100% (23809/23809), done.

~/dev 
🕙 10:39:07 ❯ cd harp.gl5

harp.gl5 on 🌱master 
🕙 10:39:12 ❯ git checkout origin/json-schema-for-flat-themes
Note: switching to 'origin/json-schema-for-flat-themes'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

.... <blah blah blah>

harp.gl5 on 🌱HEAD (58941be) 
🕙 10:39:16 ❯ git pull origin master --rebase
From github.com:heremaps/harp.gl
 * branch              master     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Generate a JSON schema for both the legacy and the new flat theme format

Any idea why Github reports it as not rebaseable? Second question, why can't we just try to rebase, even if it isn't rebaseable?

nzjony commented 3 years ago

I did another test a local fork, with a conflict, and this time the rebaseable flag was false (because of the conflict).

Screenshot 2021-02-03 at 10 45 38

See: https://github.com/nzjony/harp.gl/runs/1821439904?check_suite_focus=true triggered from: https://github.com/nzjony/harp.gl/pull/12

Does anyone know the difference between rebaseable:false and rebaseable:null?

fkorotkov commented 3 years ago

null is when GitHub hasn't yet run an async job to figure out if it's rebaseable. But it should be calculated within seconds after pushin/creating a PR.

nzjony commented 3 years ago

Thanks @fkorotkov for clarifying, in this case, the PR was quite old, my colleague had tried to rebased after 21 days, maybe the value gets stale after some time?

But I tried it just now, and the rebase worked... so something strange on the Github side.

nzjony commented 3 years ago

@fkorotkov , if it is null, instead of exiting with exit 1, it would make more sense to try again after some threshold?