Skip to content

Commit 6422d8c

Browse files
committed
Port bbs2gh generate-script command
Port the bbs2gh generate-script command from C# to Go, generating PowerShell migration scripts for Bitbucket Server to GitHub migrations. Implementation: - generateScriptBbsAPI interface with GetProjects/GetRepos methods - bbsGenerateScriptArgs struct matching all C# command flags - newGenerateScriptCmd (testable) and newGenerateScriptCmdLive (production) - genScriptBbsClientAdapter bridging bbs.Client to consumer-defined interface - runBbsGenerateScript with validation matching C# (no-ssl-verify, AWS+GH storage conflicts) - generateBbsScript iterating projects/repos with optional --bbs-project filter - bbsMigrateRepoScript building per-repo gh bbs2gh migrate-repo commands - Extracted bbsWriteTargetOptions, bbsWriteSSHOptions, bbsWriteSMBOptions, bbsWriteTrailingFlags to keep cyclomatic complexity under threshold - BBS-specific validation constants (bbsValidateBBSUsername, bbsValidateBBSPassword, bbsValidateSMBPassword) matching C# inline strings exactly - bbsAppendLine/bbsAppendBlankLine helpers replicating C# AppendLine semantics (skip null/whitespace content, always append blank lines) - bbsReplaceInvalidCharactersWithDash for GitHub repo name sanitization Tests: All 22 C# GenerateScriptCommandHandlerTests ported and passing. Wired into cmd/bbs2gh/main.go via newGenerateScriptCmdLive().
1 parent 67bef16 commit 6422d8c

3 files changed

Lines changed: 1132 additions & 1 deletion

File tree

0 commit comments

Comments
 (0)