[codex] Prioritize web port output#3
Conversation
|
Warning Review limit reached
More reviews will be available in 45 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR standardizes port helper output ordering across shell, Node.js, and Python implementations so that ChangesPort Helper Output Ordering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6d673d14e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| POSTGRES_URL="postgresql://app:app@127.0.0.1:${POSTGRES_HOST_PORT}/app" | ||
| DATABASE_URL="$POSTGRES_URL" | ||
| REDIS_URL="redis://127.0.0.1:${REDIS_HOST_PORT}/0" | ||
| WEB_URL="http://127.0.0.1:${WEB_PORT}" |
There was a problem hiding this comment.
Recompute WEB_URL after direct port overrides
When using the documented exec form with a direct port override, such as ./scripts/worktree-ports.sh exec WEB_PORT=9999 -- ..., run_with_env calls export_env and then re-exports the override, so WEB_PORT becomes 9999 while this newly added WEB_URL still points at the generated port. Any tool or service that consumes WEB_URL in that context opens the wrong address; recompute derived URLs after overrides or derive them from the final port values. The Python helper has the same stale WEB_URL pattern.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR adjusts the worktree port helpers and dev startup output so the web surface is discovered first by tooling that scans logs for URLs, and aligns the Node/Python/Bash variants around reserved-block allocation, browser-restricted port avoidance, and clearer collision handling.
Changes:
- Print
WEB_URLfirst (thenWEB_PORT,API_PORT, …) across the worktree port helpers and document the ordering. - Update
scripts/dev.shto print the full assigned worktree port block before service logs. - Expand the Node (MJS) helper to match the reserved-block + browser-safe behavior already present in the other variants.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
stacks/python/tests/test_worktree_ports.py |
Adds an assertion that env_values() returns keys with WEB_URL first. |
stacks/python/scripts/worktree-ports.py |
Reorders/extends env_values() output to include WEB_URL first and keeps reserved-block logic aligned with other helpers. |
scripts/worktree-ports.sh |
Adds WEB_URL, prints it first in env, and exports it for consumers. |
scripts/dev.sh |
Prints the full worktree-ports.sh env block up front; uses WEB_URL in the startup banner. |
README.md |
Documents that the helper prints WEB_URL first for URL-scanning tools. |
extras/dev-scripts/worktree-ports.mjs |
Aligns Node helper with reserved block handling, browser-restricted ports, and clearer error reporting; emits WEB_URL first. |
docs/development.md |
Documents the expected output ordering for worktree-ports.sh env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -228,8 +228,17 @@ def env_values(env: dict[str, str] | None = None) -> dict[str, str]: | |||
| values = ports_for_environment(env or os.environ) | |||
| postgres = values["POSTGRES_HOST_PORT"] | |||
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@extras/dev-scripts/worktree-ports.mjs`:
- Around line 26-32: Reformat the WEB_RESTRICTED_PORTS constant so it matches
the repository's Biome formatting rules: run the project formatter (Biome) on
extras/dev-scripts/worktree-ports.mjs or specifically reformat the
WEB_RESTRICTED_PORTS array definition (the Set([...]) block) and then re-run the
linter/CI; ensure spacing, line breaks, and trailing commas follow the repo
formatter conventions so CI passes.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 903e7593-6a9a-498c-9829-ed9dc13c13c0
📒 Files selected for processing (7)
README.mddocs/development.mdextras/dev-scripts/worktree-ports.mjsscripts/dev.shscripts/worktree-ports.shstacks/python/scripts/worktree-ports.pystacks/python/tests/test_worktree_ports.py
Summary
WEB_URLfirst from worktree port helpers so URL scanners see the web surface before API or infrastructure URLs.Validation
node extras/dev-scripts/worktree-ports.mjs envWORKTREE_PORT_BLOCK_START=9000 node extras/dev-scripts/worktree-ports.mjs env./scripts/worktree-ports.sh envWORKTREE_PORT_BLOCK_START=9000 ./scripts/worktree-ports.sh envnode --check extras/dev-scripts/worktree-ports.mjssh -n scripts/worktree-ports.sh scripts/dev.shpython3 -m py_compile stacks/python/scripts/worktree-ports.pypython3behavior assertions for the Python helperbun run lintbun run format:checkgit diff --checkNotes
UV_LOCKED=1 uv run pytest tests/test_worktree_ports.pycould not run because the global exclude-newer setting would require updatinguv.lock../scripts/test.shcould not run becausevitestis not installed in this workspace.Summary by CodeRabbit
Documentation
WEB_URLappears first for orchestrators scanning startup output.New Features
Chores