diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9e3081d0ee..e1cfbfd8ea 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,4 @@ + -**Did you add tests for your changes?** - - - **Snapshots/Videos:** @@ -44,6 +42,19 @@ Fixes # +## 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** diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 53efc85cd9..dec1e234fa 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -260,6 +260,85 @@ jobs: - name: Validate Documents run: graphql-inspector validate './src/GraphQl/**/*.ts' './talawa-api/schema.graphql' + Start-App-Without-Docker: + name: Check if Talawa Admin app starts (No Docker) + runs-on: ubuntu-latest + needs: [Code-Quality-Checks, Test-Application] + if: github.actor != 'dependabot' + steps: + - name: Checkout the Repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Dependencies + run: npm install + + - name: Build Production App + run: npm run build + + - name: Start Production App + run: | + npm run preview & + echo $! > .pidfile_prod + + - name: Check if Production App is running + run: | + timeout=120 + echo "Starting production health check with ${timeout}s timeout" + while ! nc -z localhost 4173 && [ $timeout -gt 0 ]; do + sleep 1 + timeout=$((timeout-1)) + if [ $((timeout % 10)) -eq 0 ]; then + echo "Still waiting for production app to start... ${timeout}s remaining" + fi + done + + if [ $timeout -eq 0 ]; then + echo "Timeout waiting for production application to start" + exit 1 + fi + echo "Production app started successfully" + + - name: Stop Production App + run: | + if [ -f .pidfile_prod ]; then + kill "$(cat .pidfile_prod)" + fi + + - name: Start Development App + run: | + npm run serve & + echo $! > .pidfile_dev + + - name: Check if Development App is running + run: | + timeout=120 + echo "Starting development health check with ${timeout}s timeout" + while ! nc -z localhost 4321 && [ $timeout -gt 0 ]; do + sleep 1 + timeout=$((timeout-1)) + if [ $((timeout % 10)) -eq 0 ]; then + echo "Still waiting for development app to start... ${timeout}s remaining" + fi + done + + if [ $timeout -eq 0 ]; then + echo "Timeout waiting for development application to start" + exit 1 + fi + echo "Development app started successfully" + + - name: Stop Development App + if: always() + run: | + if [ -f .pidfile_dev ]; then + kill "$(cat .pidfile_dev)" + fi + Docker-Start-Check: name: Check if Talawa Admin app starts in Docker runs-on: ubuntu-latest