Refs #450 Branch mode: `new`; base: `main`; head: `feature/450` Implementation model: `gpt-6.1-sol` / reasoning: `high` ## Automated implementation (requires human review) 実装しました。 - `/posts` の履歴集計を廃止し、更新日時の表示・絞り込み・並び順を `posts.updated_at` に統一しました。 - 現在テーブルに対する履歴判定と、不要になった共通メソッドを削除しました。 - `_versions` を読む処理の認可は維持しています。 `git diff --check` は通過しました。指定に従い、テスト・lint・ビルド・マイグレーションは未実行です。 ## Verification - Tests/builds/migrations were not authorized and were not invoked by the controller. - Codex was instructed not to run them; inspect its command transcript. - The repository owner alone reviews changes. No AI review is executed. - Do not merge before human acceptance and required checks. --------- Co-authored-by: Codex Night Worker <codex-night@localhost> Co-authored-by: みてるぞ <miteruzo@naver.com> Reviewed-on: #462 Co-authored-by: テツノニジカ <969+codex-bot@noreply.localhost>
このコミットはプルリクエスト #462 でマージされました。
このコミットが含まれているのは:
@@ -14,22 +14,40 @@ RSpec.describe 'History boundaries shared with Counts', type: :request do
|
||||
end
|
||||
end
|
||||
|
||||
it 'denies the same discarded description through Counts, the facade and the ordinary API' do
|
||||
it 'keeps discarded history private while exposing the current description' do
|
||||
get '/counts/query', params: { resource: 'tag_descriptions', definition: 'history',
|
||||
mode: 'details', locale: 'ja', execution_at: '2025-01-01T00:00:00Z' }
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.parsed_body).to include('count' => 0, 'output_count' => 2,
|
||||
'excluded_count' => 2, 'versions' => [])
|
||||
["/wiki/#{ description.id }", "/tags/#{ tag.id }/description"].each do |path|
|
||||
paths = [
|
||||
"/wiki/#{ description.id }", '/wiki/title/description%20tag',
|
||||
"/tags/#{ tag.id }/description"]
|
||||
paths.each do |path|
|
||||
get path, params: { locale: 'ja' }
|
||||
expect(response).to have_http_status(:not_found)
|
||||
expect(response.body).not_to include('private body')
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.parsed_body.fetch('body')).to eq(description.body)
|
||||
end
|
||||
get '/sitemap_entries/descriptions', params: { locale: 'ja' }
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.parsed_body['ids']).not_to include(description.id)
|
||||
end
|
||||
|
||||
it 'omits private revision references and rejects history and diff requests' do
|
||||
get "/wiki/#{ description.id }", params: { locale: 'ja' }
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.parsed_body).to include(
|
||||
'revision_id' => nil, 'pred' => nil, 'succ' => nil,
|
||||
'updated_at' => description.updated_at.iso8601(3))
|
||||
|
||||
version = TagDescriptionVersion.find_by!(
|
||||
tag_id: tag.id, language_code: 'ja', version_no: 2)
|
||||
get "/wiki/#{ description.id }", params: { locale: 'ja', version: version.id }
|
||||
expect(response).to have_http_status(:not_found)
|
||||
get "/wiki/#{ description.id }/diff", params: { locale: 'ja' }
|
||||
expect(response).to have_http_status(:not_found)
|
||||
end
|
||||
|
||||
it 'permits the server-authenticated administrator to read the discarded description' do
|
||||
sign_in_as(create(:user, :admin))
|
||||
get "/tags/#{ tag.id }/description", params: { locale: 'ja' }
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする