-
-
Notifications
You must be signed in to change notification settings - Fork 124
Add support for dev containers. #2248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds a new .devcontainer/.env with Postgres and ZenStack test DB credentials for local development, and updates .gitignore to ignore .pnpm-store. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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 |
@ymc9 I didn't realize there was a separate repo for v3, which already seems to have a dev container JSON file. I don't see an included postgres container or automatic installation of the extensions, however. How would you like this to proceed? |
Hi @sanny-io , thanks for working on this! The change looks great, let's get it merged. Yes, v3 resides in a separate repo for now. There's a devcontainer config and it uses the postgresql feature. I'm not sure what real difference it makes from an explicit container, but it seems to be working fine (although I haven't used dev container extensively). |
Hi @sanny-io , do you think this PR is in a completed status? Asking cause it's still Draft now. |
@ymc9 with the release of Postgres 18, I haven't finished looking into the changes needed for docker-compose files. I know for one thing, the volume has changed from This PR should be ready within a few days 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.devcontainer/.env (1)
11-11
: Add the trailing newline to satisfy dotenv linting.
dotenv-linter
flags the missing newline at EOF; adding one keeps the file compliant and silences the warning.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
.devcontainer/devcontainer.json
is excluded by!**/*.json
.devcontainer/docker-compose.yml
is excluded by!**/*.yml
📒 Files selected for processing (2)
.devcontainer/.env
(1 hunks).gitignore
(1 hunks)
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
.devcontainer/.env
[warning] 2-2: [UnorderedKey] The POSTGRES_PASSWORD key should go before the POSTGRES_USER key
(UnorderedKey)
[warning] 3-3: [UnorderedKey] The POSTGRES_DB key should go before the POSTGRES_PASSWORD key
(UnorderedKey)
[warning] 4-4: [UnorderedKey] The POSTGRES_HOST key should go before the POSTGRES_PASSWORD key
(UnorderedKey)
[warning] 5-5: [UnorderedKey] The POSTGRES_PORT key should go before the POSTGRES_USER key
(UnorderedKey)
[warning] 8-8: [UnorderedKey] The ZENSTACK_TEST_DB_PASS key should go before the ZENSTACK_TEST_DB_USER key
(UnorderedKey)
[warning] 9-9: [UnorderedKey] The ZENSTACK_TEST_DB_NAME key should go before the ZENSTACK_TEST_DB_PASS key
(UnorderedKey)
[warning] 10-10: [UnorderedKey] The ZENSTACK_TEST_DB_HOST key should go before the ZENSTACK_TEST_DB_NAME key
(UnorderedKey)
[warning] 11-11: [EndingBlankLine] No blank line at the end of the file
(EndingBlankLine)
[warning] 11-11: [UnorderedKey] The ZENSTACK_TEST_DB_PORT key should go before the ZENSTACK_TEST_DB_USER key
(UnorderedKey)
@ymc9 this should be good to go. Delete the previous volume that Postgres was using if you haven't already, or the container won't work properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sanny-io ! LGTM and I'm merging it.
This pull request adds support for dev containers, which are pre-configured developer environments that make contributing to projects significantly easier, as there is little to no setup required for new contributors to get started.
Per the contributing guidelines, the workspace is pre-configured to use Node.js v20 and pnpm v9.15.9
It also comes with a Postgres database upon which tests can be ran. I've looked at the test suite on GitHub actions, and it appears to run against the latest version of Postgres, so I have set the Postgres container to also pull the latest Postgres image.
The workspace also comes with the Langium and Jest Runner extensions for Visual Studio Code installed, which I see are recommend here.
Finally, upon initializing the container, it automatically installs dependencies, builds the project, and scaffolds the tests.
To get started:
Ctrl + Shift + P
Still to do: document this process in the contributing guidelines.