Fjord Choiceのワークフローが失敗した際の実行ステータスを「失敗」にする #7454
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
概要
junohm410さんの実際のpointは19ptですが、Fjord Choice上では17ptとなっており、ズレが発生しています。
本番環境のDBを確認したところ、#6480の2ptが反映されていませんでした。
このPRで、Fjord Choiceのワークフローが失敗した際の実行ステータスを「失敗」にすることで、失敗時のデータの修正や原因究明がやりやすくなります。
補足
Fjord Choiceの仕組みについて
bootcampのリポジトリが操作されると、GitHub Actionsが動き、以下のワークフローのコードが状況に応じて実行されます。
ワークフローでcurlコマンドが実行され、Fjord ChoiceにPOSTにリクエストが飛ぶ仕組みです。
詳しくはsakiさんのブログにも記載があります。
調査の経緯
Fjord Choice上の問題・bootcampのGitHub Actionsの問題双方を疑いました。
検証用Fjord Choiceと検証用bootcampリポジトリを作り、複数アカウントを使って#6480に近い状況を作りましたが、バグが再現しませんでした。
GitHub Actionsのログで以下を確認しました。該当のログ
他のリクエストの多くは1~3秒程度で終わっており、同じく10秒かかっているログの中には500エラーが出ているものもありました。
本PRの内容と変更理由
内容
GitHub Actionsが動いたときに実行される、
curl
コマンドに-f
オプションをつけました。理由
-f
(もしくは--fail
)オプションをつけることにより、curlコマンド実行時のエラーでFjord ChoiceへのPOSTリクエストが失敗した場合、「失敗」のステータスになります。(失敗時には通知もくるようになります)ログ変更確認方法
このPRから修正後のコードでGitHub Actionsが実行されるので、レビュー依頼→Approveの動作確認はログの確認をお願いします。
Issueの割り振りの動作確認はマージ後に行います。
本物のbootcampリポジトリでは、マージ後に「失敗」状態のアクションが見つかるまで確認できないため、検証用リポジトリのログの確認をお願いします。
-f
オプションありで実行した場合、「失敗」のステータスになっている。https://github.com/SuzukaHori/bootcamp_private/actions/runs/8137610247/job/22236371677
Screenshot
画面上の変更はありません。