Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
0625ef1
feat:new files
borkarsaish65 Dec 10, 2025
5344ae3
updated devops files
borkarsaish65 Dec 10, 2025
bbd8fc1
jest modification
borkarsaish65 Dec 10, 2025
d45e806
package json modification
borkarsaish65 Dec 10, 2025
0466e74
savepoint
borkarsaish65 Dec 10, 2025
acfb78b
Merge branch 'mentorReadOptimisation' of https://github.com/ELEVATE-P…
borkarsaish65 Dec 10, 2025
d1be292
pushing test sequencer
borkarsaish65 Dec 10, 2025
aac18ae
updates after addressing pr comments
borkarsaish65 Dec 11, 2025
b92293c
kafka file update
borkarsaish65 Dec 11, 2025
6998e8e
kafka change
borkarsaish65 Dec 11, 2025
821d638
feat:updated docker compose with kafka circleci file
borkarsaish65 Dec 11, 2025
aa0e9b3
feat:updated pakcage json and docker compose file
borkarsaish65 Dec 11, 2025
4ccdbeb
script for migration script
borkarsaish65 Dec 11, 2025
7b61505
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Dec 18, 2025
a78fc1c
migration script fix
borkarsaish65 Dec 18, 2025
c9da6d6
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Dec 22, 2025
209c306
restored prev migrations and seeders
borkarsaish65 Dec 22, 2025
6a12e90
migrations updated
borkarsaish65 Dec 23, 2025
c6e8050
migrations fix check
borkarsaish65 Dec 23, 2025
fa6e05d
restored files
borkarsaish65 Dec 23, 2025
91591f9
feat:samigrations updates
borkarsaish65 Dec 24, 2025
3b6f1a9
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Dec 24, 2025
0914311
savepoint-post-pr-review-1
borkarsaish65 Dec 31, 2025
0a6e228
addressed PR comments
borkarsaish65 Dec 31, 2025
db6f603
new fix
borkarsaish65 Jan 5, 2026
c2d0444
new fix
borkarsaish65 Jan 5, 2026
cbaf658
new fix-1
borkarsaish65 Jan 5, 2026
9d0b5ff
fix-2
borkarsaish65 Jan 5, 2026
82f2a1b
fix-3
borkarsaish65 Jan 5, 2026
df2bcd6
fix-3.1
borkarsaish65 Jan 5, 2026
a364f77
fix-4
borkarsaish65 Jan 5, 2026
f94947d
fix-5
borkarsaish65 Jan 5, 2026
e9a1558
fix-6
borkarsaish65 Jan 5, 2026
aea283d
fix-7
borkarsaish65 Jan 5, 2026
d16933b
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Jan 12, 2026
d8602a2
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Jan 12, 2026
dd992f3
updated migration scripts and seeders
borkarsaish65 Jan 12, 2026
e2e3026
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Jan 12, 2026
25544a0
migrations+test integration
borkarsaish65 Jan 12, 2026
9834782
savepoint-1
borkarsaish65 Jan 12, 2026
7b30729
done the changes
borkarsaish65 Jan 12, 2026
4456acd
circleci file updated
borkarsaish65 Jan 13, 2026
db052d2
circleci update with correct npm commands
borkarsaish65 Jan 13, 2026
6f5178c
copying kafka file is fixed
borkarsaish65 Jan 13, 2026
b646efa
copying kafka file is fixed-1
borkarsaish65 Jan 13, 2026
74a1ddd
copying kafka file is fixed-2
borkarsaish65 Jan 13, 2026
764e094
copying kafka file is fixed-3
borkarsaish65 Jan 13, 2026
3b9947f
copying kafka file is fixed-4
borkarsaish65 Jan 13, 2026
baf74f4
updated circleci file
borkarsaish65 Jan 13, 2026
02964dc
kafka file updated.
borkarsaish65 Jan 13, 2026
9db429f
addressed pr comments
borkarsaish65 Jan 13, 2026
42b28e6
removed unused variables
borkarsaish65 Jan 13, 2026
852b701
enabling citus
borkarsaish65 Jan 13, 2026
189db62
correcting the citus code
borkarsaish65 Jan 13, 2026
802744f
enabling citus - 2
borkarsaish65 Jan 13, 2026
1f53832
enabling citus - 3
borkarsaish65 Jan 13, 2026
200164e
enabling citus - 4
borkarsaish65 Jan 13, 2026
28b67e6
enabling citus - 5
borkarsaish65 Jan 13, 2026
8ccbf94
enabling citus - 6
borkarsaish65 Jan 13, 2026
e933acf
citus and distribution placement fixed in circleci
borkarsaish65 Jan 14, 2026
c86582c
updated citus config
borkarsaish65 Jan 14, 2026
b4a1fa1
updated citus config
borkarsaish65 Jan 14, 2026
ecb4ecb
circleci and docker-compose file updated
borkarsaish65 Jan 14, 2026
5afd288
test sequencer fix
borkarsaish65 Jan 14, 2026
e246735
test sequencer fix -1
borkarsaish65 Jan 14, 2026
1ac061d
test sequencer fix -2
borkarsaish65 Jan 14, 2026
32e1727
starting user service via circleci
borkarsaish65 Jan 14, 2026
d5eee49
savepoint-1 refresh view build
borkarsaish65 Jan 20, 2026
b8ffdbb
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Jan 20, 2026
07f8199
savepoint-2 minor fixes
borkarsaish65 Jan 20, 2026
3f171a3
savepoint-3 minor fixes
borkarsaish65 Jan 20, 2026
f0de7c9
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Jan 20, 2026
30a9384
Merge branch 'feature/int_test12' of https://github.com/borkarsaish65…
borkarsaish65 Jan 20, 2026
41ca559
deleted config.json
borkarsaish65 Jan 20, 2026
ce89008
undoed migration changes from this PR
borkarsaish65 Jan 20, 2026
79e17ae
updated package json file
borkarsaish65 Jan 20, 2026
3245c85
Merge branch 'feature/int_test12' of https://github.com/borkarsaish65…
borkarsaish65 Jan 20, 2026
b880388
package json updated
borkarsaish65 Jan 20, 2026
02c0ce5
Merge branch 'feature/int_test12' of https://github.com/borkarsaish65…
borkarsaish65 Jan 20, 2026
0f66ac7
resolved conflicts
borkarsaish65 Jan 30, 2026
be2f8a4
Merge branch 'develop' of https://github.com/ELEVATE-Project/mentorin…
borkarsaish65 Feb 11, 2026
5b89eb3
savepoint-1
borkarsaish65 Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
233 changes: 200 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,231 @@
version: 2.1 # CircleCI version
orbs:
sonarcloud: sonarsource/sonarcloud@1.1.1
version: 2.1

jobs:
build:
machine: #Linux machine instead of docker environment
machine:
image: ubuntu-2004:2024.05.1
docker_layer_caching: true
working_directory: ~/mentoring # Default working directory

working_directory: ~/mentoring

steps:
# -------------------------------
# Git setup
# -------------------------------
- run:
name: Configure git to use HTTPS
command: git config --global url."https://github.com/".insteadOf "git@github.com:"

- checkout:
path: ~/mentoring/

# -------------------------------
# Restore mentoring dependencies
# -------------------------------
- restore_cache:
key: mentoring-dependency-cache-{{ checksum "src/package.json" }}

- run:
name: Install dependencies
command: cd src/ && npm install #cd ../src/ && pwd &&
name: Install mentoring dependencies
command: |
cd src
npm install

- save_cache:
key: mentoring-dependency-cache-{{checksum "src/package.json"}}
key: mentoring-dependency-cache-{{ checksum "src/package.json" }}
paths:
- ./src/node_modules

# -------------------------------
# Disable SSH rewrite
# -------------------------------
- run:
name: Executing unit test cases
command: cd src/ && npm run test -- --coverage --collectCoverageFrom="./services/**"
- store_artifacts:
path: src/coverage/
destination: /coverage/
- sonarcloud/scan
name: Disable SSH rewrite
command: git config --global --unset url."ssh://git@github.com".insteadOf || true

# -------------------------------
# Clone USER service
# -------------------------------
- run:
name: Checking prerequisites
command: |-
docker-compose --version
- run:
name: Cloning user service
command: cd ../ && git clone https://github.com/ELEVATE-Project/user.git --branch dev --single-branch
name: Clone User service
command: |
cd ..
git clone https://github.com/ELEVATE-Project/user.git \
--branch develop \
--single-branch

- restore_cache:
key: user-dependency-cache-{{ checksum "../user/src/package.json" }}

- run:
name: Install User service dependencies
command: cd ../user/src/ && npm install #cd ../src/ && pwd &&
command: |
cd ../user/src
npm install

