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

Fly Deploy並列実行による失敗をマージキューで防ぐ #743

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

yonta
Copy link
Collaborator

@yonta yonta commented Jun 26, 2024

fix #615

やったこと

  • pushトリガーでのActions起動を削除した
    • そもそも必要ない
    • マージキュー化で邪魔なので削除
    • ついでにこれにより入れていたskip-duplicate-actionsも削除した
  • FlyへのデプロイをGitHubマージキューで行うようにした
  • Actionsのconccurency設定をして、Flyへのデプロイを同時に1つまでに制限した
  • ちょっとしたリファクタ

参考資料

以下古い内容

必要な追加作業

  1. ベースブランチの保護ルールで「マージキューを必須にする」
  2. マージの制限、の、マージする pull request の最大数、を「1」にする
  3. 他はデフォルトでよさそう?たぶん

今後どうなるか

yonta added 2 commits June 26, 2024 18:33
PRでブランチに追加コミットがあったときもpull_requestだけで対応でき、pushはいらない。
PR化されていないブランチへのpushが影響を受ける。
しかしこれもドラフトPRで対応できる。
現在はmainへのpushはPRを基本とする運用なので、消しても問題なさそう。

push/PRで重複起動するためにいれていたskip-duplicate-actionsも削除した。
Copy link

github-actions bot commented Jun 26, 2024

📦 esbuild Bundle Analysis for sakazuki

This analysis was generated by esbuild-bundle-analyzer. 🤖

Meta File Out File Size (raw) Note
meta.json app/assets/builds/application.js 1.01 MB 🆕 Added
Largest paths These visualization shows top 20 largest paths in the bundle.

Meta file: meta.json, Out file: app/assets/builds/application.js

Path Size
node_modules/chart.js/dist ${{\color{Goldenrod}{ ██████▊ }}}$ 27.4%, 273.88 KB
app/javascript/completion ${{\color{Goldenrod}{ ████▎ }}}$ 17.1%, 170.67 KB
node_modules/@hotwired/turbo ${{\color{Goldenrod}{ ███▎ }}}$ 13.2%, 131.96 KB
node_modules/bootstrap/dist ${{\color{Goldenrod}{ ███ }}}$ 12.4%, 124.34 KB
node_modules/simplelightbox/dist ${{\color{Goldenrod}{ ██▏ }}}$ 8.8%, 87.73 KB
node_modules/@hotwired/stimulus ${{\color{Goldenrod}{ ██ }}}$ 8.4%, 84.29 KB
node_modules/@popperjs/core ${{\color{Goldenrod}{ █▍ }}}$ 5.6%, 55.66 KB
node_modules/@rails/actioncable ${{\color{Goldenrod}{ ▌ }}}$ 2.0%, 19.51 KB
node_modules/rater-js/index.js ${{\color{Goldenrod}{ ▍ }}}$ 1.6%, 16.42 KB
node_modules/@kurkle/color ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 13.37 KB
app/javascript/taste_graph ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 7.56 KB
app/javascript/controllers ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 7.12 KB
node_modules/@hotwired/turbo-rails ${{\color{Goldenrod}{ }}}$ 0.4%, 3.82 KB
node_modules/ts-deepmerge/esm ${{\color{Goldenrod}{ }}}$ 0.2%, 1.69 KB
node_modules/just-zip-it/index.mjs ${{\color{Goldenrod}{ }}}$ 0.1%, 785 B
node_modules/chart.js/helpers ${{\color{Goldenrod}{ }}}$ 0.0%, 0 B
app/javascript/application.js ${{\color{Goldenrod}{ }}}$ 0.0%, 0 B
Details

Next to the size is how much the size has increased or decreased compared with the base branch of this PR.

  • ‼️: Size increased by 20% or more. Special attention should be given to this.
  • ⚠️: Size increased in acceptable range (lower than 20%).
  • ✅: No change or even downsized.
  • 🗑️: The out file is deleted: not found in base branch.
  • 🆕: The out file is newly found: will be added to base branch.

@yonta yonta self-assigned this Jun 26, 2024
@yonta yonta requested a review from momocus June 26, 2024 09:44
@yonta yonta marked this pull request as ready for review June 26, 2024 09:44
@momocus
Copy link
Owner

momocus commented Jul 7, 2024

merge queを利用するにはGithub Enterpriseの契約(月21ドル)が必要なのでダメです🙅‍♀️

@yonta
Copy link
Collaborator Author

yonta commented Jul 8, 2024

ぐえー。
コンカレンシーで防げるらしいので、そっちに変更しよう。

@yonta yonta marked this pull request as draft July 8, 2024 14:37
yonta added 2 commits July 11, 2024 16:39
このパッチより前では、並列の制約が特に指定がされていなかった。
そのため、複数のPRをマージすると、Fly Deployが並列で走っていた。
するとFly Deployが失敗してしまうことがあった。

このパッチによりFly Deployを同時に1つまでに制限した。
また、先入れ先出しで、先のDeployが終わらないと次のDelpoyが始まらない設定にした。
@yonta yonta marked this pull request as ready for review July 11, 2024 08:15
@yonta
Copy link
Collaborator Author

yonta commented Jul 11, 2024

はーん、答えは2行だった

@momocus momocus merged commit 54581da into main Jul 15, 2024
5 checks passed
@yonta yonta deleted the pr/issue615/merge-queue branch July 31, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🪰 連続でマージするとflyデプロイが失敗する
2 participants