Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
f4231fb
Q&A自動クローズ機能の警告メッセージ投稿時に通知が飛ばないバグを修正
ryufuta Nov 20, 2025
b1d5e1f
QuestionAutoCloserのモデルテストを別ファイルへ移動
ryufuta Nov 23, 2025
cefefaa
QuestionAutoCloser.post_warningの正常系のテストを改善
ryufuta Nov 23, 2025
b3e1a79
WIPのQ&Aを自動クローズ機能の対象外にした
ryufuta Nov 21, 2025
c4b3cbe
QuestionAutoCloser.close_and_select_best_answerの正常系のテストを改善
ryufuta Nov 23, 2025
31ce91c
テストコード内のシステムメッセージを定数化
ryufuta Nov 23, 2025
ac52dc2
質問更新日と最後に更新した回答の更新日のうち新しい方から1ヶ月以上経過した時に警告する
ryufuta Nov 24, 2025
3cc989f
Q&A自動クローズ機能の仕様変更に伴う初期データの追加と修正
ryufuta Nov 25, 2025
8ec339c
railsviewとJSで書き換えた
smallmonkeykey Oct 18, 2025
bdeef0b
reactのファイルを削除
smallmonkeykey Oct 18, 2025
b846fa4
定数を追加
smallmonkeykey Oct 18, 2025
f556556
QueryObjectパターンで書き換えた
smallmonkeykey Nov 13, 2025
4411be6
NotificationsControllerのロジックを整理し、絞り込み処理をQueryObjectへ移行
smallmonkeykey Dec 11, 2025
874a3ea
notifications_testをmainの最新に更新
smallmonkeykey Dec 11, 2025
07803f2
不要なクラスを削除
smallmonkeykey Dec 11, 2025
96aba17
非Reactに書き換える
smallmonkeykey Sep 15, 2025
7afa975
不要なReactコンポーネントファイルを削除
smallmonkeykey Sep 15, 2025
2fd21e1
ブックマーク削除処理をCurrentUser::BookmarksControllerに移動
smallmonkeykey Sep 16, 2025
c3c5e8d
lint実行し忘れによる修正
smallmonkeykey Sep 16, 2025
15a753e
ページネーションで次のページにある時にも対応
smallmonkeykey Sep 16, 2025
5ede14e
ブックマーク削除処理のバグ修正
smallmonkeykey Sep 16, 2025
86a09d1
削除後に編集ボタンが効いてなかったので修正した
smallmonkeykey Sep 17, 2025
bc73f0c
余分なスペースを削除
smallmonkeykey Sep 17, 2025
f1e0b82
リンクが存在しない環境での不安定化を避けるため、存在確認を入れてからクリックする
smallmonkeykey Sep 17, 2025
c72f92b
N+1クエリ回避のためにuserを事前読込と未使用インスタンス変数の削除
smallmonkeykey Sep 17, 2025
a1087a0
ビューを整理(i18nにmodel_name.humanを使用、URLをpathに変更)
smallmonkeykey Sep 17, 2025
acaa488
request.jsを使って書き換えた
smallmonkeykey Sep 17, 2025
f1f58e2
エラーの表示を変更
smallmonkeykey Sep 17, 2025
857481b
件数を統一した
smallmonkeykey Sep 17, 2025
ca411ec
destroyのレスポンスを204no_contentに統一
smallmonkeykey Sep 18, 2025
d75047e
ブックマーク削除処理のリファクタリング
smallmonkeykey Sep 18, 2025
5ce49bb
テストが通るようにテストを変更
smallmonkeykey Sep 18, 2025
574b74e
ブックマーク削除時に部分更新ではなく全体を再描画するよう変更
smallmonkeykey Sep 18, 2025
e2e769c
ページネーションを増やしたので、上にあるのをクリックするように該当のテストを変更
smallmonkeykey Sep 18, 2025
611e8a9
不要なデバッグを削除とエラーメッセージにHTTPステータスコードを含めた
smallmonkeykey Sep 20, 2025
2be8774
link_toからbuttonに変更したのと、インデントを整えた
smallmonkeykey Sep 20, 2025
31525e0
重複している箇所をset_bookmarksでまとめた
smallmonkeykey Sep 29, 2025
84c32e9
削除後も編集ボタンを使えるように変更
smallmonkeykey Sep 30, 2025
57d8590
private書き忘れ
smallmonkeykey Sep 30, 2025
5466235
重複処理をbookmarks-utils.jsに切り出し
smallmonkeykey Sep 30, 2025
f87191a
preloadの方が効率的なため変更
smallmonkeykey Sep 30, 2025
485360d
JSらしい書き方に変更
smallmonkeykey Sep 30, 2025
8323a60
Prettierによるbookmarks関連ファイルの整形
smallmonkeykey Oct 1, 2025
82c8adb
存在チェックの不備とループ処理の一貫性を改善した
smallmonkeykey Oct 1, 2025
be84b10
不要なデバッグとouterHTMLに変更
smallmonkeykey Oct 1, 2025
e5c847a
重複していた箇所を削除
smallmonkeykey Oct 1, 2025
2dc4182
nullチェックが不足していたため修正
smallmonkeykey Oct 1, 2025
f36b854
削除後の動作を修正
smallmonkeykey Oct 14, 2025
0259b06
リファクタリングした
smallmonkeykey Oct 15, 2025
1fb26ab
JSファイルを修正
smallmonkeykey Oct 15, 2025
45ab3bf
`@rails/request.js`のgetに置き換え
smallmonkeykey Oct 15, 2025
f138a9d
セッションで値を編集モードの値を管理し次のページに言っても編集モードを維持する
smallmonkeykey Nov 11, 2025
6478092
ブックマーク編集モードの初期化処理を整理
smallmonkeykey Nov 11, 2025
3e36df6
ページに再度アクセスしたときに編集モードから始まっていたのでページから離れる時は削除
smallmonkeykey Nov 11, 2025
a9c5757
空ページのフォールバックで特殊なためコメントを追加
smallmonkeykey Nov 11, 2025
f5ecbac
条件付きを削除し、元のコードに戻した
smallmonkeykey Nov 11, 2025
2cec738
元のテストコードに戻した
smallmonkeykey Nov 11, 2025
20780f4
2ページめに相談部屋があるので2ページめに飛ぶようにした
smallmonkeykey Nov 11, 2025
be42876
1ページめ2ページめにあってもどちらでも対応できるように変更
smallmonkeykey Nov 11, 2025
25cbf94
lint修正
smallmonkeykey Nov 12, 2025
b24fb2f
置き換え後に削除ボタンが反応しなくなる問題を、親要素にイベントを渡すことで修正
smallmonkeykey Nov 19, 2025
c48ac75
ブックマーク編集のリファクタリング 命名と定数を整理
smallmonkeykey Dec 13, 2025
a944685
エンコード機能を実装
sekito1107 Aug 21, 2025
6e1d2c7
無音の動画ファイルを正しくエンコードできるようにした
sekito1107 Aug 21, 2025
4b1c668
CIでバイナリ版gemの使用を許可(grcpがソース版を使うと大量のメモリを必要とするので)
sekito1107 Aug 21, 2025
09c1018
JWT認証を実装
sekito1107 Aug 21, 2025
d399ab8
ステージングでのapi/pubsubでbasic認証をスキップするように設定
sekito1107 Aug 21, 2025
c45c8b5
期待するaudienceを環境変数からではなくrequest.base_urlで取得するように変更
sekito1107 Aug 22, 2025
801e71d
エンコード処理中のエラー処理が重複して2重で失敗していたのを修正
sekito1107 Aug 22, 2025
8705c6f
job失敗時のリトライ処理を改善、リトライエラーコードの受け取り範囲拡大とリトライ回数に制限を儲けた
sekito1107 Aug 22, 2025
f37744a
storage情報が取得できなかった時に正しくエラーを吐くように変更
sekito1107 Aug 22, 2025
663abef
Transcoder::movieにてbucketが参照できなかった場合のエラーハンドリングを追加
sekito1107 Aug 22, 2025
cb8fff2
エンコード用のconfig内でenableとして利用していた部分をenabledに置換
sekito1107 Aug 22, 2025
6bf24d4
api/pubsubがjsonのみ受け付けるように変更
sekito1107 Aug 22, 2025
c8c23ad
fileメソッド内からバケットを取得する責務を分離
sekito1107 Aug 22, 2025
b0e015d
期待するaudを正しくbase + api/pubsubの形に修正
sekito1107 Aug 22, 2025
55b3acc
不正な構文を修正(bucketメソッドが閉じられていなかった)
sekito1107 Aug 22, 2025
00ce21d
integrationテストを追加、伴いpub_sub_controllerのJWT認証をテスト時は無効に
sekito1107 Aug 22, 2025
4121cb8
lint違反の修正
sekito1107 Aug 22, 2025
1f1c22e
Pub/Sub通知処理のエラーハンドリングを強化
sekito1107 Aug 23, 2025
d9764b4
JWT認証時のAuthorizationヘッダのパースを改善
sekito1107 Aug 23, 2025
86403a3
不正なリクエストメッセージの時のエラーハンドリングを強化
sekito1107 Aug 23, 2025
c012840
Pub/Sub通知処理のエラーハンドリングの可読性を重視し変更(エラータイプをもたせるのではなく、リトライすべきかどうかを直接持たせるように)
sekito1107 Aug 23, 2025
6232d8f
アクティブジョブがエラーになった場合のリトライ時間を負荷が分散するようにランダム性を追加
sekito1107 Aug 24, 2025
2c2ae74
ユーザー体験を損なわないよう、movieモデルの作成には成功したが、アクティブジョブの実行に失敗した場合はエラーを送出しないように変更
sekito1107 Aug 24, 2025
044a8cc
エンコードジョブが二重に生成されないようにする仕組みを導入
sekito1107 Aug 24, 2025
6adcf6b
transcode_jobのperformから各種処理をプライベートメソッドに切り出した
sekito1107 Aug 24, 2025
bd154bd
movieデータのIO取得にTempfileクラスを利用するように変更、それに伴い作業終了後のクリーンアップ作業も実装
sekito1107 Aug 24, 2025
1aceb06
Transcoder::Clientの行数を減らすためのリファクタリング
sekito1107 Aug 24, 2025
5299f5a
環境差でテストが落ちる対策として、明示的にostructをrequireした
sekito1107 Aug 24, 2025
14978c7
rubocopによる修正
sekito1107 Aug 24, 2025
44826b4
file.downloadに直接@tempfile.pathを渡すようにし、空ファイルがアップロードされる問題を解消
sekito1107 Aug 24, 2025
20b6b2b
Transcoder::Client内で一部バリデーションが意図通り動いていなかったのを修正
sekito1107 Aug 24, 2025
3b5d3b4
tempfileクリーンアップ処理をclose!のみにし、unlinkと処理が重複していた問題を解消
sekito1107 Aug 24, 2025
e9ddbdb
callメソッド内のデッドコードになっていたエラーハンドリングを削除
sekito1107 Aug 24, 2025
0216dcd
クリーンアップ処理時にエラーを送出するとエンコード処理自体が失敗に見えるため、クリーンアップ処理時のエラーを動作に無関係にし、ログにだけ保…
sekito1107 Aug 24, 2025
7a2fb87
blobのkeyを取得していた部分をblobを利用していると明確にするため@movie.movie_data.keyから@movie.mo…
sekito1107 Aug 24, 2025
843796c
既存ジョブの取得方法をサーバー主体に変更
sekito1107 Aug 24, 2025
1f58aaa
既存ジョブがあった場合、既存ジョブの情報を返さずに即時リターンするように変更
sekito1107 Aug 24, 2025
d90353a
rubocopによる修正
sekito1107 Aug 24, 2025
13ba016
紛れ込んでいた開発用設定を削除
sekito1107 Aug 24, 2025
9075b3d
pub_sub_controllerのテストを強化
sekito1107 Aug 24, 2025
6c8f936
transcode_jobのテストを追加
sekito1107 Aug 24, 2025
8e5e7e7
Interactors::ProcessTranscodingNotificationのテストを追加
sekito1107 Aug 25, 2025
398b211
Transcoder::Movieのテストを作成
sekito1107 Aug 25, 2025
b02019f
Transcoder::Clientのテストを作成
sekito1107 Aug 25, 2025
aa321af
rubocopによる修正
sekito1107 Aug 25, 2025
9ae004f
Transcoder::movieのテスト内で読み込みを適切に変更
sekito1107 Aug 25, 2025
2cd1caf
Transcoder::MovieTest内で読み込まれてるgemを変更
sekito1107 Aug 26, 2025
5ebbade
topicを固定値ではなく、環境変数から読むように変更
sekito1107 Aug 26, 2025
d223646
fixtureを使える部分はfixtureを用いるように変更
sekito1107 Aug 26, 2025
2884424
ログ通知テストの内容を変更 Rollbarはテスト環境にないので分岐を削除、及びエラーログを直接変数に代入するように
sekito1107 Aug 27, 2025
092aee0
blob.keyがnilだった場合に意図しないerrorがでる可能性を排除
sekito1107 Aug 27, 2025
3ff847e
Google::Cloud::Errorが呼ばれた場合、想定しないエラーがでる可能性があったので正しくgoogle/cloud/error…
sekito1107 Aug 27, 2025
257c045
テスト内で変更したグローバル設定をensure節で元に戻すように
sekito1107 Aug 27, 2025
fa8f70c
検証済みのkeyを使用するように変更
sekito1107 Aug 27, 2025
25bde4b
JOB実行失敗時のリトライ間隔を定数から読み取るように変更
sekito1107 Nov 9, 2025
b9fb9d3
rubocopによる修正
sekito1107 Nov 9, 2025
ef5aa75
コンフリクト解消時にGemfile.lockが更新されたので、bundle installを行った
sekito1107 Dec 17, 2025
bbe8f46
コンフリクト解消時に壊れた構文を修正
sekito1107 Dec 17, 2025
c9417ca
retirement_createの処理をNewspaperからActiveSupport::Notificationsに移行
matuaya Sep 28, 2025
365669b
training_completion_createの処理をNewspaperからActiveSupport::Notificationsに移行
matuaya Sep 30, 2025
ea1728b
UnfinishedDataDestroyerに対応するテストを作成
matuaya Sep 30, 2025
ef309cd
他のユーザーのデータに影響なくユーザーの日報と提出物が正しく削除されるテストを追加
matuaya Oct 17, 2025
5998f3c
#callテストで全WIP日報と未チェック提出物の削除を確認、そしてscope使用で簡素化
matuaya Oct 22, 2025
076152a
変数名とテスト名を明確化
matuaya Oct 22, 2025
b0f0844
不要なインスタンス変数reportsを削除
matuaya Oct 28, 2025
33c51f7
テスト用に未チェックProductオブジェクトを作成
matuaya Oct 28, 2025
60a0ae5
テスト用ReportとProduct作成をsetupからテスト内に移動
matuaya Oct 29, 2025
54ded0f
ユーザー参照をpayloadから行うように変更
matuaya Oct 29, 2025
7a29328
Retirementクラスのメソッド名変更に伴いテストのメソッド名も更新
matuaya Nov 7, 2025
e1c9eab
メソッド名をtrigger_retirement_eventに変更
matuaya Dec 18, 2025
9353cd1
good_jobsテーブルに不足しているカラムを追加
komagata Dec 19, 2025
fcc0e6d
schema.rbを更新
komagata Dec 19, 2025
4719527
Active Storageの古いURLを読み取れるようにmessage_serializerを設定
komagata Dec 19, 2025
6d2159e
Merge pull request #9408 from fjordllc/fix/active-storage-urls
komagata Dec 19, 2025
e39e1cf
key_generator_hash_digest_classをSHA1に設定
komagata Dec 19, 2025
f72b0a4
Merge pull request #9405 from fjordllc/fix/add-missing-good-jobs-columns
komagata Dec 19, 2025
391570b
Merge pull request #9411 from fjordllc/fix/active-storage-urls-sha1
komagata Dec 19, 2025
3801d69
Merge pull request #9081 from fjordllc/feature/reintroduce-encoding
komagata Dec 20, 2025
85b591f
Merge pull request #9181 from fjordllc/chore/migrate-bookmarks-to-rai…
komagata Dec 20, 2025
7e7055c
Merge pull request #9273 from fjordllc/chore/replace-notifications-to…
komagata Dec 20, 2025
029958a
他のユーザーの分報でもコメントを投稿できるようにした
nakamu-kazu222 Oct 16, 2025
89c10b5
編集・削除できるのは管理者またはコメントを書いた本人のみとした
nakamu-kazu222 Oct 16, 2025
295e702
rubocopエラーを解消した
nakamu-kazu222 Oct 16, 2025
3e3a5df
テストが落ちていたので修正した
nakamu-kazu222 Oct 17, 2025
cd70047
テストが落ちていたので修正した
nakamu-kazu222 Oct 18, 2025
e0fa5e4
テストエラーの修正をしたが、他の分報にコメントを記載できる機能に影響があったので戻した
nakamu-kazu222 Oct 18, 2025
03310eb
coderabbitaiの指摘を修正した
nakamu-kazu222 Oct 19, 2025
fc91de2
coderabbitaiの指摘を修正した
nakamu-kazu222 Oct 19, 2025
16dd19e
分報のコメントの削除機能のエラーを修正した
nakamu-kazu222 Nov 2, 2025
131671e
他のユーザーが他のユーザー自身のコメントを削除できるかのテストを追加した
nakamu-kazu222 Nov 2, 2025
ab8962c
コールバックの定義を省略した
nakamu-kazu222 Nov 3, 2025
3fa0a67
ログインしているかの条件分岐を削除した
nakamu-kazu222 Nov 3, 2025
72ccdba
編集したコメントが編集前のコメントに戻る事象を解消した
nakamu-kazu222 Nov 3, 2025
76c0a8e
coderabbitaiの指摘内容を修正した
nakamu-kazu222 Nov 3, 2025
8757720
coderabbitaiの指摘内容を修正した
nakamu-kazu222 Nov 3, 2025
b617c27
マイグレーション内容を更新した
nakamu-kazu222 Nov 3, 2025
debac81
条件文のコードを読みやすいように変更した
nakamu-kazu222 Nov 6, 2025
494a3ed
特定のユーザーの分報以外も含んでページの範囲外判定をしているので、修正した
nakamu-kazu222 Nov 6, 2025
33341a9
分報コメント作成時に1ページに遷移するので修正した
nakamu-kazu222 Nov 6, 2025
51cec70
分報コメント作成時に1ページに遷移するので修正した
nakamu-kazu222 Nov 7, 2025
dc98428
メソッド名をtrigger_retirement_eventからpublishに変更
matuaya Dec 21, 2025
2364983
openssl gemを追加してSSL CRLエラーを修正
komagata Dec 23, 2025
b7a4d5a
Merge pull request #9425 from fjordllc/fix/discord-ssl-error
komagata Dec 23, 2025
c66ecf6
GoodJobの不足しているテーブルを追加
komagata Dec 23, 2025
fb4f181
Merge pull request #9431 from fjordllc/fix/add-missing-good-job-tables
komagata Dec 23, 2025
afc3955
good_job_processesテーブルにlock_typeカラムを追加
komagata Dec 23, 2025
1a4f2f8
Merge pull request #9435 from fjordllc/fix/add-lock-type-to-good-job-…
komagata Dec 23, 2025
7a6b1fe
schemaを更新してなかった件を修正
komagata Dec 24, 2025
b10bf0b
Merge pull request #9445 from fjordllc/chore/schema
komagata Dec 24, 2025
00d3fe2
Stripe Billing Portalへのリダイレクトを修正
komagata Dec 25, 2025
01a1791
Merge pull request #9448 from fjordllc/fix/fix-stripe-billing-portal-…
komagata Dec 25, 2025
10cec99
Merge pull request #9260 from fjordllc/feature/micro-reports-others-u…
komagata Dec 26, 2025
a6a85d8
PUBSUBの環境変数の設定を追加
komagata Dec 29, 2025
60de05e
Merge pull request #9457 from fjordllc/chore/cloudbuild-env
komagata Dec 29, 2025
c8b73cf
Merge pull request #9219 from fjordllc/chore/replace-newspaper-with-a…
komagata Jan 6, 2026
859cd79
Merge pull request #9323 from fjordllc/bug/fix-question-auto-close-lo…
komagata Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
- image: cimg/ruby:3.4.3-node
steps:
- checkout
- run:
name: Configure Bundler
command: |
bundle lock --add-platform ruby
- ruby/install-deps
- node/install:
install-yarn: true
Expand All @@ -21,6 +25,10 @@ jobs:
- image: 'cimg/ruby:3.4.3-node'
steps:
- checkout
- run:
name: Configure Bundler
command: |
bundle lock --add-platform ruby
- ruby/install-deps
- ruby/rubocop-check:
format: progress
Expand Down Expand Up @@ -75,7 +83,6 @@ jobs:
- run:
name: Configure Bundler
command: |
bundle config set --local force_ruby_platform true
bundle lock --add-platform ruby
- ruby/install-deps:
clean-bundle: true
Expand Down
1 change: 1 addition & 0 deletions .cloudbuild/cloudbuild-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ steps:
- '--set-env-vars=DISCORD_AUTHENTICATION_URL=$_DISCORD_AUTHENTICATION_URL'
- '--set-env-vars=PUBSUB_AUDIENCE=$_PUBSUB_AUDIENCE'
- '--set-env-vars=PUBSUB_SERVICE_ACCOUNT_EMAIL=$_PUBSUB_SERVICE_ACCOUNT_EMAIL'
- '--set-env-vars=PUBSUB_TOPIC=$_PUBSUB_TOPIC'
- '--set-env-vars=$_ENVS'
- >-
--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID,$_LABELS
Expand Down
1 change: 1 addition & 0 deletions .cloudbuild/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ steps:
- '--set-env-vars=DISCORD_AUTHENTICATION_URL=$_DISCORD_AUTHENTICATION_URL'
- '--set-env-vars=PUBSUB_AUDIENCE=$_PUBSUB_AUDIENCE'
- '--set-env-vars=PUBSUB_SERVICE_ACCOUNT_EMAIL=$_PUBSUB_SERVICE_ACCOUNT_EMAIL'
- '--set-env-vars=PUBSUB_TOPIC=$_PUBSUB_TOPIC'
- '--set-env-vars=$_ENVS'
- >-
--labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID,$_LABELS
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ gem 'discordrb', '~> 3.5', require: false
gem 'doorkeeper'
gem 'good_job', '~> 4.5'
gem 'google-cloud-storage', '~> 1.25', require: false
gem 'google-cloud-video-transcoder'
gem 'google-id-token'
gem 'holiday_jp'
gem 'icalendar', '~> 2.8'
gem 'interactor', '~> 3.0'
Expand All @@ -58,6 +60,7 @@ gem 'omniauth-discord'
gem 'omniauth-github', '~> 2.0.1'
gem 'omniauth-rails_csrf_protection'
gem 'opengraph_parser'
gem 'openssl'
gem 'parser', '3.2.2.4'
gem 'pg', '~> 1.4.6'
gem 'postmark-rails'
Expand Down
49 changes: 49 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ GEM
multipart-post (~> 2.0)
faraday-net_http (3.4.2)
net-http (~> 0.5)
faraday-retry (2.3.2)
faraday (~> 2.0)
ffi (1.17.1)
ffi (1.17.1-aarch64-linux-gnu)
ffi (1.17.1-aarch64-linux-musl)
ffi (1.17.1-arm-linux-gnu)
Expand All @@ -212,6 +215,16 @@ GEM
fugit (1.12.1)
et-orbi (~> 1.4)
raabro (~> 1.4)
gapic-common (1.1.0)
faraday (>= 1.9, < 3.a)
faraday-retry (>= 1.0, < 3.a)
google-cloud-env (~> 2.2)
google-logging-utils (~> 0.1)
google-protobuf (>= 3.25, < 5.a)
googleapis-common-protos (~> 1.6)
googleapis-common-protos-types (~> 1.15)
googleauth (~> 1.12)
grpc (~> 1.66)
globalid (1.3.0)
activesupport (>= 6.1)
good_job (4.12.1)
Expand Down Expand Up @@ -249,7 +262,30 @@ GEM
google-cloud-core (~> 1.6)
googleauth (~> 1.9)
mini_mime (~> 1.0)
google-cloud-video-transcoder (2.0.1)
google-cloud-core (~> 1.6)
google-cloud-video-transcoder-v1 (~> 2.0)
google-cloud-video-transcoder-v1 (2.2.0)
gapic-common (~> 1.0)
google-cloud-errors (~> 1.0)
google-id-token (1.4.2)
jwt (>= 1)
google-logging-utils (0.2.0)
google-protobuf (4.32.0)
bigdecimal
rake (>= 13)
google-protobuf (4.32.0-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.32.0-x86_64-linux-gnu)
bigdecimal
rake (>= 13)
googleapis-common-protos (1.8.0)
google-protobuf (>= 3.18, < 5.a)
googleapis-common-protos-types (~> 1.20)
grpc (~> 1.41)
googleapis-common-protos-types (1.20.0)
google-protobuf (>= 3.18, < 5.a)
googleauth (1.15.1)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.2)
Expand All @@ -258,6 +294,15 @@ GEM
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.74.1)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.74.1-arm64-darwin)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.74.1-x86_64-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
hashdiff (1.2.1)
hashie (5.0.0)
holiday_jp (0.8.1)
Expand Down Expand Up @@ -426,6 +471,7 @@ GEM
opengraph_parser (0.2.5)
addressable
nokogiri
openssl (4.0.0)
opus-ruby (1.0.1)
ffi
os (1.1.4)
Expand Down Expand Up @@ -743,6 +789,8 @@ DEPENDENCIES
foreman
good_job (~> 4.5)
google-cloud-storage (~> 1.25)
google-cloud-video-transcoder
google-id-token
holiday_jp
icalendar (~> 2.8)
image_processing (~> 1.12)
Expand Down Expand Up @@ -772,6 +820,7 @@ DEPENDENCIES
omniauth-github (~> 2.0.1)
omniauth-rails_csrf_protection
opengraph_parser
openssl
parser (= 3.2.2.4)
pg (~> 1.4.6)
postmark-rails
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.micro-report(id="micro_report_#{@micro_report.id}" data-micro_report_id="#{@micro_report.id}" data-micro_report_content="#{@micro_report.content}")
.micro-report__start
= render 'users/icon', user: @user, link_class: 'micro-report__user-link', image_class: 'micro-report_user-icon'
= render 'users/icon', user: comment_user, link_class: 'micro-report__user-link', image_class: 'micro-report_user-icon'
.micro-report__end
.is-micro-report.micro-report-display
header.micro-report__header
h2.micro-report__title
= link_to user_path(@user), class: 'micro-report__title-link a-text-link' do
= @user.login_name
= link_to user_path(comment_user), class: 'micro-report__title-link a-text-link' do
= comment_user.login_name
time.micro-report__created-at
= posted_datetime
.micro-report__body
.a-short-text.is-sm.js-markdown-view
= @micro_report.content
.micro-report__footer
- if @micro_report.user == @current_user || admin_login?
.micro-report-actions
.micro-report-actions
- if @micro_report.comment_user == @current_user || @current_user&.admin?
ul.micro-report-actions__items
li.micro-report-actions__item
button.micro-report-actions__action.is-edit.js-editor-button
Expand Down
8 changes: 7 additions & 1 deletion app/components/users/micro_reports/micro_report_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def initialize(user:, current_user:, micro_report:)
@micro_report = micro_report
end

