Uh oh!
There was an error while loading. Please reload this page.
fix(feature): build url shortener feature url with trailing slash - #32
Conversation
initUrlShortener() appended the branch directly to public_urls without a
trailing slash, so DEPLOYER_CONFIG_FEATURE_URL (TYPO3_BASEURL) became
"https://host/BRANCH". Consumer projects derive the site base and string-
concatenated values (e.g. %env(TYPO3_BASEURL)%sitemap.xml) from it, which
broke absolute URLs/breadcrumbs and caused 504 hangs.
Build the URL slash-robust so it always ends with "/" regardless of whether
public_urls is configured with or without a trailing slash:
rtrim($publicUrl, '/') . '/' . $feature . '/'.
NOTE: feature .env files are generated only once ("once generated"
feature_templates). Existing feature instances must re-init (re-run
feature:setup / re-generate .env) for the corrected URL to take effect.Uh oh!
There was an error while loading. Please reload this page.
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesURL Shortener Task Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.2.2)PHPStan was skipped because the config uses disallowed Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
initUrlShortener()so the generated feature URL is built slash-robust and always ends with/, independent of whetherpublic_urlsis configured with or without a trailing slash"https://host/" . "BRANCH"→https://host/BRANCH, no trailing slash), corruptingDEPLOYER_CONFIG_FEATURE_URL(TYPO3_BASEURL) in consumer projectsbaseand all values derived from it via string concatenation (e.g.%env(TYPO3_BASEURL)%sitemap.xml, errorContentSource) → broken absolute URLs, breadcrumbs, and 504 hangs on errorChanges
deployer/feature/task/url_shortener.php—initUrlShortener()now builds the URL asrtrim($publicUrl, '/') . '/' . $feature . '/'Verification
For branch
FOO-123,DEPLOYER_CONFIG_FEATURE_URLresolves to exactlyhttps://stage.example.de/FOO-123/for both input variants:public_urlsinputhttps://stage.example.de/https://stage.example.de/FOO-123/✓https://stage.example.de(no trailing slash)https://stage.example.de/FOO-123/✓Other concatenation sites in the package (
deploy_path,dev/config/set.php,feature_scheduler.php) join withfeature_url_shortener_path, which ends in/by default — no double slashes introduced. No automated test framework exists in this Deployer recipe package, so verification was done manually.Feature config files are generated only once (
once-generatedfeature_templates). Existing feature instances must re-init (re-runfeature:setup/ regenerate their generated config) for the corrected URL to take effect.Summary by CodeRabbit
Bug Fixes
Refactor