Skip to content

fix: gsekit 数据迁移工具#451

Open
a-linye wants to merge 2 commits into
TencentBlueKing:masterfrom
a-linye:feat/migrate-gsekit
Open

fix: gsekit 数据迁移工具#451
a-linye wants to merge 2 commits into
TencentBlueKing:masterfrom
a-linye:feat/migrate-gsekit

Conversation

@a-linye
Copy link
Copy Markdown
Collaborator

@a-linye a-linye commented Feb 10, 2026

No description provided.

@a-linye a-linye requested a review from silenceper February 10, 2026 12:13
@tencentblueking-adm
Copy link
Copy Markdown

tencentblueking-adm commented Feb 10, 2026

CLA assistant check
All committers have signed the CLA.

@a-linye a-linye force-pushed the feat/migrate-gsekit branch 5 times, most recently from b17b5c2 to a744ca8 Compare February 12, 2026 08:41
@silenceper silenceper requested a review from Copilot February 13, 2026 05:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmd/gsekit-migration/migrator/validator.go Outdated
Comment thread cmd/gsekit-migration/migrator/cleanup.go Outdated
Comment thread cmd/gsekit-migration/etc/migration.yaml
Comment thread cmd/gsekit-migration/migrator/template_space.go
Comment thread cmd/gsekit-migration/migrator/process.go Outdated
Comment thread cmd/gsekit-migration/migrator/process.go
Comment thread cmd/gsekit-migration/migrator/process.go Outdated
@a-linye a-linye force-pushed the feat/migrate-gsekit branch 5 times, most recently from 5ff5da2 to 105825c Compare March 4, 2026 02:47
@a-linye a-linye force-pushed the feat/migrate-gsekit branch from b79f37b to 37e4647 Compare March 16, 2026 06:43
@a-linye a-linye force-pushed the feat/migrate-gsekit branch 2 times, most recently from 1ff2f4d to 8af81c5 Compare March 23, 2026 09:56
@a-linye a-linye force-pushed the feat/migrate-gsekit branch from 8af81c5 to 715444a Compare April 13, 2026 12:00
@silenceper
Copy link
Copy Markdown
Collaborator

@codex review下

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread cmd/gsekit-migration/migrator/validator.go
Comment thread cmd/gsekit-migration/migrator/validator.go Outdated
Comment thread bscp
@a-linye a-linye force-pushed the feat/migrate-gsekit branch 8 times, most recently from 90d819e to 4bd4930 Compare April 16, 2026 13:41
@a-linye a-linye force-pushed the feat/migrate-gsekit branch from 4bd4930 to 451eff5 Compare April 24, 2026 09:34
@a-linye a-linye force-pushed the feat/migrate-gsekit branch from 451eff5 to 03fbb81 Compare April 24, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants