Skip to content

Commit 7fb692e

Browse files
authored
Merge pull request #1398 from RBC/docs/contrib-fixup
docs: restructure contributing docs and improve E2E test infrastructure
2 parents cd14cec + f885211 commit 7fb692e

File tree

13 files changed

+605
-1378
lines changed

13 files changed

+605
-1378
lines changed

.github/workflows/e2e.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ jobs:
4141
git config --global init.defaultBranch main
4242
4343
- name: Build and start services with Docker Compose
44-
run: docker compose up -d --build
44+
run: docker compose up -d --build --wait || true
4545

46-
- name: Wait for services to be ready
46+
- name: Debug service state
47+
if: always()
4748
run: |
48-
timeout 60 bash -c '
49-
while [ "$(docker compose ps | grep -c "Up")" -ne 3 ]; do
50-
sleep 2
51-
done
52-
' || { echo "Service readiness check failed:"; docker compose ps; exit 1; }
49+
docker compose ps
50+
docker compose logs
5351
5452
- name: Run E2E tests
5553
run: npm run test:e2e

CONTRIBUTING.md

Lines changed: 384 additions & 39 deletions
Large diffs are not rendered by default.

docker-compose.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ services:
1010
# If using Podman, you might need to add the :Z or :z option for SELinux
1111
# - ./test-e2e.proxy.config.json:/app/test-e2e.proxy.config.json:ro,Z
1212
depends_on:
13-
- mongodb
14-
- git-server
13+
mongodb:
14+
condition: service_healthy
15+
git-server:
16+
condition: service_healthy
1517
networks:
1618
- git-network
1719
environment:
@@ -30,6 +32,12 @@ services:
3032
# - Comma-separated list = 'http://localhost:3000,https://example.com'
3133
# - Unset/empty = Same-origin only (most secure)
3234
- ALLOWED_ORIGINS=
35+
healthcheck:
36+
test: ['CMD-SHELL', 'curl -sf http://localhost:8081/api/v1/healthcheck || exit 1']
37+
interval: 5s
38+
timeout: 5s
39+
retries: 12
40+
start_period: 10s
3341
mongodb:
3442
image: mongo:7@sha256:606f8e029603330411a7dd10b5ffd50eefc297fc80cee89f10a455e496a76ae7
3543
ports:
@@ -40,6 +48,12 @@ services:
4048
- MONGO_INITDB_DATABASE=gitproxy
4149
volumes:
4250
- mongodb_data:/data/db
51+
healthcheck:
52+
test: ['CMD', 'mongosh', '--eval', "db.adminCommand('ping')"]
53+
interval: 5s
54+
timeout: 5s
55+
retries: 12
56+
start_period: 5s
4357

4458
git-server:
4559
build: localgit/
@@ -50,6 +64,16 @@ services:
5064
networks:
5165
- git-network
5266
hostname: git-server
67+
healthcheck:
68+
test:
69+
[
70+
'CMD-SHELL',
71+
'GIT_TERMINAL_PROMPT=0 GIT_SSL_NO_VERIFY=1 git ls-remote https://admin:admin123@localhost:8443/test-owner/test-repo.git HEAD || exit 1',
72+
]
73+
interval: 5s
74+
timeout: 5s
75+
retries: 12
76+
start_period: 5s
5377

5478
networks:
5579
git-network:

0 commit comments

Comments
 (0)