Reordering history can accidentally "merge" an intermediate PR in `--direct` mode
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
調査の方向性
提供された foo.sh スクリプトを使い、ghstack --direct と origin/main に対する対話的な並べ替えの繰り返しによって失敗を再現します。並べ替えに関係する stack の更新と GitHub PR のステータス変更を追跡します。2 番目と 3 番目のコミットの入れ替えを繰り返しても中間の PR が merged としてマークされなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Haven't put a lot of time into understanding this one, was just trying to evaluate ghstack for work on LLVM. The issue was that while editing and reordering commits, one of their PRs was automatically marked "Merged", when I had not merged anything. I assume this is due to the lack of an atomic way to update base branches for several PRs at once, but unsure the exact cause.
Simplest way to reproduce turned out to be to just swap the position of two commits in a stack repeatedly:
#!/bin/bash
stack() {
ghstack --direct || return 1
# attempt to rule out racing against a slow GH or something, doesn't seem to
# matter, and I hit the bug originally while just using the tool by-hand
#sleep 10
}
swap2() {
# swap the 2nd and 3rd `pick` lines in the interactive rebase buffer
GIT_EDITOR='printf "%s\n" 2y 2d x w | ed -s' git rebase -i origin/main
}
init() {
for n in $(seq 4); do
echo $n >> $n && git add -A && git commit -m $n || return 1
done
}
whirl() {
# seems to pretty regularly break on round 3, but add plenty to be sure.
# not actually clear to me if this is deterministic or not
for n in $(seq 10); do
stack && swap2 || {
printf 'failed on round %d\n' $n
return 1
}
done
}
main() {
init && whirl
}
"$@"
Can run as foo.sh main to have it build a short stack and then start swapping and restacking until it breaks.
If there is more info I can share, let me know. I only spent enough time to be sure I wasn't just holding it wrong.
- 主要言語
- Python
- スター
- 1k
- フォーク
- 84
- 平均マージ
- 10分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ezyang/ghstack のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
[Bug]: Importing weave changes the process-wide locale対応中かも @himanshu748 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
UX
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
mediajunkie/piper-morgan-product#2008 · コメント 2 件 ·