def comment_user
@micro_report.comment_user
end

def posted_datetime
time = @micro_report.created_at
if time.to_date == Time.zone.today
Expand All @@ -18,5 +22,7 @@ def posted_datetime
end
end

delegate :admin_login?, to: :helpers
def owner_post?
comment_user == @user
end
end
2 changes: 1 addition & 1 deletion app/controllers/api/bookmarks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class API::BookmarksController < API::BaseController
PAGER_NUMBER = 25
PAGER_NUMBER = 20

def index
per = params[:per] || PAGER_NUMBER
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/api/micro_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ def update
private

def set_micro_report
@micro_report = current_user.admin? ? MicroReport.find(params[:id]) : current_user.micro_reports.find(params[:id])
@micro_report =
if current_user.admin?
MicroReport.find(params[:id])
else
current_user.authored_micro_reports.find(params[:id])
end
end

def micro_report_params
Expand Down
48 changes: 48 additions & 0 deletions app/controllers/api/pub_sub_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: true

class API::PubSubController < API::BaseController
skip_before_action :verify_authenticity_token
skip_before_action :require_login_for_api
skip_before_action :basic_auth
before_action :authenticate_pubsub_token

def create
result = ProcessTranscodingNotification.call(body: request.body.read)

if result.success?
head :ok
else
Rails.logger.error("Failed to process transcoding notification: #{result.error}")

