From 41e854efa80e12f0c530cd56981b2418667c0d27 Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Mon, 21 Apr 2025 00:30:43 -0400 Subject: [PATCH] update the README --- .gitignore | 1 + Makefile | 11 ++++++++++- README.md | 11 +++++++++++ go.mod | 1 + go.sum | 2 ++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c3cd188..095d205 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ go.work.sum .env /migrate /unmigrate +/forkfix /migration_state.json log.log err.log \ No newline at end of file diff --git a/Makefile b/Makefile index ad153c6..34ffcae 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,13 @@ fmt: @echo "Running gofumpt..." - find . -name '*.go' -exec gofumpt -w -s -extra {} \; \ No newline at end of file + find . -name '*.go' -exec gofumpt -w -s -extra {} \; + +migrate: + go build -o migrate ./cmd/migrate + +unmigrate: + go build -o unmigrate ./cmd/unmigrate + +forkfix: + go build -o forkfix ./cmd/forkfix diff --git a/README.md b/README.md index 735d075..b325aac 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Go-based tool for migrating GitLab repositories, users, groups, issues and relat More-or-less a port of [gitlab-to-gitea](https://git.autonomic.zone/kawaiipunk/gitlab-to-gitea) from python to Go because *fixing* python appears to be a thing I just can't get my mind around, but *rewriting* it? I'm actually OK at that. +Also includes: `cmd/forkfix`, for fixing fork relationships between migrated repositories by manipulating the gitea mysql database and `cmd/unmigrate` to delete everything from a gitea instance except for the admin users. + ## Core Functionality - Migrates users, groups, and their relationships from GitLab to Gitea @@ -12,6 +14,15 @@ More-or-less a port of [gitlab-to-gitea](https://git.autonomic.zone/kawaiipunk/g - Supports resumable migrations through state tracking - Handles username normalization and entity mapping between platforms +## Go Implementation Improvements + +- Modular package structure instead of monolithic script +- Configuration via environment variables rather than hardcoded values +- Added utility tools (`forkfix` and `unmigrate`) +- Database connectivity for commit action imports +- Improved error handling with recovery mechanisms +- Separation of API client code from migration logic + ## Installation 1. Ensure Go 1.24+ is installed diff --git a/go.mod b/go.mod index e9fa673..00cec5f 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.24.2 require ( github.com/go-sql-driver/mysql v1.9.2 github.com/joho/godotenv v1.5.1 + github.com/mattn/go-sqlite3 v1.14.28 github.com/xanzy/go-gitlab v0.115.0 ) diff --git a/go.sum b/go.sum index 657559f..593edfa 100644 --- a/go.sum +++ b/go.sum @@ -28,6 +28,8 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A= +github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=