feat(migrate): DB tooling for v1.19.2 -> v2.0.0 (URLs + emails + ACL audit)#1543
Merged
Conversation
✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.
|
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1543 +/- ##
=======================================
Coverage 90.62% 90.62%
=======================================
Files 69 69
Lines 5694 5694
Branches 985 985
=======================================
Hits 5160 5160
Misses 516 516
Partials 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
51384cc to
fb1782a
Compare
jescalada
requested changes
May 28, 2026
Andreybest
reviewed
May 29, 2026
Andreybest
left a comment
Contributor
There was a problem hiding this comment.
Looks ok from my side, please check @jescalada comments.
Only 2 things from my side to make it perfect:
- TypeScript in migration scripts would be appreciated.
- Tests that are run on virtual mongo would show more reliability by using mongodb-memory-server or it's derivatives.
Contributor
Author
Agreed. I'll track a follow-up to convert scripts/migrate to TS for consistency with the rest of the repo. |
…it where missing.
- Rename URL migration entrypoints to migrate-urls and backup-urls - Rename analyzer module to lib/analyze-urls - Make createBackup accept file prefix and data payload - Update URL migration guide and examples to new names
- avoid generating invalid repo URLs during v1→v2 migration - normalizing safe cases (trim + strip trailing slashes) - reporting blank/non-http(s) values as manual-fix issues.
- refactor to reuse one MongoClient per run - avoid repeated connect/close cycles
+ reword migration docs regarding 'clients' -> 'incoming git HTTP traffic'
…ile DB - Add lib/datastore.js (mongo + neDB) and lib/args.js - Route all migration scripts through createDatastoreFromArgv - Update Migration-guide for DB_TYPE and file DB paths
1170f0e to
e9d188b
Compare
Contributor
Author
|
@jescalada @andypols @dcoric please re-review and resolve comments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Upgrade to Git-Proxy v2.0.0 requires database preparation for breaking behavior around exact repo URL lookup (need .git on repos.url) and v2 push authorization based on committer email + User.username ACL entries.
This PR adds operator-run migration scripts with dry-run by default, explicit apply, structured reports, and separate backups so upgrades are safer and repeatable (aligned with issue #1535).
Phase 1 — repo URL normalization: append .git to repos.url where missing (idempotent) via migrate-urls.js + backup-urls.js.
Phase 2 — users & ACL normalization:
Related Issue
Resolves #1535
Checklist
General
Documentation
Configuration
config.schema.json) was modified:npm run generate-config-types)npm run gen-schema-doc)Tests
npm test)npm run lintandnpm run format:check)npm run check-types)Note: Migration scripts are one-off operator tooling, not part of the main app bundle. Their unit tests live under scripts/migrate/test/ and are not included in the default npm test run (which targets ./test). Run them separately with: