この期間の CHANGELOG.md
へのコミットは5件。
ActionPackに関しての3件、ActiveJobに関して2件。
ActionPack
process_action.action_controller
の notifications に Location
レスポンスヘッダを含めるようにした
コミット: Add :location to process_action.action_controller payloads · rails/rails@7222594
周辺知識がなさ過ぎてよくわからん。
「 process_action.action_controller
の notifications」ってなんじゃ。
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload| result = super payload[:status] = response.status payload[:location] = response.filtered_location result ensure append_info_to_payload(payload) end
引用: rails/instrumentation.rb at 722259444ae3a2dbdea7df50b4652e9d4aaaccdb · rails/rails
ふむ。 ActiveSupport::Notifications
ってのがあるんすね。payloadの :location
に response.filtered_location
を入れてる。
response
は ActionDispatch::Response
だ。
ActionDispatch::Response
のなかで ActionDispatch::Http::FilterRedirect
を include している。
filtered_location
は ActionDispatch::Http::FilterRedirect
の中で定義されてる。
memo: そもそもLocationレスポンスヘッダ
Location レスポンスヘッダーはリダイレクト先の URL を示します。 3xx (リダイレクト) または 201 (created) ステータスレスポンスを返すときのみ意味を成します。
process_action.action_controller
の notifications に uuid
も含めるようにした
コミット: Add :uuid to process_action.action_controller payloads · rails/rails@8ec75a1
さっきと似たような修正。 payloadの :uuid
に request.uuid
を含めるようになった。
uuid
は ActionDispatch::Request
クラスの uuid
で、request_id
のaliasだ。
一意なリクエストidを notifications に含めることでデバッグしやすくなったりするよ、ということかなぁ。
process_action.action_controller
の notifications に request
を丸ごと含めるようにした
コミット: Provide the whole request · rails/rails@32b99f9
さっき uuid
を含めるようにしたけど、「もういっそのこと request
全部含めちゃえばよくね??」となってる。
uuid
を含める処理は決して、代わりに request
(= ActionDispatch::Request
クラスのインスタンス)をまるっと、payloadの :request
に含めるようにしている。
ActiveJob
ジョブをキューに入れて実行するとき、引数のログを無効にするオプションを追加した
コミット: Add an option to disable logging for jobs with sensitive arguments · rails/rails@ce085f6
これまでは引数のログが出ちゃってたんだよなぁ。確かにそうだった。
例えば個人情報を含む引数を渡した時にログに出てしまうとあまりよろしくないわけだ。
class SensitiveJob < ApplicationJob self.log_arguments = false def perform(my_sensitive_argument) end end
引用: Add an option to disable logging for jobs with sensitive arguments · rails/rails@ce085f6
self.log_arguments = false
を指定するだけで良いんだ。便利。
ぱっと見、logを非表示にしたい引数を個別に指定できるともっと便利そうだなぁと思った。けどそんなに需要ないかぁ。
Fix Typo
コミット: Fix small typo in activejob changelog · rails/rails@d6a7aab
arguments
のスペルが間違ってたので修正された