You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
netlify logs --url https://feature--logs--my-site.netlify.app rejects the linked site because the resolver splits on the first --. Match the complete linked-site hostname suffix instead, preserving the entire branch name, including when the site name also contains --. Reject empty prefixes and extra hostname labels before making an API call.
Add ten resolver cases covering double-hyphen branch/site names, canonical URLs, deploy permalinks, and invalid hosts. Four cases fail against the original resolver.
Validation
Logging tests: 44 passed across three files.
npm run typecheck: passed.
ESLint and oxfmt on the changed files: passed.
git diff --check: passed.
Full unit run on Windows/Node 24.14.1: 735 passed, 1 failed. The hosted-release symlink test times out; the same isolated test also times out against the original source. The full run additionally reports an unhandled telemetry rejection from the existing unsupported-Windows traffic-mesh test.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Summary
Summary by CodeRabbit
Bug Fixes
Improved deploy log lookup for preview URLs involving hyphenated site names or branch names.
Invalid preview URLs are now rejected rather than being used for a deploy lookup.
Walkthrough
resolveDeployIdFromUrl now matches deploy-preview hostnames against the full --<site-name>.netlify.app suffix. It extracts the preceding branch prefix and rejects an empty prefix or one containing a dot. Unit tests cover hyphenated site and branch names, deploy permalinks, canonical site URLs, and invalid branch URLs.
No actionable issue remains that would prevent merging after normal checks.
Architecture Summary
Architecture risk:🔵 Low · up to 70b0c
The change affects 2 systems.
Changed systems:src, tests
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — src (service) was modified; 1 changed file maps to changed impact.
observed — tests (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
observed — Modified behavior in src/commands/logs/log-api.ts: resolveDeployIdFromUrl now requires the hostname to end with --<site-name>.netlify.app and extracts the entire preceding prefix, rejecting an empty prefix or one containing a dot. This replaces parsing the first hostname label at its first -- and checking the separately extracted suffix against the site name.
observed — Modified behavior in tests/unit/commands/logs/log-api.test.ts: Added tests for four combinations of hyphenated site names and branch names, checking the resolved deploy ID and that deploy lookup uses the supplied site ID, branch, and per_page: 20.
observed — Modified behavior in tests/unit/commands/logs/log-api.test.ts: Added tests that a 24-character deploy permalink resolves directly and a canonical site URL resolves to undefined, with neither case calling the deploy-list API.
observed — Modified behavior in tests/unit/commands/logs/log-api.test.ts: Added tests for four invalid branch URL shapes, expecting the linked-project mismatch error before any deploy-list API call.
Pre-merge checks | 5
✅ Passed checks (5 passed)
Check name
Status
Explanation
Title check
The title clearly identifies the fix for branch URLs that contain double hyphens, which is the primary change.
Description check
The description directly explains the resolver bug, the required behavior, the added regression tests, and validation results.
Linked Issues check
Issue #8606 requires branch deploy URLs to preserve -- in branch and site names, and to reject empty prefixes and extra hostname labels before the deploy lookup. resolveDeployIdFromUrl now matches…
Out of Scope Changes check
The pull request changes only resolveDeployIdFromUrl and its unit tests. The implementation and tests directly support issue #8606. No unrelated product behavior or unrelated files appear in the rev…
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8606.
netlify logs --url https://feature--logs--my-site.netlify.apprejects the linked site because the resolver splits on the first--. Match the complete linked-site hostname suffix instead, preserving the entire branch name, including when the site name also contains--. Reject empty prefixes and extra hostname labels before making an API call.Add ten resolver cases covering double-hyphen branch/site names, canonical URLs, deploy permalinks, and invalid hosts. Four cases fail against the original resolver.
Validation
npm run typecheck: passed.git diff --check: passed.Checklist