- save_cache:
key: user-dependency-cache-{{checksum "../user/src/package.json"}}
key: user-dependency-cache-{{ checksum "../user/src/package.json" }}
paths:
- ../user/src/node_modules

# -------------------------------
# Clone optional services
# -------------------------------
- run:
name: Clone Scheduler service
command: |
cd ..
git clone https://github.com/ELEVATE-Project/scheduler.git \
--branch dev \
--single-branch || true

- run:
name: Clone Communications service
command: |
cd ..
git clone https://github.com/ELEVATE-Project/chat-communications.git \
--branch dev \
--single-branch || true

# -------------------------------
# Config
# -------------------------------
- run:
name: Copy config.json
command: cp dev-ops/integration_test.config.json src/config.json

# -------------------------------
# Start docker-compose
# -------------------------------
- run:
name: Start docker containers
command: |
cd dev-ops
docker-compose pull || true
docker-compose build
docker-compose up -d
sleep 20

# -------------------------------
# Wait for healthchecks
# -------------------------------
- run:
name: Wait for services to be healthy
command: |
cd dev-ops
echo "Waiting for containers to be healthy..."

for i in {1..30}; do
unhealthy=$(docker ps --filter "health=unhealthy" --format "{{.Names}}")
starting=$(docker ps --filter "health=starting" --format "{{.Names}}")

if [ -z "$unhealthy" ] && [ -z "$starting" ]; then
echo "All containers are healthy"
break
fi

echo "Waiting... attempt $i"
docker ps --format "table {{.Names}}\t{{.Status}}"
sleep 5
done
# -------------------------------
# Run migrations (EXPLICIT)
# -------------------------------
- run:
name: Run mentoring migrations
command: |
export MENTORING=$(docker ps --format "{{.Names}}" | grep mentoring)
echo "Running migrations in $MENTORING"
docker exec "$MENTORING" npm run db:init

- run:
name: Enable Citus and run distributionColumns.psql
command: |
cd dev-ops
set -e

echo "Enabling Citus extension..."
docker-compose exec -T citus psql \
-U postgres \
-d elevate-mentoring \
-c "CREATE EXTENSION IF NOT EXISTS citus;"

echo "Running distributionColumns.psql..."
docker-compose exec -T citus psql \
-U postgres \
-d elevate-mentoring \
-f /var/src/distributionColumns.psql

echo "Citus setup completed."

# -------------------------------
# Run seeders (EXPLICIT)
# -------------------------------
- run:
name: Run mentoring seeders
command: |
export MENTORING=$(docker ps --format "{{.Names}}" | grep mentoring)
echo "Running seeders in $MENTORING"
docker exec "$MENTORING" npm run db:seed:all

- run:
name: Start mentoring app
command: |
export MENTORING=$(docker ps --format "{{.Names}}" | grep mentoring)
echo "Starting mentoring app..."
docker exec -d "$MENTORING" npm run dev

- run:
name: Run user migrations
command: |
export USER=$(docker ps --format "{{.Names}}" | grep user)
echo "Running user migrations in $USER"
docker exec "$USER" npm run db:init

- run:
name: Run user seeders
command: |
export USER=$(docker ps --format "{{.Names}}" | grep user)
docker exec "$USER" npm run db:seed:all


- run:
name: Start user service
command: |
export USER=$(docker ps --format "{{.Names}}" | grep user)
echo "Starting user service..."
docker exec -d "$USER" npm run dev


# -------------------------------
# Run integration tests
# -------------------------------
- run:
name: Starting the docker containers
command: |-
cd dev-ops/ && docker-compose up -d
name: Run integration tests
command: |
cd src
npm run test:integration

# -------------------------------
# Diagnostics
# -------------------------------
- run:
name: Running test cases
command: |-
cd src/ && npm run test:integration
name: Print logs on failure
when: always
command: |
cd dev-ops
docker-compose logs --tail=200 kafka || true
docker-compose logs --tail=200 citus || true
docker-compose logs --tail=200 mentoring || true
docker-compose logs --tail=200 user || true

- store_test_results:
path: ./dev-ops/report

workflows:
build-and-test: # This is the name of the workflow,
# Inside the workflow, you define the jobs you want to run.
build-and-test:
jobs:
- build:
context:
- SonarCloud
filters:
tags:
only: \b(dev|develop|main)\b
only: \b(dev|develop|main)\b
Loading