library icon indicating copy to clipboard operation
library copied to clipboard

CI を直す

Open beet-aizu opened this issue 1 year ago • 14 comments

github actions からの自動 push と protected branch の相性が悪すぎる

beet-aizu avatar May 04 '23 16:05 beet-aizu

@ei1333 @Luzhiled https://github.com/luzhiled1333/comp-library ってどうしてますか

beet-aizu avatar May 04 '23 16:05 beet-aizu

INFO:onlinejudge_verify.main:$ git add .verify-helper/timestamps.remote.json && git commit && git push
[master 0ed9221b] [auto-verifier] verify commit 292eaddb2789d3429032b9843aa9e05028783005
 1 file changed, 2 insertions(+), 2 deletions(-)
remote: Resolving deltas:   0% (0/3)        
remote: Resolving deltas:  33% (1/3)        
remote: Resolving deltas:  66% (2/3)        
remote: Resolving deltas: 100% (3/3)        
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.        
remote: error: GH006: Protected branch update failed for refs/heads/master.        
remote: error: Changes must be made through a pull request. Required status check "build" is expected.        
To https://github.com/beet-aizu/library.git
 ! [remote rejected]   HEAD -> master (protected branch hook declined)
error: failed to push some refs to 'https://github.com/beet-aizu/library.git'
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.3/x64/bin/oj-verify", line 8, in <module>
    sys.exit(main())

https://github.com/beet-aizu/library/actions/runs/4881444691/jobs/8718638237#step:5:1416

beet-aizu avatar May 04 '23 16:05 beet-aizu

魔改造して自動 push をやめました https://github.com/luzhiled1333/verification-helper

Luzhiled avatar May 04 '23 16:05 Luzhiled

魔改造して自動 push をやめました https://github.com/luzhiled1333/verification-helper

https://github.com/luzhiled1333/comp-library/commit/c89b1871add5f5aa1398e01cdd3b6954bf98ac0f ?

beet-aizu avatar May 04 '23 16:05 beet-aizu

最終的に、 main を保護するのは現状の verification-helper では無理だという結論に至って、PR では check のみを、merge するときは諦めて push させるということをしていますね

Luzhiled avatar May 04 '23 16:05 Luzhiled

https://github.com/luzhiled1333/comp-library/blob/c89b1871add5f5aa1398e01cdd3b6954bf98ac0f/.github/workflows/verify.yml#L12-L13 これか?

beet-aizu avatar May 04 '23 16:05 beet-aizu

最終的に、 main を保護するのは現状の verification-helper では無理だという結論に至って、PR では check のみを、merge するときは諦めて push させるということをしていますね

なんか一応 protect はされてそうな雰囲気を感じます スクリーンショット 2023-05-05 1 53 59

https://github.com/luzhiled1333/comp-library/pull/125

beet-aizu avatar May 04 '23 16:05 beet-aizu

ほんとだ

見てみたら Require status checks to pass before merging だけにチェック入ってました

Luzhiled avatar May 04 '23 16:05 Luzhiled

一応カスの issue と PR を置いておきます https://github.com/luzhiled1333/comp-library/issues/64 https://github.com/luzhiled1333/comp-library/pull/69

Luzhiled avatar May 04 '23 16:05 Luzhiled

https://github.com/beet-aizu/library/actions/runs/4885284397/jobs/8719149640 が通って ば な な になっていたが、よく考えると timestamp.remote.json と コミットのタイミング がいい感じになることがわかる

beet-aizu avatar May 04 '23 17:05 beet-aizu

自分 procrastinating よろしいか?いいよ

beet-aizu avatar May 04 '23 17:05 beet-aizu

https://github.com/luzhiled1333/comp-library/blob/c89b1871add5f5aa1398e01cdd3b6954bf98ac0f/.github/workflows/verify.yml#L12-L13 これか?

https://github.com/beet-aizu/library/actions/runs/4894584151/jobs/8738998783#step:5:751 うーん

beet-aizu avatar May 05 '23 14:05 beet-aizu

Require a pull request before merging のチェックを外してみる

beet-aizu avatar May 05 '23 14:05 beet-aizu

https://github.com/beet-aizu/library/actions/runs/4894584151/jobs/8739095103#step:5:750 ダメ

beet-aizu avatar May 05 '23 14:05 beet-aizu