Skip to content

fix(setup): resolve README and start script discrepancies#895

Open
SinghAtithi wants to merge 2 commits into
potpie-ai:mainfrom
SinghAtithi:fix-readme-setup-discrepancies
Open

fix(setup): resolve README and start script discrepancies#895
SinghAtithi wants to merge 2 commits into
potpie-ai:mainfrom
SinghAtithi:fix-readme-setup-discrepancies

Conversation

@SinghAtithi

@SinghAtithi SinghAtithi commented Jun 17, 2026

Copy link
Copy Markdown

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.

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).
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

legacy/scripts/start.sh is updated to use uv for both dependency synchronization and process execution, replacing the prior activated-venv approach. legacy/.env.template changes the POSTGRES_SERVER database name from momentum_dev to momentum.

Changes

uv Startup Migration

Layer / File(s) Summary
uv execution wiring and env template correction
legacy/.env.template, legacy/scripts/start.sh
start.sh adds uv sync --all-packages for root dependencies with a failure guard, then runs alembic migrations, Gunicorn (with Uvicorn worker), and Celery via uv run --project "$LEGACY_ROOT" instead of an activated virtualenv. legacy/.env.template updates POSTGRES_SERVER to use the momentum database instead of momentum_dev.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing setup discrepancies including database name mismatch, start script issues, and README additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description directly addresses the specific issues that match the changeset: database name correction and start.sh dependency resolution via uv.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread legacy/.env.template
# 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread legacy/.env.template
# CODE_PROVIDER_TOKEN=your_token

# Testing
PRIVATE_TEST_REPO_NAME=<yourGithubUsername>/potpie-private-test-repo

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need change in .env

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted this back

Comment thread README.md Outdated
Comment on lines +125 to +154
### 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this part is required in the README if the start.sh fix works well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can revert this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted back

Comment thread legacy/scripts/start.sh
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 &

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try running it from legacy folder or the root folder? Running inside the legacy folder works for me.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried running from legacy folder, did not work for me.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9d4415e and d1fe7a8.

📒 Files selected for processing (1)
  • legacy/.env.template

@SinghAtithi

Copy link
Copy Markdown
Author

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9d4415e and d1fe7a8.

📒 Files selected for processing (1)
  • legacy/.env.template
🛑 Comments failed to post (1)
legacy/.env.template (1)

264-264: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Remove 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}.

@SinghAtithi SinghAtithi requested a review from Dsantra92 June 19, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] main branch has broken imports: missing bundle_to_agent_envelope and handle_apply_episode

2 participants