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

[upload] Prs get auto-closed when changes are reordered sometimes #170

Open
jerry-skydio opened this issue Mar 14, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@jerry-skydio
Copy link
Collaborator

This seems to happen when two PRs are in a relative chain and their order is swapped.

I think we can do something tricky where we push a temporary intermediate fake commit to break dependencies then push again to send the real changes. ghstack does something similar here ezyang/ghstack#23

@jerry-skydio jerry-skydio added the bug Something isn't working label Mar 14, 2024
@jerry-skydio
Copy link
Collaborator Author

Fixing the reordering problem

< A < B < C < D
A
A < B
A < B < C
A < B < C < D

D < o
D < B < o
D < B < C ok
D < B < C < A ok

Detecting whether changes in a series got reordered

(Do this only if any base changed? might be ok to always do it)
Just look through all reviews. take prev base ref name (prinfo), if that is equal to prinfo.headref for any children (recursive) then mark
this review as needs workaround.

Equivalently, take prinfo.headref for every review. If that is equal to baseref for any review in relatives, mark that relative review as
needing workaroud.

You can also do the equivalent with only one traversal -- just start at the leaves and maintain a set -- probably not worth extra effort given we don't store leaf info

Preventing github destruction when pushing reordered changes

  • Add a dummy commit to each marked change
  • Push, update github, then push again removing the dummy commit

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

No branches or pull requests

1 participant