fix: gsekit 数据迁移工具#451
Conversation
b17b5c2 to
a744ca8
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a new gsekit-migration CLI tool to migrate data from GSEKit’s MySQL schema into BSCP’s schema, including optional repository uploads, plus validation and cleanup utilities.
Changes:
- Added end-to-end migration pipeline (template spaces → processes → process instances → config templates/revisions → config instances).
- Added CMDB integration (real + mock) and repository upload support (BK-Repo + S3/COS).
- Added validation and cleanup commands, plus an example YAML config and a build Makefile.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/gsekit-migration/main.go | CLI entrypoint wiring. |
| cmd/gsekit-migration/cmd/root.go | Cobra commands for migrate/validate/cleanup/generate-mock. |
| cmd/gsekit-migration/config/config.go | YAML config loading, defaults, validation, DSN builder. |
| cmd/gsekit-migration/etc/migration.yaml | Example configuration template. |
| cmd/gsekit-migration/migrator/migrator.go | Migration orchestration + reporting + hash helpers. |
| cmd/gsekit-migration/migrator/id_generator.go | ID allocation via id_generators table + DB connect helper. |
| cmd/gsekit-migration/migrator/template_space.go | Creates/reuses template_space + template_set per biz. |
| cmd/gsekit-migration/migrator/process.go | Migrates processes and process_instances with CMDB enrichment. |
| cmd/gsekit-migration/migrator/config_template.go | Migrates templates, revisions, and config_templates; uploads content. |
| cmd/gsekit-migration/migrator/config_instance.go | Migrates latest config instances and content. |
| cmd/gsekit-migration/migrator/repository.go | ContentUploader implementations for BK-Repo and S3/COS. |
| cmd/gsekit-migration/migrator/cmdb.go | Real and mock CMDB clients + types. |
| cmd/gsekit-migration/migrator/validator.go | Post-migration validation checks. |
| cmd/gsekit-migration/migrator/cleanup.go | Deletes migrated data in reverse dependency order. |
| cmd/gsekit-migration/migrator/generate_mock.go | Generates mock GSEKit SQL from real CMDB data. |
| cmd/gsekit-migration/Makefile | Build/clean targets for the migration binary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5ff5da2 to
105825c
Compare
b79f37b to
37e4647
Compare
1ff2f4d to
8af81c5
Compare
8af81c5 to
715444a
Compare
|
@codex review下 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 715444aa2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
90d819e to
4bd4930
Compare
4bd4930 to
451eff5
Compare
451eff5 to
03fbb81
Compare
No description provided.