if result.retryable == false
head :ok # 200系のステータスコードを返すとPub/Subは再送しない
else
head :internal_server_error
end
end
end

private

def authenticate_pubsub_token
authz = request.headers['Authorization'].to_s
token = authz[/\ABearer\s+(.+)\z/i, 1]
return if token && valid_pubsub_token?(token)

Rails.logger.warn('Unauthorized Pub/Sub request')
head :unauthorized
end

def valid_pubsub_token?(token)
validator = GoogleIDToken::Validator.new
expected_audience = "#{request.base_url}#{request.path}"
payload = validator.check(token, expected_audience)

expected_sa_email = ENV['PUBSUB_SERVICE_ACCOUNT_EMAIL']
sa_email_claim = payload['email']
sa_email_claim == expected_sa_email
rescue GoogleIDToken::ValidationError => e
Rails.logger.warn("Invalid JWT: #{e.message}")
false
end
end
2 changes: 1 addition & 1 deletion app/controllers/billing_portal_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
class BillingPortalController < ApplicationController
def create
session = Stripe::BillingPortal::Session.create(customer: current_user.customer_id)
redirect_to session.url
redirect_to session.url, allow_other_host: true
end
end
17 changes: 15 additions & 2 deletions app/controllers/current_user/bookmarks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# frozen_string_literal: true

