Skip to content

Commit b737c6c

Browse files
committed
Merge branch 'master' into chat-redis
2 parents 3ac6e4e + 2cf058c commit b737c6c

File tree

86 files changed

+11850
-1068
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+11850
-1068
lines changed

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
include:
4646
- language: "javascript-typescript"
4747
build-mode: none
48+
- language: "java-kotlin"
49+
build-mode: none
4850
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
4951
# Use `c-cpp` to analyze code written in C, C++ or both
5052
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Deploy History Service
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- "backend-services/user-backend-service/**"
8+
workflow_dispatch:
9+
10+
jobs:
11+
deploy:
12+
uses: ./.github/workflows/deploy-service-to-eb.yml
13+
with:
14+
service_name: history-service
15+
service_path: backend-services/history-backend-service
16+
application_name: peerprep-history-service
17+
environment_name: peerprep-history-service-prod
18+
secrets:
19+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
20+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.github/workflows/docker-build-push.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ jobs:
3434
context: ./backend-services/question-backend-service
3535
- name: leetcode-backend
3636
context: ./backend-services/leetcode-backend-service
37+
- name: chatting-backend
38+
context: ./backend-services/chatting-backend-service
39+
- name: user-backend
40+
context: ./backend-services/user-backend-service
41+
- name: collab-backend
42+
context: ./backend-services/collab-backend-service
43+
- name: matching-backend
44+
context: ./backend-services/matching-backend-service
3745

3846
steps:
3947
- name: Checkout Repository

.github/workflows/format-lint.yml

Lines changed: 216 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Node.js
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: "20.x"
24+
node-version: "22.x"
2525
cache: "npm"
2626

2727
- name: Run Prettier Checks
@@ -39,7 +39,7 @@ jobs:
3939
- name: Setup Node.js
4040
uses: actions/setup-node@v4
4141
with:
42-
node-version: "20.x"
42+
node-version: "22.x"
4343
cache: "npm"
4444

4545
- name: Install dependencies
@@ -79,7 +79,7 @@ jobs:
7979
- name: Setup Node.js
8080
uses: actions/setup-node@v4
8181
with:
82-
node-version: "20.x"
82+
node-version: "22.x"
8383
cache: "npm"
8484

8585
- name: Install dependencies
@@ -119,7 +119,7 @@ jobs:
119119
- name: Setup Node.js
120120
uses: actions/setup-node@v4
121121
with:
122-
node-version: "20.x"
122+
node-version: "22.x"
123123
cache: "npm"
124124

125125
- name: Install dependencies
@@ -159,7 +159,7 @@ jobs:
159159
- name: Setup Node.js
160160
uses: actions/setup-node@v4
161161
with:
162-
node-version: "20.x"
162+
node-version: "22.x"
163163
cache: "npm"
164164

165165
- name: Install dependencies
@@ -199,7 +199,7 @@ jobs:
199199
- name: Setup Node.js
200200
uses: actions/setup-node@v4
201201
with:
202-
node-version: "20.x"
202+
node-version: "22.x"
203203
cache: "npm"
204204

205205
- name: Install dependencies
@@ -239,7 +239,7 @@ jobs:
239239
- name: Setup Node.js
240240
uses: actions/setup-node@v4
241241
with:
242-
node-version: "20.x"
242+
node-version: "22.x"
243243
cache: "npm"
244244

245245
- name: Install dependencies
@@ -279,7 +279,7 @@ jobs:
279279
- name: Setup Node.js
280280
uses: actions/setup-node@v4
281281
with:
282-
node-version: "20.x"
282+
node-version: "22.x"
283283
cache: "npm"
284284

285285
- name: Install dependencies
@@ -319,7 +319,7 @@ jobs:
319319
- name: Setup Node.js
320320
uses: actions/setup-node@v4
321321
with:
322-
node-version: "20.x"
322+
node-version: "22.x"
323323
cache: "npm"
324324

