fix(setup): resolve README and start script discrepancies#895
fix(setup): resolve README and start script discrepancies#895SinghAtithi wants to merge 2 commits into
Conversation
Fixes the following issues discovered during setup: 1. Database name mismatch: .env.template used 'momentum_dev' but compose.yaml creates 'momentum', causing migration failures. 2. Shell syntax error in .env.template: PRIVATE_TEST_REPO_NAME contained <> characters which bash interprets as redirection operators when .env is sourced. 3. start.sh used root .venv but legacy deps (alembic, gunicorn, celery) are not installed there because legacy/ is not in the uv workspace. Now uses 'uv run --project "$LEGACY_ROOT"' for all legacy commands. 4. README lacked troubleshooting for common startup issues (port conflicts, alembic not found, .env redirection errors).
📝 WalkthroughWalkthrough
Changesuv Startup Migration
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
| # Database Configuration | ||
| POSTGRES_PASSWORD=your_password_here | ||
| POSTGRES_SERVER=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/momentum_dev | ||
| POSTGRES_SERVER=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/momentum |
There was a problem hiding this comment.
because there is a mismatch in compost.yaml file it creates with momentum and not momentum_dev, either of the one needs to be modified.
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: momentum| # CODE_PROVIDER_TOKEN=your_token | ||
|
|
||
| # Testing | ||
| PRIVATE_TEST_REPO_NAME=<yourGithubUsername>/potpie-private-test-repo |
There was a problem hiding this comment.
We don't need change in .env
| ### Troubleshooting | ||
|
|
||
| #### Port already in use | ||
| If you see errors like `address already in use` for ports `5432` (Postgres) or `6379` (Redis), you likely already have services bound to those ports. Edit `legacy/compose.yaml` to map to different host ports, for example: | ||
|
|
||
| ```yaml | ||
| # In legacy/compose.yaml | ||
| services: | ||
| postgres: | ||
| ports: | ||
| - "5433:5432" # change the host side | ||
| redis: | ||
| ports: | ||
| - "6380:6379" # change the host side | ||
| ``` | ||
|
|
||
| Then update your `legacy/.env` accordingly: | ||
|
|
||
| ```bash | ||
| POSTGRES_SERVER=postgresql://postgres:mysecretpassword@localhost:5433/momentum | ||
| REDISPORT=6380 | ||
| BROKER_URL=redis://127.0.0.1:6380/0 | ||
| ``` | ||
|
|
||
| #### `alembic: command not found` | ||
| The `legacy` folder is not part of the uv workspace (`members = ["potpie/*"]`), so running `uv sync --all-packages` from the repo root does not install legacy dependencies (gunicorn, celery, alembic). Ensure you run `uv sync --project legacy/` before starting, or use the `legacy/scripts/start.sh` script which handles this for you. | ||
|
|
||
| #### `.env: line N: yourGithubUsername: No such file or directory` | ||
| The `.env.template` contains `PRIVATE_TEST_REPO_NAME=<yourGithubUsername>/potpie-private-test-repo`. Because `.env` is sourced by bash, the `<>` characters are interpreted as redirection operators. Edit your `.env` to comment out or remove that line, or escape the value in quotes. | ||
|
|
There was a problem hiding this comment.
I don't think this part is required in the README if the start.sh fix works well.
| CELERY_QUEUES="${CELERY_QUEUES},context-graph-etl" | ||
| fi | ||
| celery -A app.celery.celery_app worker --loglevel=debug -Q "${CELERY_QUEUES}" -E --concurrency=1 --pool=solo -B --schedule=.celerybeat-schedule & | ||
| uv run --project "$LEGACY_ROOT" celery -A app.celery.celery_app worker --loglevel=debug -Q "${CELERY_QUEUES}" -E --concurrency=1 --pool=solo -B --schedule=.celerybeat-schedule & |
There was a problem hiding this comment.
Did you try running it from legacy folder or the root folder? Running inside the legacy folder works for me.
There was a problem hiding this comment.
Tried running from legacy folder, did not work for me.
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 `@legacy/.env.template`:
- Line 264: Remove the angle brackets from the placeholder in the
PRIVATE_TEST_REPO_NAME environment variable. The variable currently contains
<yourGithubUsername> which uses angle brackets that will be interpreted as shell
redirection operators if the file is sourced. Replace the angle brackets with an
alternative placeholder format that does not use shell metacharacters, such as
curly braces like {yourGithubUsername}.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 519c4ee6-e489-494b-ba7f-884f69b570bd
📒 Files selected for processing (1)
legacy/.env.template
|
Hey @Dsantra92 I have reverted back the changes you mentioned that are not required, can you please check it again and let me know if it can be merged now. |
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
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 `@legacy/.env.template`:
- Line 264: Remove the angle brackets from the placeholder in the
PRIVATE_TEST_REPO_NAME environment variable. The variable currently contains
<yourGithubUsername> which uses angle brackets that will be interpreted as shell
redirection operators if the file is sourced. Replace the angle brackets with an
alternative placeholder format that does not use shell metacharacters, such as
curly braces like {yourGithubUsername}.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 519c4ee6-e489-494b-ba7f-884f69b570bd
📒 Files selected for processing (1)
legacy/.env.template
🛑 Comments failed to post (1)
legacy/.env.template (1)
264-264:
⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove the angle brackets from this placeholder.
<and>will be interpreted as shell redirection if this file is sourced, which can abort startup before the app launches.-PRIVATE_TEST_REPO_NAME=<yourGithubUsername>/potpie-private-test-repo +PRIVATE_TEST_REPO_NAME=yourGithubUsername/potpie-private-test-repo📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.PRIVATE_TEST_REPO_NAME=yourGithubUsername/potpie-private-test-repo🤖 Prompt for 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. In `@legacy/.env.template` at line 264, Remove the angle brackets from the placeholder in the PRIVATE_TEST_REPO_NAME environment variable. The variable currently contains <yourGithubUsername> which uses angle brackets that will be interpreted as shell redirection operators if the file is sourced. Replace the angle brackets with an alternative placeholder format that does not use shell metacharacters, such as curly braces like {yourGithubUsername}.
Fixes the following issues discovered during setup:
Database name mismatch: .env.template used 'momentum_dev' but compose.yaml creates 'momentum', causing migration failures.
Shell syntax error in .env.template: PRIVATE_TEST_REPO_NAME contained <>
characters which bash interprets as redirection operators when .env is sourced.
start.sh used root .venv but legacy deps (alembic, gunicorn, celery) are not installed there because legacy/ is not in the uv workspace. Now uses 'uv run --project "$LEGACY_ROOT"' for all legacy commands.