generate-fixtures drops a redirect on a route that also has a page
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #468 @silverbackdan による — マージ済み
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with Fixture/Generator/Site/SiteReader::orderRedirects(), where the !isset($available[spl_object_id($route)]) check skips redirects on routes that also belong to a page, and check how $unresolvedRedirects is populated. Pull request #468 is already open against this issue, so review it before starting. Done means the generated scaffold sets the redirect after the routes exist, or the route is reported under could not be reproduced.
索引モデルが issue の本文から書いたものです。
説明
silverback:api-components:generate-fixtures (2.0.0-alpha.22) silently leaves out a redirect when the redirecting route also belongs to a page. Nothing appears in the could not be reproduced list.
Example (smoking-and-alcohol-websites production)
| Route | Page | Redirects to |
|---|---|---|
/ (home) |
Home | /graphs |
/graphs (graphs) |
Graphs | /graphs/top-line-findings |
/resources (resources) |
Resources | /resources/latest-statistics |
The generated scaffold creates all three pages with their routes, but contains no $cwa->redirect() call and no other redirect. A site loaded from it serves an empty Home page at / instead of redirecting.
Cause
In Fixture/Generator/Site/SiteReader::orderRedirects(), only routes not already in $siteRoutes become pending redirects:
if (null !== $route->getRedirect() && !isset($available[spl_object_id($route)])) {
A page's own route is in $siteRoutes, so its redirect is skipped. It isn't added to $unresolvedRedirects either, so nothing gets reported.
Expected
The redirect is carried. For a route that is both a page's route and a redirect, the scaffold should set the redirect after the routes exist, for example in an onRoutesCreated() / afterRoutes() callback ($cwa->getRoute('home')->setRedirect($cwa->getRoute('graphs')), or a builder equivalent). Failing that, it should at least be listed under could not be reproduced.
Downstream workaround: a small fixture that depends on the generated scaffold and sets the three redirects when they're missing.
- 主要言語
- PHP
- スター
- 32
- フォーク
- 8
- 平均マージ
- 58分
- マージ済み PR(30日)
- 147
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
components-web-app/api-components-bundle のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
components-web-app/api-components-bundle#333 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
components-web-app/api-components-bundle#325 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
components-web-app/api-components-bundle#259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
components-web-app/api-components-bundle#186 ·
メンテナーはふだん 1 日以内に返信
components-web-app/api-components-bundle の issue をすべて見る
似ている issue
-
Authentication / Authorization Feature: Volunteer
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
PHP workflow streaming requests buffer the full SSE response対応中かも @Winoren が今日担当しました。 オープンreview: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
langgenius/dify#44270 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug customer-reported
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
MagnaCapax/PMSS#1085 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信