-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Updated documentation for devcontainers #3100
Updated documentation for devcontainers #3100
Conversation
WalkthroughThe pull request focuses on improving the installation documentation for the Talawa API. The changes include restructuring the Changes
Sequence DiagramsequenceDiagram
participant User
participant VSCode
participant Docker
participant PostgreSQL
User->>VSCode: Install devcontainer extension
User->>VSCode: Open project directory
VSCode->>Docker: Build devcontainer
Docker->>PostgreSQL: Set up local database
User->>VSCode: Start application in dev mode
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3100 +/- ##
=================================================
Coverage 39.85% 39.85%
=================================================
Files 453 453
Lines 33203 33203
Branches 385 385
=================================================
Hits 13234 13234
Misses 19969 19969 ☔ View full report in Codecov by Sentry. |
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: 3
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
docs/docs/docs/getting-started/installation.md
(3 hunks)envFiles/.env.devcontainer
(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/docs/docs/getting-started/installation.md
201-201: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
205-205: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
237-237: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
237-237: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
239-239: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
241-241: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
241-241: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
243-243: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
245-245: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
245-245: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
247-247: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
249-249: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
249-249: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
270-270: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
273-273: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
🪛 LanguageTool
docs/docs/docs/getting-started/installation.md
[grammar] ~248-~248: The word “output” is spelled as one word.
Context: ...e startup is complete, the last line of out put should look like this: ``` {"outc...
(OUT_COMPOUNDS)
[grammar] ~257-~257: The word “setup” is a noun. The verb is spelled with a space.
Context: ...## Setup: Using the VScode IDE You can setup the app using the VScode IDE. Here are ...
(NOUN_VERB_CONFUSION)
[style] ~265-~265: Consider using the more formal “until”.
Context: ...take a few minutes to complete. 1. Wait till the process is complete and you see por...
(TILL)
[uncategorized] ~265-~265: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...te. 1. Wait till the process is complete and you see ports being forwarded in the te...
(COMMA_COMPOUND_SENTENCE)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Run tests for talawa api
- GitHub Check: Analyse Code With CodeQL (typescript)
🔇 Additional comments (3)
envFiles/.env.devcontainer (1)
35-35
: Verify database connectivity with the new host configuration.The change from
postgres
tolocalhost
aligns with the documentation updates. However, we should verify that:
- The database is accessible on localhost
- The application can connect to it successfully
✅ Verification successful
Change to localhost is correct for devcontainer environment
The modification from
postgres
tolocalhost
in.env.devcontainer
is valid and follows proper devcontainer patterns. The database will be accessible because:
- The PostgreSQL container port is correctly mapped to the host
- The devcontainer configuration includes proper networking setup
- This follows standard Docker development container practices
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify database connectivity with the new host configuration # Test 1: Check if PostgreSQL is listening on localhost echo "Testing PostgreSQL connectivity..." nc -zv localhost 5432 # Test 2: Check if the database exists and is accessible PGPASSWORD=password psql -h localhost -U talawa -d talawa -c "\l" >/dev/null 2>&1 if [ $? -eq 0 ]; then echo "Successfully connected to database" else echo "Failed to connect to database" fiLength of output: 354
Script:
#!/bin/bash # Check other env files and docker configurations for database host patterns echo "=== Environment Files ===" fd -t f -e .env -e .env.example -e .env.sample . | xargs cat 2>/dev/null || true echo -e "\n=== Docker Compose Files ===" fd -t f -e yml -e yaml . | grep -i docker-compose | xargs cat 2>/dev/null || true echo -e "\n=== Database Configuration Documentation ===" fd README -t f . | xargs grep -i "database\|postgres" 2>/dev/null || trueLength of output: 527
Script:
#!/bin/bash # Broader search for database and container configuration echo "=== Environment Templates ===" find . -type f -name "*.env*" -o -name "*.example" -o -name "*.sample" 2>/dev/null | xargs cat 2>/dev/null || true echo -e "\n=== Container Configurations ===" find . -type f -name "*dockerfile*" -o -name "*compose*" -o -name "*.dc.*" 2>/dev/null | xargs cat 2>/dev/null || true echo -e "\n=== Setup Documentation ===" find . -type f -name "CONTRIBUTING*" -o -name "DEVELOPMENT*" -o -name "INSTALL*" -o -name "*.md" 2>/dev/null | xargs grep -i -l "setup\|install\|database\|postgres" 2>/dev/null || true echo -e "\n=== Database Configuration Patterns ===" rg -l "(?i)(database_url|db_host|postgres.*host)" || trueLength of output: 33039
docs/docs/docs/getting-started/installation.md (2)
Line range hint
181-195
: LGTM! Clear and improved section headers.The section headers have been updated for better clarity and consistency.
🧰 Tools
🪛 LanguageTool
[style] ~179-~179: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...tainers 7. Typescript 8. Node.js It is very important that you go through [this](https://code...(EN_WEAK_ADJECTIVE)
276-276
: LGTM! Clear development mode operation instructions.The development mode operation instructions are clear and provide both normal and debugging mode options.
1. Install the PostgreSQL database. | ||
```bash | ||
sudo apt-get -y install postgresql postgresql-contrib | ||
sudo systemctl enable postgresql.service | ||
sudo systemctl start postgresql.service | ||
``` | ||
1. Connect to the PostgreSQL CLI | ||
|
||
```bash | ||
sudo -u postgres psql | ||
|
||
``` | ||
|
||
1. Create the database, grant permissions then exit | ||
```sql | ||
CREATE DATABASE talawa; | ||
CREATE USER talawa WITH PASSWORD 'password'; | ||
GRANT ALL PRIVILEGES ON DATABASE talawa TO talawa; | ||
GRANT ALL ON SCHEMA public TO talawa; | ||
sudo systemctl disable postgresql.service | ||
sudo systemctl stop postgresql.service | ||
``` | ||
1. There is no need to create databases, users and any associated permissions | ||
1. These steps are done so that the docker container will have access to the PostgreSQL executables |
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.
🧹 Nitpick (assertive)
Simplify PostgreSQL setup instructions.
The instructions have been simplified by removing manual database creation steps. However, we should clarify that the PostgreSQL service needs to be stopped to avoid port conflicts with the Docker container.
1. Install the PostgreSQL database.
```bash
sudo apt-get -y install postgresql postgresql-contrib
sudo systemctl disable postgresql.service
sudo systemctl stop postgresql.service
```
+ 1. The PostgreSQL service must be stopped to avoid port conflicts with the Docker container
1. There is no need to create databases, users and any associated permissions
1. These steps are done so that the docker container will have access to the PostgreSQL executables
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
201-201: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
205-205: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
1. Build the docker devcontainer | ||
``` | ||
devcontainer build --workspace-folder . | ||
``` | ||
1. When startup is complete, the last like of the output should be: | ||
1. When build is complete, the last line of the output should be: | ||
``` | ||
{"outcome":"success","imageName":"talawa-api"} | ||
``` | ||
All done! | ||
1. Start the docker devcontainer | ||
``` | ||
devcontainer up --workspace-folder . | ||
``` | ||
1. When the startup is complete, the last line of out put should look like this: | ||
``` | ||
{"outcome":"success","containerId":"XXX","composeProjectName":"talawa","remoteUser":"talawa","remoteWorkspaceFolder":"/home/talawa/api"} | ||
``` |
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.
🧹 Nitpick (assertive)
Fix formatting and typos in the devcontainer setup instructions.
The instructions need some formatting improvements and typo fixes.
1. Build the docker devcontainer
- ```
+ ```bash
devcontainer build --workspace-folder .
```
1. When build is complete, the last line of the output should be:
- ```
+ ```json
{"outcome":"success","imageName":"talawa-api"}
```
1. Start the docker devcontainer
- ```
+ ```bash
devcontainer up --workspace-folder .
```
-1. When the startup is complete, the last line of out put should look like this:
+1. When the startup is complete, the last line of output should look like this:
- ```
+ ```json
{"outcome":"success","containerId":"XXX","composeProjectName":"talawa","remoteUser":"talawa","remoteWorkspaceFolder":"/home/talawa/api"}
```
🧰 Tools
🪛 LanguageTool
[grammar] ~248-~248: The word “output” is spelled as one word.
Context: ...e startup is complete, the last line of out put should look like this: ``` {"outc...
(OUT_COMPOUNDS)
🪛 markdownlint-cli2 (0.17.2)
237-237: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
237-237: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
239-239: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
241-241: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
241-241: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
243-243: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
245-245: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
245-245: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
247-247: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
249-249: Fenced code blocks should be surrounded by blank lines
null
(MD031, blanks-around-fences)
249-249: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
You can setup the app using the VScode IDE. Here are the steps to follow: | ||
|
||
1. Open cloned talawa-api project in Visual Studio Code. | ||
2. You should see a notification that a `devcontainer` configuration file is available. Click on the notification and select `Reopen in Container`. | ||
1. Install the `devcontainer` extension in VScode. | ||
1. You should see a notification that a `devcontainer` configuration file is available. Click on the notification and select `Reopen in Container`. | ||
- If you don't see the notification, you can open the command palette by pressing `Ctrl+Shift+P` and search for `Reopen in Container`. | ||
- Make sure you have downloaded `devcontainer` extension of vs code. | ||
3. This will open a new Visual Studio Code window with the project running inside a Docker container. This will take a few minutes to complete. | ||
4. Wait till the process is complete and you see ports being forwarded in the terminal. | ||
5. You can check logs by clicking `Connecting to Dev Container (show log)`; | ||
6. Create a new terminal in Visual Studio Code by pressing `` Ctrl+Shift+` ``. | ||
7. Run the `pwd` command to confirm you are in the `/home/talawa/api` directory. | ||
8. Run the following command to check if the project has required dependencies installed correctly: | ||
1. This will open a new Visual Studio Code window with the project running inside a Docker container. This will take a few minutes to complete. | ||
1. Wait till the process is complete and you see ports being forwarded in the terminal. | ||
1. You can check logs by clicking `Connecting to Dev Container (show log)`; | ||
1. Create a new terminal in Visual Studio Code by pressing `` Ctrl+Shift+` ``. | ||
1. Run the `pwd` command to confirm you are in the `/home/talawa/api` directory. | ||
1. Run the following command to check if the project has required dependencies installed correctly: |
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.
🧹 Nitpick (assertive)
Fix grammar and improve VScode IDE setup instructions.
The instructions need some grammar fixes and clarity improvements.
-You can setup the app using the VScode IDE. Here are the steps to follow:
+You can set up the app using the VScode IDE. Here are the steps to follow:
1. Open cloned talawa-api project in Visual Studio Code.
1. Install the `devcontainer` extension in VScode.
1. You should see a notification that a `devcontainer` configuration file is available. Click on the notification and select `Reopen in Container`.
- If you don't see the notification, you can open the command palette by pressing `Ctrl+Shift+P` and search for `Reopen in Container`.
- - Make sure you have downloaded `devcontainer` extension of vs code.
+ - Make sure you have installed the `devcontainer` extension in VS Code.
1. This will open a new Visual Studio Code window with the project running inside a Docker container. This will take a few minutes to complete.
-1. Wait till the process is complete and you see ports being forwarded in the terminal.
+1. Wait until the process is complete and you see ports being forwarded in the terminal.
📝 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.
You can setup the app using the VScode IDE. Here are the steps to follow: | |
1. Open cloned talawa-api project in Visual Studio Code. | |
2. You should see a notification that a `devcontainer` configuration file is available. Click on the notification and select `Reopen in Container`. | |
1. Install the `devcontainer` extension in VScode. | |
1. You should see a notification that a `devcontainer` configuration file is available. Click on the notification and select `Reopen in Container`. | |
- If you don't see the notification, you can open the command palette by pressing `Ctrl+Shift+P` and search for `Reopen in Container`. | |
- Make sure you have downloaded `devcontainer` extension of vs code. | |
3. This will open a new Visual Studio Code window with the project running inside a Docker container. This will take a few minutes to complete. | |
4. Wait till the process is complete and you see ports being forwarded in the terminal. | |
5. You can check logs by clicking `Connecting to Dev Container (show log)`; | |
6. Create a new terminal in Visual Studio Code by pressing `` Ctrl+Shift+` ``. | |
7. Run the `pwd` command to confirm you are in the `/home/talawa/api` directory. | |
8. Run the following command to check if the project has required dependencies installed correctly: | |
1. This will open a new Visual Studio Code window with the project running inside a Docker container. This will take a few minutes to complete. | |
1. Wait till the process is complete and you see ports being forwarded in the terminal. | |
1. You can check logs by clicking `Connecting to Dev Container (show log)`; | |
1. Create a new terminal in Visual Studio Code by pressing `` Ctrl+Shift+` ``. | |
1. Run the `pwd` command to confirm you are in the `/home/talawa/api` directory. | |
1. Run the following command to check if the project has required dependencies installed correctly: | |
You can set up the app using the VScode IDE. Here are the steps to follow: | |
1. Open cloned talawa-api project in Visual Studio Code. | |
1. Install the `devcontainer` extension in VScode. | |
1. You should see a notification that a `devcontainer` configuration file is available. Click on the notification and select `Reopen in Container`. | |
- If you don't see the notification, you can open the command palette by pressing `Ctrl+Shift+P` and search for `Reopen in Container`. | |
- Make sure you have installed the `devcontainer` extension in VS Code. | |
1. This will open a new Visual Studio Code window with the project running inside a Docker container. This will take a few minutes to complete. | |
1. Wait until the process is complete and you see ports being forwarded in the terminal. | |
1. You can check logs by clicking `Connecting to Dev Container (show log)`; | |
1. Create a new terminal in Visual Studio Code by pressing `` Ctrl+Shift+` ``. | |
1. Run the `pwd` command to confirm you are in the `/home/talawa/api` directory. | |
1. Run the following command to check if the project has required dependencies installed correctly: |
🧰 Tools
🪛 LanguageTool
[grammar] ~257-~257: The word “setup” is a noun. The verb is spelled with a space.
Context: ...## Setup: Using the VScode IDE You can setup the app using the VScode IDE. Here are ...
(NOUN_VERB_CONFUSION)
[style] ~265-~265: Consider using the more formal “until”.
Context: ...take a few minutes to complete. 1. Wait till the process is complete and you see por...
(TILL)
[uncategorized] ~265-~265: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...te. 1. Wait till the process is complete and you see ports being forwarded in the te...
(COMMA_COMPOUND_SENTENCE)
a2b736c
into
PalisadoesFoundation:develop-postgres
Updated documentation for devcontainers
Summary by CodeRabbit
Documentation
Configuration
postgres
tolocalhost