Skip to content

Commit 57ae541

Browse files
committed
Merge branch 'api_fail_docker' of https://github.com/prayanshchh/prayansh-talawa-api into api_fail_docker
merge# Please enter a commit message to explain why this merge is necessary,
2 parents 6ca6131 + 4fa5812 commit 57ae541

19 files changed

+1060
-173
lines changed

.devcontainer/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Use Debian Bookworm as the base image
2+
FROM ubuntu:latest as builder
3+
4+
# Update package list and install dependencies
5+
RUN apt-get update && \
6+
apt-get install -y \
7+
git \
8+
vim \
9+
curl \
10+
gnupg2 \
11+
lsb-release \
12+
ca-certificates
13+
14+
# Install Node.js (latest LTS version) and npm
15+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
16+
apt-get install -y nodejs
17+
18+
# Install additional developer tools (optional)
19+
RUN apt-get install -y \
20+
neovim \
21+
gh # GitHub CLI
22+
23+
# Default command (to keep the container running)
24+
CMD ["tail", "-f", "/dev/null"]

.devcontainer/devcontainer.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "talawa api dev environment",
3+
"dockerComposeFile": "docker-compose.yaml",
4+
"service": "devcontainer",
5+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
6+
// Settings to apply to the workspace.
7+
"customizations": {
8+
// Configure properties specific to VS Code.
9+
"vscode": {
10+
"settings": {
11+
"terminal.integrated.shell.linux": "/bin/bash",
12+
"typescript.tsdk": "node_modules/typescript/lib",
13+
"database.host": "mongodb",
14+
"redis.host": "redis-stack-server"
15+
},
16+
// List of extensions to install inside the container
17+
"extensions": [
18+
"dbaeumer.vscode-eslint",
19+
"ms-azuretools.vscode-docker",
20+
"esbenp.prettier-vscode",
21+
"redhat.vscode-yaml"
22+
]
23+
}
24+
},
25+
// Set up forward ports
26+
"forwardPorts": [
27+
4000, // Server port
28+
27017, // MongoDB port
29+
6379 // Redis port
30+
],
31+
// Post-create commands to run after creating the container
32+
"postCreateCommand": "npm install",
33+
34+
// Volumes from docker-compose are already included
35+
"shutdownAction": "stopCompose"
36+
}

.devcontainer/docker-compose.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
services:
2+
mongodb:
3+
image: mongo:latest
4+
ports:
5+
- 27017:27017
6+
volumes:
7+
- mongodb-data:/data/db
8+
9+
redis-stack-server:
10+
image: redis/redis-stack-server:latest
11+
ports:
12+
- 6379:6379
13+
volumes:
14+
- redis-data:/data
15+
16+
devcontainer:
17+
build:
18+
context: .
19+
dockerfile: Dockerfile
20+
ports:
21+
- "${SERVER_PORT:-4000}:4000"
22+
volumes:
23+
- ../..:/workspaces:cached
24+
depends_on:
25+
- mongodb
26+
- redis-stack-server
27+
environment:
28+
- MONGO_DB_URL=mongodb://mongodb:27017
29+
- REDIS_HOST=redis-stack-server
30+
- REDIS_PORT=6379
31+
32+
volumes:
33+
mongodb-data:
34+
redis-data:

.eslintignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 122 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ Thanks for submitting a pull request! Please provide enough information so that
2424

2525
Fixes #<!--Add related issue number here.-->
2626

27-
**Did you add tests for your changes?**
28-
29-
<!--Yes or No. Note: Add unit tests or automation tests for your code.-->
30-
3127
**Snapshots/Videos:**
3228

3329
<!--Add snapshots or videos wherever possible.-->
@@ -45,6 +41,19 @@ Fixes #<!--Add related issue number here.-->
4541

4642
<!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. -->
4743

44+
## Checklist
45+
46+
### CodeRabbit AI Review
47+
- [ ] I have reviewed and addressed all critical issues flagged by CodeRabbit AI
48+
- [ ] I have implemented or provided justification for each non-critical suggestion
49+
- [ ] I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented
50+
51+
### Test Coverage
52+
- [ ] I have written tests for all new changes/features
53+
- [ ] I have verified that test coverage meets or exceeds 95%
54+
- [ ] I have run the test suite locally and all tests pass
55+
56+
4857
**Other information**
4958

5059
<!--Add extra information about this PR here-->

.github/workflows/pull-request-target.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,21 @@ jobs:
2525
message: |
2626
## Our Pull Request Approval Process
2727
28-
We have these basic policies to make the approval process smoother for our volunteer team.
28+
Thanks for contributing!
2929
3030
### Testing Your Code
31-
32-
Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
33-
34-
1. The overall code coverage drops below the target threshold of the repository
35-
2. Any file in the pull request has code coverage levels below the repository threshold
36-
3. Merge conflicts
37-
38-
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.
31+
32+
Remember, your PRs won't be reviewed until these criteria are met:
33+
34+
1. We don't merge PRs with poor code quality.
35+
1. Follow coding best practices such that CodeRabbit.ai approves your PR.
36+
1. We don't merge PRs with failed tests.
37+
1. When tests fail, click on the `Details` link to learn more.
38+
1. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
39+
1. Tests may fail if you edit sensitive files. Ask to add the `ignore-sensitive-files-pr` label if the edits are necessary.
40+
1. We cannot merge PRs with conflicting files. These must be fixed.
41+
42+
Our policies make our code better.
3943
4044
### Reviewers
4145

.github/workflows/pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ jobs:
427427
runs-on: ubuntu-latest
428428
steps:
429429
- name: "Check if base branch is develop"
430-
if: github.event.pull_request.base.ref != 'develop-postgres'
430+
if: github.event.pull_request.base.ref != 'develop'
431431
run: |
432-
echo "PR is not against develop-postgres branch. Please refer PR_GUIDELINES.md"
432+
echo "PR is not against develop branch. Please refer PR_GUIDELINES.md"
433433
exit 1

.husky/pre-commit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
#!/usr/bin/env sh
21

32
# Disable the hooks in CI
43
[ -n "$CI" ] && exit 0
54

65
# Change to the current directory
7-
. "$(dirname -- "$0")/_/husky.sh"
86

97
# Checks code for typescript type errors and throws errors if found.
108
npm run typecheck

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ COPY . .
1111

1212
EXPOSE 4000
1313

14-
CMD ["npm", "run", "dev"]
14+
CMD ["npm", "run", "dev"]

0 commit comments

Comments
 (0)