Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds a Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 12 minutes and 39 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/nuxi/src/commands/dev.ts`:
- Around line 104-128: If registerPortless or listener.showURL fails we
currently restore PORTLESS_URL and call close() but never remove a previously
created alias; modify the catch block around registerPortless/listener.showURL
to call removePortlessAlias(cwd, portlessName!) (awaiting it and ignoring
errors) before restoring process.env.PORTLESS_URL and rethrowing; ensure the
existing closePortless assignment (which also calls removePortlessAlias) remains
for the success path and reference registerPortless, closePortless,
removePortlessAlias, listener.showURL, close, and previousPortlessURL when
implementing the cleanup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7899ac77-5dc4-4f1f-bd7e-6cf32c2fc6e5
📒 Files selected for processing (4)
packages/nuxi/src/commands/dev.tspackages/nuxi/src/dev/portless.tspackages/nuxi/test/unit/dev/portless.spec.tspackages/nuxt-cli/test/e2e/dev.spec.ts
commit: |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/nuxt-cli/test/e2e/dev.spec.ts`:
- Around line 99-107: The extractLoggedURLs function returns raw matches that
may include formatting artifacts or trailing slashes causing flaky CI
assertions; update extractLoggedURLs to normalize each URL before returning by
trimming whitespace, stripping ANSI escape sequences, removing surrounding
punctuation (like trailing ')' or '.'), and trimming a single trailing slash
(and optionally lowercasing) so comparisons are consistent; keep the function
name extractLoggedURLs and apply normalization to every match returned from
value.match(...) so tests comparing those URLs are stable.
- Around line 173-196: The test currently calls await close() inside the try
block so a thrown assertion can leak the spawned dev process; refactor to
capture the close function from runCommand into an outer-scoped variable (e.g.,
let close: (() => Promise<void>) | undefined), assign it when runCommand
resolves, and then in the finally block await close() if defined before
restoring consoleLog.mockRestore() and removing binDir; reference runCommand and
the close function to locate where to move the cleanup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3cb523d0-edc2-49db-b161-68f2d2e7db57
📒 Files selected for processing (4)
packages/nuxi/src/commands/dev.tspackages/nuxi/src/dev/portless.tspackages/nuxi/test/unit/commands/dev.spec.tspackages/nuxt-cli/test/e2e/dev.spec.ts
✅ Files skipped from review due to trivial changes (1)
- packages/nuxi/src/dev/portless.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/nuxi/src/commands/dev.ts
| function extractLoggedURLs(calls: unknown[][]) { | ||
| return calls.flatMap(call => call.flatMap((value) => { | ||
| if (typeof value !== 'string') { | ||
| return [] | ||
| } | ||
|
|
||
| return value.match(/https?:\/\/[^\s)]+/g) || [] | ||
| })) | ||
| } |
There was a problem hiding this comment.
Normalize logged URLs before assertion to fix CI flake/failure.
The current equality check is too strict for logged output; extracted URLs can include formatting artifacts or a trailing slash, which matches the CI failure at Line 190.
💡 Suggested patch
function extractLoggedURLs(calls: unknown[][]) {
return calls.flatMap(call => call.flatMap((value) => {
if (typeof value !== 'string') {
return []
}
- return value.match(/https?:\/\/[^\s)]+/g) || []
+ const cleaned = value.replace(/\u001B\[[0-9;]*m/g, '')
+ return (cleaned.match(/https?:\/\/[^\s)]+/g) || []).map(url => url.replace(/\/$/, ''))
}))
}
@@
- expect(extractLoggedURLs(consoleLog.mock.calls)).toContain(portlessURL)
+ expect(extractLoggedURLs(consoleLog.mock.calls)).toContain(portlessURL.replace(/\/$/, ''))Also applies to: 190-190
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/nuxt-cli/test/e2e/dev.spec.ts` around lines 99 - 107, The
extractLoggedURLs function returns raw matches that may include formatting
artifacts or trailing slashes causing flaky CI assertions; update
extractLoggedURLs to normalize each URL before returning by trimming whitespace,
stripping ANSI escape sequences, removing surrounding punctuation (like trailing
')' or '.'), and trimming a single trailing slash (and optionally lowercasing)
so comparisons are consistent; keep the function name extractLoggedURLs and
apply normalization to every match returned from value.match(...) so tests
comparing those URLs are stable.
Adds
nuxi dev --portless, precomputes the Portless hostname so Nuxt/Vite allowlists include it, and keeps the alias in sync across forked dev restarts.Related: unjs/listhen#228
Closes #1300.