Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a0a642b
chore(db): scaffold src/db/postgres directory
dcoric May 11, 2026
b7ff225
feat(config): add postgres variant to sink schema
dcoric May 11, 2026
52db0b2
feat(config): env fallback for postgres connection string
dcoric May 11, 2026
ba5c752
feat(config): add disabled postgres entry to default sink list
dcoric May 11, 2026
88fb632
chore(deps): add pg and connect-pg-simple
dcoric May 11, 2026
d95a04f
feat(db/postgres): pool and schema bootstrap helper
dcoric May 11, 2026
189b20d
feat(db/postgres): pushes adapter
dcoric May 11, 2026
379dc67
feat(db/postgres): users adapter
dcoric May 11, 2026
98ae5a6
feat(db/postgres): repo adapter with jsonb permissions
dcoric May 11, 2026
cf62fea
feat(db): wire postgres adapter into sink dispatch
dcoric May 11, 2026
5971316
fix(service): fail loudly if persistent session store is missing
dcoric May 11, 2026
77ee747
test(db/postgres): unit tests for pushes adapter
dcoric May 11, 2026
f9fbb3b
test(db/postgres): unit tests for users adapter
dcoric May 11, 2026
9e49a76
test(db/postgres): unit tests for repo adapter
dcoric May 11, 2026
5013da6
test(db/postgres): unit tests for helper bootstrap and session store
dcoric May 11, 2026
a17a9d1
test(db/postgres): integration test harness
dcoric May 11, 2026
6f74b09
test(db/postgres): pushes integration suite
dcoric May 11, 2026
d8d4e31
test(db/postgres): users integration suite
dcoric May 11, 2026
efcd240
test(db/postgres): repo integration suite
dcoric May 11, 2026
b88d6e4
ci: postgres integration lane
dcoric May 11, 2026
93a3292
docs: configuring postgres sink
dcoric May 11, 2026
fcf94f1
fix(postgres): correct user updates and session startup
dcoric May 12, 2026
00ea383
fix(config): recover cached git sources on detached head
dcoric May 15, 2026
26a348e
Merge branch 'main' into feat/postgres-sink
dcoric May 20, 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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ jobs:
node-version: [22.x, 24.x]
mongodb-version: ['6.0', '7.0', '8.0']

# PostgreSQL service container for the postgres integration tests added in
# issue #1497. A single version (postgres:16) is sufficient for the initial
# CI lane per the issue's "Open Questions"; a broader version matrix can
# follow later.
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: git_proxy_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
Expand Down Expand Up @@ -71,6 +90,12 @@ jobs:
GIT_PROXY_MONGO_CONNECTION_STRING: mongodb://localhost:27017/git-proxy-test
run: npm run test:integration

- name: PostgreSQL Integration Tests
env:
RUN_POSTGRES_TESTS: 'true'
GIT_PROXY_POSTGRES_CONNECTION_STRING: postgresql://postgres:postgres@localhost:5432/git_proxy_test
run: npm run test:integration:postgres

- name: Upload test coverage report
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
with:
Expand Down
14 changes: 14 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,20 @@
"enabled": { "type": "boolean" }
},
"required": ["type", "enabled"]
},
{
"type": "object",
"name": "PostgreSQL Config",
"description": "Connection properties for PostgreSQL. The `connectionString` may also be supplied via the `GIT_PROXY_POSTGRES_CONNECTION_STRING` environment variable.",
"properties": {
"type": { "type": "string", "const": "postgres" },
"enabled": { "type": "boolean" },
"connectionString": {
"type": "string",
"description": "PostgreSQL client connection string, see [https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING). If omitted, `GIT_PROXY_POSTGRES_CONNECTION_STRING` is used as a fallback."
}
},
"required": ["type", "enabled"]
}
]
},
Expand Down
178 changes: 177 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"test-coverage": "cross-env NODE_ENV=test vitest --run --dir ./test --coverage",
"test-coverage-ci": "cross-env NODE_ENV=test vitest --run --dir ./test --coverage.enabled=true --coverage.reporter=lcovonly --coverage.reporter=text",
"test:integration": "cross-env NODE_ENV=test vitest --run --config vitest.config.integration.ts",
"test:integration:postgres": "cross-env NODE_ENV=test vitest --run --config vitest.config.integration.postgres.ts",
"test:watch": "cross-env NODE_ENV=test vitest --dir ./test --watch",
"prepare": "node ./scripts/prepare.js",
"lint": "eslint",
Expand Down Expand Up @@ -107,6 +108,7 @@
"clsx": "^2.1.1",
"concurrently": "^9.2.1",
"connect-mongo": "^5.1.0",
"connect-pg-simple": "^10.0.0",
"cors": "^2.8.6",
"diff2html": "^3.4.56",
"env-paths": "^3.0.0",
Expand All @@ -131,6 +133,7 @@
"passport-activedirectory": "^1.4.0",
"passport-local": "^1.0.0",
"perfect-scrollbar": "^1.5.6",
"pg": "^8.20.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-html-parser": "^2.0.2",
Expand All @@ -149,6 +152,7 @@
"@eslint/js": "^9.39.2",
"@eslint/json": "^1.0.1",
"@types/activedirectory2": "^1.2.6",
"@types/connect-pg-simple": "^7.0.3",
"@types/cors": "^2.8.19",
"@types/domutils": "^2.1.0",
"@types/express": "^5.0.6",
Expand All @@ -160,6 +164,7 @@
"@types/node": "^22.19.7",
"@types/passport": "^1.0.17",
"@types/passport-local": "^1.0.38",
"@types/pg": "^8.20.0",
"@types/react-dom": "^17.0.26",
"@types/react-html-parser": "^2.0.7",
"@types/supertest": "^6.0.3",
Expand Down
5 changes: 5 additions & 0 deletions proxy.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
"ssl": true
},
"enabled": false
},
{
"type": "postgres",
"connectionString": "postgresql://localhost:5432/gitproxy",
"enabled": false
}
],
"authentication": [
Expand Down
Loading
Loading