Skip to content

Commit

Permalink
Merge branch 'api_fail_docker' of https://github.com/prayanshchh/pray…
Browse files Browse the repository at this point in the history
…ansh-talawa-api into api_fail_docker

merge# Please enter a commit message to explain why this merge is necessary,
  • Loading branch information
prayanshchh committed Dec 14, 2024
2 parents 6ca6131 + 4fa5812 commit 57ae541
Show file tree
Hide file tree
Showing 19 changed files with 1,060 additions and 173 deletions.
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use Debian Bookworm as the base image
FROM ubuntu:latest as builder

# Update package list and install dependencies
RUN apt-get update && \
apt-get install -y \
git \
vim \
curl \
gnupg2 \
lsb-release \
ca-certificates

# Install Node.js (latest LTS version) and npm
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs

# Install additional developer tools (optional)
RUN apt-get install -y \
neovim \
gh # GitHub CLI

# Default command (to keep the container running)
CMD ["tail", "-f", "/dev/null"]
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "talawa api dev environment",
"dockerComposeFile": "docker-compose.yaml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Settings to apply to the workspace.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"typescript.tsdk": "node_modules/typescript/lib",
"database.host": "mongodb",
"redis.host": "redis-stack-server"
},
// List of extensions to install inside the container
"extensions": [
"dbaeumer.vscode-eslint",
"ms-azuretools.vscode-docker",
"esbenp.prettier-vscode",
"redhat.vscode-yaml"
]
}
},
// Set up forward ports
"forwardPorts": [
4000, // Server port
27017, // MongoDB port
6379 // Redis port
],
// Post-create commands to run after creating the container
"postCreateCommand": "npm install",

// Volumes from docker-compose are already included
"shutdownAction": "stopCompose"
}
34 changes: 34 additions & 0 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
services:
mongodb:
image: mongo:latest
ports:
- 27017:27017
volumes:
- mongodb-data:/data/db

redis-stack-server:
image: redis/redis-stack-server:latest
ports:
- 6379:6379
volumes:
- redis-data:/data

devcontainer:
build:
context: .
dockerfile: Dockerfile
ports:
- "${SERVER_PORT:-4000}:4000"
volumes:
- ../..:/workspaces:cached
depends_on:
- mongodb
- redis-stack-server
environment:
- MONGO_DB_URL=mongodb://mongodb:27017
- REDIS_HOST=redis-stack-server
- REDIS_PORT=6379

volumes:
mongodb-data:
redis-data:
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

122 changes: 0 additions & 122 deletions .eslintrc.json

This file was deleted.

17 changes: 13 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ Thanks for submitting a pull request! Please provide enough information so that

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

**Did you add tests for your changes?**

<!--Yes or No. Note: Add unit tests or automation tests for your code.-->

**Snapshots/Videos:**

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

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

## Checklist

### CodeRabbit AI Review
- [ ] I have reviewed and addressed all critical issues flagged by CodeRabbit AI
- [ ] I have implemented or provided justification for each non-critical suggestion
- [ ] I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

### Test Coverage
- [ ] I have written tests for all new changes/features
- [ ] I have verified that test coverage meets or exceeds 95%
- [ ] I have run the test suite locally and all tests pass


**Other information**

<!--Add extra information about this PR here-->
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/pull-request-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ jobs:
message: |
## Our Pull Request Approval Process
We have these basic policies to make the approval process smoother for our volunteer team.
Thanks for contributing!
### Testing Your Code
Please make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
1. The overall code coverage drops below the target threshold of the repository
2. Any file in the pull request has code coverage levels below the repository threshold
3. Merge conflicts
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.
Remember, your PRs won't be reviewed until these criteria are met:
1. We don't merge PRs with poor code quality.
1. Follow coding best practices such that CodeRabbit.ai approves your PR.
1. We don't merge PRs with failed tests.
1. When tests fail, click on the `Details` link to learn more.
1. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
1. Tests may fail if you edit sensitive files. Ask to add the `ignore-sensitive-files-pr` label if the edits are necessary.
1. We cannot merge PRs with conflicting files. These must be fixed.
Our policies make our code better.
### Reviewers
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Check if base branch is develop"
if: github.event.pull_request.base.ref != 'develop-postgres'
if: github.event.pull_request.base.ref != 'develop'
run: |
echo "PR is not against develop-postgres branch. Please refer PR_GUIDELINES.md"
echo "PR is not against develop branch. Please refer PR_GUIDELINES.md"
exit 1
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env sh

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

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

# Checks code for typescript type errors and throws errors if found.
npm run typecheck
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ COPY . .

EXPOSE 4000

CMD ["npm", "run", "dev"]
CMD ["npm", "run", "dev"]
Loading

0 comments on commit 57ae541

Please sign in to comment.