Skip to content

bbs2gh: add optional custom properties to repository migrations - #1629

Open
enyil wants to merge 3 commits into
github:mainfrom
enyil:enyil-bbs2gh-support-setting-custom-property-v
Open

enyil wants to merge 3 commits into
github:mainfrom
enyil:enyil-bbs2gh-support-setting-custom-property-v

Conversation

@enyil

@enyil enyil commented Oct 8, 2026

Copy link
Copy Markdown
  • Did you write/update appropriate tests
  • Release notes updated (if appropriate)
  • Appropriate logging output
  • Issue linked
  • Docs updated (or issue created)
  • New package licenses are added to ThirdPartyNotices.txt (if applicable)

Closes #1628

Summary

Add optional --custom-properties JSON input to bbs2gh migrate-repo only:

--custom-properties '{"environment":"production","teams":["platform","security"]}'
  • Validate unique, nonempty property names and string, string-array, or null values before migration work. Boolean properties use "true" or "false" strings.
  • Apply values with the repository custom-properties REST endpoint only after successful migration. Reject --queue-only and export-only operations.
  • Report property-update errors explicitly, explaining that the repository was migrated and the migration should not be rerun.
  • Add input, command-binding, handler, and API regression coverage; README usage/permissions/recovery documentation; and a release note.

No new dependencies or licenses. No flags or behavior changes in ado2gh, gei, or gl2gh. The shared API method is called only by bbs2gh. generate-script is not extended.

Limitations

Properties must already exist in the destination organization, and the caller needs permission to edit their values. GitHub's migration input does not expose custom properties, so this is a post-migration update, not atomic repository creation. It does not resolve creation-time required-property policies in #1558 or #1563.

Validation

Commands ran with a session-local .NET 8 SDK on PATH:

Command Result
dotnet format src/OctoshiftCLI.sln Passed; workspace-loading warnings reported.
dotnet format src/OctoshiftCLI.sln --no-restore --verify-no-changes --verbosity quiet Passed.
dotnet build src/OctoshiftCLI.sln /p:TreatWarningsAsErrors=true --verbosity quiet Failed on existing NU1903 advisories for unchanged SSH.NET 2024.2.0: GHSA-mggc-4xg6-vcxf and GHSA-q939-rpr3-3284.
dotnet build src/OctoshiftCLI.sln /p:TreatWarningsAsErrors=true /p:NuGetAudit=false --verbosity quiet Passed with zero warnings/errors. Audit disabled only for this local verification command; repository settings unchanged.
dotnet test src/OctoshiftCLI.Tests/OctoshiftCLI.Tests.csproj --no-build --no-restore --verbosity quiet Passed: 1,230 tests.
git diff --check Passed before commit.

CLI help confirmed the option is exposed only by bbs2gh. No live migration or integration tests were run; the contribution guide warns that local integration tests can interfere with shared CI resources.

Apply JSON custom property values after successful Bitbucket migrations, with input validation, explicit partial-failure reporting, and bbs2gh-only CLI exposure.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Post-migration update timeouts bypass the required recovery guidance and could prompt users to rerun a completed migration.

1 open finding
What changed in this PR

Adds optional custom-property assignment to bbs2gh migrate-repo after successful repository migration.

Changes:

  • Adds and validates the --custom-properties JSON option.
  • Applies properties through GitHub’s repository custom-properties API.
  • Adds tests, documentation, and release notes.
File Description
src/​Octoshift/​Services/​GithubApi.cs Adds the custom-property PATCH request.
src/​bbs2gh/​Commands/​MigrateRepo/​MigrateRepoCommand.cs Defines the new CLI option.
src/​bbs2gh/​Commands/​MigrateRepo/​MigrateRepoCommandArgs.cs Parses and validates property JSON.
src/​bbs2gh/​Commands/​MigrateRepo/​MigrateRepoCommandHandler.cs Applies properties after migration.
src/​OctoshiftCLI.Tests/​Octoshift/​Services/​GithubApiTests.cs Tests endpoint and payload behavior.
src/​OctoshiftCLI.Tests/​bbs2gh/​Commands/​MigrateRepo/​MigrateRepoCommandTests.cs Tests option binding.
src/​OctoshiftCLI.Tests/​bbs2gh/​Commands/​MigrateRepo/​MigrateRepoCommandArgsTests.cs Tests input validation.
src/​OctoshiftCLI.Tests/​bbs2gh/​Commands/​MigrateRepo/​MigrateRepoCommandHandlerTests.cs Tests post-migration behavior and errors.
README.md Documents usage and recovery.
RELEASENOTES.md Announces the feature.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread src/bbs2gh/Commands/MigrateRepo/MigrateRepoCommandHandler.cs Outdated
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Unit Test Results

    1 files      1 suites   24s ⏱️
1 233 tests 1 233 ✅ 0 💤 0 ❌
1 234 runs  1 234 ✅ 0 💤 0 ❌

Results for commit fb1a89f.

♻️ This comment has been updated with latest results.

enyil and others added 2 commits October 8, 2026 10:43
Change exception handling to catch all exceptions instead of just HttpRequestException.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Preserve migration-completed recovery guidance for HTTP failures, timeouts, cancellations, and exhausted API rate limits without catching unrelated exceptions. Add regression coverage and clarify recovery after an uncertain update result.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
gl2gh 78% 71% 420 ✔
gei 81% 74% 688 ✔
Octoshift 81% 71% 2049 ✔
bbs2gh 85% 80% 699 ✔
ado2gh 71% 70% 749 ➖
Summary 80% (9140 / 11493) 73% (2359 / 3249) 4605 ✔

This branch has not been deployed

No deployments
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.

bbs2gh: support setting custom property values after repository migration

2 participants