325325
- name: Install dependencies
@@ -346,3 +346,210 @@ jobs:
346346
347347
npx eslint --format json . > eslint-report.json
348348
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
349+
350+
user-backend-lint:
351+
runs-on: ubuntu-latest
352+
steps:
353+
- name: Set REVIEWDOG_GITHUB_API_TOKEN
354+
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
355+
356+
- name: Checkout Repository
357+
uses: actions/checkout@v3
358+
359+
- name: Setup Node.js
360+
uses: actions/setup-node@v4
361+
with:
362+
node-version: "22.x"
363+
cache: "npm"
364+
365+
- name: Install dependencies
366+
run: |
367+
cd ./backend-services/user-backend-service
368+
npm ci
369+
370+
- name: Install reviewdog
371+
uses: reviewdog/action-setup@v1
372+
with:
373+
reviewdog_version: latest
374+
375+
- name: Run ESLint and Reviewdog
376+
run: |
377+
cd ./backend-services/user-backend-service
378+
exit_code=0
379+
npx eslint . || exit_code=$?
380+
eslint_exit_code=$exit_code
381+
382+
if [ $eslint_exit_code -ne 0 ]; then
383+
echo "ESLint failed for user-backend"
384+
exit 1
385+
fi
386+
387+
npx eslint --format json . > eslint-report.json
388+
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
389+
390+
collab-backend-lint:
391+
runs-on: ubuntu-latest
392+
steps:
393+
- name: Set REVIEWDOG_GITHUB_API_TOKEN
394+
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
395+
396+
- name: Checkout Repository
397+
uses: actions/checkout@v3
398+
399+
- name: Setup Node.js
400+
uses: actions/setup-node@v4
401+
with:
402+
node-version: "22.x"
403+
cache: "npm"
404+
405+
- name: Install dependencies
406+
run: |
407+
cd ./backend-services/collab-backend-service
408+
npm ci
409+
410+
- name: Install reviewdog
411+
uses: reviewdog/action-setup@v1
412+
with:
413+
reviewdog_version: latest
414+
415+
- name: Run ESLint and Reviewdog
416+
run: |
417+
cd ./backend-services/collab-backend-service
418+
exit_code=0
419+
npx eslint . || exit_code=$?
420+
eslint_exit_code=$exit_code
421+
422+
if [ $eslint_exit_code -ne 0 ]; then
423+
echo "ESLint failed for collab-backend"
424+
exit 1
425+
fi
426+
427+
npx eslint --format json . > eslint-report.json
428+
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
429+
430+
chatting-backend-lint:
431+
runs-on: ubuntu-latest
432+
steps:
433+
- name: Set REVIEWDOG_GITHUB_API_TOKEN
434+
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
435+
436+
- name: Checkout Repository
437+
uses: actions/checkout@v3
438+
439+
- name: Setup Node.js
440+
uses: actions/setup-node@v4
441+
with:
442+
node-version: "22.x"
443+
cache: "npm"
444+
445+
- name: Install dependencies
446+
run: |
447+
cd ./backend-services/chatting-backend-service
448+
npm ci
449+
450+
- name: Install reviewdog
451+
uses: reviewdog/action-setup@v1
452+
with:
453+
reviewdog_version: latest
454+
455+
- name: Run ESLint and Reviewdog
456+
run: |
457+
cd ./backend-services/chatting-backend-service
458+
exit_code=0
459+
npx eslint . || exit_code=$?
460+
eslint_exit_code=$exit_code
461+
462+
if [ $eslint_exit_code -ne 0 ]; then
463+
echo "ESLint failed for chatting-backend"
464+
exit 1
465+
fi
466+
467+
npx eslint --format json . > eslint-report.json
468+
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
469+
470+
history-backend-lint:
471+
runs-on: ubuntu-latest
472+
steps:
473+
- name: Set REVIEWDOG_GITHUB_API_TOKEN
474+
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
475+
476+
- name: Checkout Repository
477+
uses: actions/checkout@v3
478+
479+
- name: Setup Node.js
480+
uses: actions/setup-node@v4
481+
with:
482+
node-version: "22.x"
483+
cache: "npm"
484+
485+
- name: Install dependencies
486+
run: |
487+
cd ./backend-services/history-backend-service
488+
npm ci
489+
490+
- name: Install reviewdog
491+
uses: reviewdog/action-setup@v1
492+
with:
493+
reviewdog_version: latest
494+
495+
- name: Run ESLint and Reviewdog
496+
run: |
497+
cd ./backend-services/history-backend-service
498+
exit_code=0
499+
npx eslint . || exit_code=$?
500+
eslint_exit_code=$exit_code
501+
502+
if [ $eslint_exit_code -ne 0 ]; then
503+
echo "ESLint failed for history-backend"
504+
exit 1
505+
fi
506+
507+
npx eslint --format json . > eslint-report.json
508+
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
509+
510+
matching-backend-lint:
511+
runs-on: ubuntu-latest
512+
steps:
513+
- name: Set REVIEWDOG_GITHUB_API_TOKEN
514+
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
515+
516+
- name: Checkout Repository
517+
uses: actions/checkout@v3
518+
519+
- name: Setup JDK 17
520+
uses: actions/setup-java@v5
521+
with:
522+
java-version: "17"
523+
distribution: "temurin"
524+
cache: "maven"
525+
cache-dependency-path: |
526+
backend-services/matching-backend-service/pom.xml
527+
528+
- name: Spotless check
529+
run: |
530+
cd ./backend-services/matching-backend-service
531+
mvn -B -DskipTests spotless:check
532+
533+
- name: Generate Checkstyle report
534+
run: |
535+
cd ./backend-services/matching-backend-service
536+
mvn -B -DskipTests checkstyle:checkstyle || exit_code=$?
537+
538+
- name: Install reviewdog
539+
uses: reviewdog/action-setup@v1
540+
with:
541+
reviewdog_version: latest
542+
543+
- name: Run Checkstyle and Reviewdog
544+
run: |
545+
cd ./backend-services/matching-backend-service
546+
REPORT=target/checkstyle-result.xml
547+
if [ ! -f "$REPORT" ]; then
548+
echo "Checkstyle report not found at $REPORT"
549+
exit 1
550+
fi
551+
cat "$REPORT" | reviewdog -f=checkstyle -name="checkstyle" -reporter=github-pr-review -level=error
552+
- name: Enforce Checkstyle (fail on violations)
553+
run: |
554+
cd ./backend-services/matching-backend-service
555+
mvn -B -DskipTests checkstyle:check
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# MONGO_URI=mongodb://localhost:27017
12
MONGO_URI=mongodb+srv://admin:<db-password>@cluster3219.ll0nzkk.mongodb.net/?retryWrites=true&w=majority&appName=Cluster3219
2-
PORT=5276
3-
3+
MONGO_DB_NAME=history-service
4+
PORT=5278
45
#This is for local. On cloud it will be calling the cloud question service.
56
QUESTION_SERVICE_URL=http://peerprep-question-backend:5275/api/v1/question-service
7+
HISTORY_SERVICE_URL=http://peerprep-history-service:5278/api/v1/history-service
8+
VITE_MODE=dev
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// @ts-check
2+
3+
import eslint from "@eslint/js";
4+
import { defineConfig } from "eslint/config";
5+
import tseslint from "typescript-eslint";
6+
import eslintConfigPrettier from "eslint-config-prettier";
7+
import globals from "globals";
8+
9+
export default defineConfig(
10+
{
11+
ignores: ["eslint.config.mjs", "dist"],
12+
},
13+
{
14+
files: ["**/*.{js,jsx,ts,tsx}"],
15+
languageOptions: {
16+
globals: globals.node,
17+
},
18+
},
19+
eslint.configs.recommended,
20+
tseslint.configs.recommended,
21+
eslintConfigPrettier,
22+
);

0 commit comments

Comments
 (0)