class CurrentUser::BookmarksController < ApplicationController
def index
@user = current_user
PAGER_NUMBER = 20

before_action :set_bookmarks, only: [:index]

def index; end

def destroy
current_user.bookmarks.find(params[:id]).destroy
head :no_content
end

private

def set_bookmarks
@bookmarks = current_user.bookmarks.preload(bookmarkable: :user).order(created_at: :desc, id: :desc).page(params[:page]).per(PAGER_NUMBER)
end
end
5 changes: 5 additions & 0 deletions app/controllers/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ class NotificationsController < ApplicationController

def index
@target = params[:target]
@notifications = UserNotificationsQuery.new(
user: current_user,
target: params[:target],
status: params[:status]
).call.page(params[:page])
end

def show
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/training_completion_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create
user = current_user
current_user.cancel_participation_from_regular_events
current_user.delete_and_assign_new_organizer
Newspaper.publish(:training_completion_create, { user: })
ActiveSupport::Notifications.instrument('training_completion.create', user:)
user.clear_github_data
notify_to_user(user)
notify_to_admins(user)
Expand Down
21 changes: 16 additions & 5 deletions app/controllers/users/micro_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,28 @@ def index

def create
@micro_report = @user.micro_reports.build(micro_report_params)
@micro_report.comment_user = current_user

if current_user == @user && @micro_report.save
if @micro_report.save
flash[:notice] = '分報を投稿しました。'
else
flash[:alert] = '分報の投稿に失敗しました。'
end

redirect_to user_micro_reports_path(@user, page: @user.latest_micro_report_page)
redirect_to user_micro_reports_path(@user, page: @user.latest_micro_report_page(per_page: PAGER_NUMBER))
end

def destroy
if !current_user.admin? && @micro_report.comment_user != current_user
redirect_to user_micro_reports_path(@user), alert: '権限がありません。'
return
end

@micro_report.destroy!

referer_path = request.referer
if page_out_of_range?(referer_path)
redirect_to user_micro_reports_path(@user, page: @user.latest_micro_report_page)
redirect_to user_micro_reports_path(@user, page: @user.latest_micro_report_page(per_page: PAGER_NUMBER))
else
redirect_to referer_path
end
Expand All @@ -42,7 +48,12 @@ def set_user
end

def set_micro_report
@micro_report = current_user.admin? ? MicroReport.find(params[:id]) : current_user.micro_reports.find(params[:id])
@micro_report =
if current_user.admin?
MicroReport.find(params[:id])
else
current_user.authored_micro_reports.find(params[:id])
end
end

def micro_report_params
Expand All @@ -53,6 +64,6 @@ def page_out_of_range?(referer_path)
matched_page_number = referer_path.match(/page=(\d+)/)
page_number = matched_page_number ? matched_page_number[1] : FIRST_PAGE

MicroReport.page(page_number).out_of_range?
@user.micro_reports.page(page_number).out_of_range?
end
end
Loading
Loading