As a user, I'd like to migrate issues between bridged repositories

Labels: area/bridge kind/feature priority/backlog

Timeline

Squirrel (gilescope) opened

I was trying to use git-bug to migrate a set of issues from one github repo to another.

I created the source bridge and pulled fine, but when deleting that bridge and recreating it point to the destination github repo I received:

Error: invalid parameter owner

I would think git-bug would be just the right tool to be able to use to migrate issues from one repo to another. I couldn't see this workflow explicitly documented - is there a way I can do the issue migration? (We're trying to give another open source project a new lease of life).

With kind regards,

Giles

sudoforge added label kind/bug

sudoforge added label area/bridge

sudoforge added label priority/important-soon

sudoforge changed the title from Migrating issues between bridged repositories to Migrating issues between bridge repositories

sudoforge removed label kind/bug

sudoforge removed label priority/important-soon

sudoforge added label kind/feature

sudoforge added label priority/backlog

sudoforge commented (edited)

thanks for opening this! using git-bug to migrate issues between two distinct bridged repositories is not an explicitly supported workflow, but should be possible in the future given the flexible architecture of git-bug.

the problem you're running into actually has to do with username validation:

https://github.com/git-bug/git-bug/blob/f2070b53255724f58ce2b70f235fe5cf1b99f2fe/bridge/github/config.go#L72-L78

admittedly, the way errors are handled in many parts of git-bug, including this one, could be improved.

today, we do not support migrating issues between two distinct bridge repositories - issues that are imported from a bridge are tagged with metadata that includes the url of the repository they were imported from, and on export, issues with URIs which do not match the bridge which we're exporting to are removed.

that said, you shouldn't have ran into that specific error if everything was set up correctly. here's the full log for a session in which i first replicated the existence of an "old" and "new" repository, and then attempted used git-bug to perform a migration of the issues (old -> local -> new).

as we can see, i didn't run into the same error you're reporting, but in the end, i wasn't able to export the issue imported from the old bridge repository, to the new one. what i'd like to do is help ensure you can end up in this same state - that is, that you no longer experience that error. then, this issue can remain open as a feature request to support this use case.

➜ mktemp -d
/tmp/tmp.iBlnMYkWPh

➜ cd /tmp/tmp.iBlnMYkWPh

➜ gh repo create --private test-old
✓ Created repository sudoforge/test-old on GitHub
  https://github.com/sudoforge/test-old


➜ gh repo create --private test-new
✓ Created repository sudoforge/test-new on GitHub
  https://github.com/sudoforge/test-new


➜ gh issue create --repo sudoforge/test-old --title "foo issue" --body "just a test issue"

Creating issue in sudoforge/test-old

https://github.com/sudoforge/test-old/issues/1


➜ git init .
Initialized empty Git repository in /tmp/tmp.iBlnMYkWPh/.git/


➜ git remote add origin gh:sudoforge/test-old.git


➜ git bug user new -e 'no-reply@git-bug.org' -n 'sudoforge' --non-interactive
Building cache...

7fbae7115cd78a06228a6ed4b67e5313aed5d0c1874abb1fd3fb0d87cba4ea2a


➜ git bug user adopt 7fbae71
Your identity is now: sudoforge


➜ git bug bridge new --name old --target github --url https://github.com/sudoforge/test-old
Github login: sudoforge

[1]: enter my token
[2]: interactive token creation

Existing token for github:
[3]: 32c4bd6 => (login:sudoforge) (12 Jul 25 07:30 PDT)

Select option: 3

Current identity 7fbae71 tagged with login sudoforge
Successfully configured bridge: old


➜ git bug bridge new --name new --target github --url https://github.com/sudoforge/test-new
Github login: sudoforge

[1]: enter my token
[2]: interactive token creation

Existing token for github:
[3]: 32c4bd6 => (login:sudoforge) (12 Jul 25 07:30 PDT)

Select option: 3

Successfully configured bridge: new


➜ git bug bridge pull old
[865c9f2] new issue: 865c9f22a9503b708cfb038dba82fab187c795f3003a344aa9584bfbb3b682a0
imported 1 issues and 0 identities with old bridge


➜ git bug bridge push new
exported 0 issues with new bridge

sudoforge changed the title from Migrating issues between bridge repositories to Migrating issues between bridged repositories

Squirrel (gilescope) commented

The problem was that I had not adopted a user:

git bug user new -e 'no-reply@git-bug.org' -n 'sudoforge' --non-interactive
git bug user adopt 7fbae71

I now get:

exported 0 issues with new bridge

sudoforge commented

excellent! this is the expected state as of the latest release (v0.10.1).

we can keep this issue open as a feature request for supporting migrations between bridged repositories.

sudoforge changed the title from Migrating issues between bridged repositories to As a user, I'd like to migrate issues between bridged repositories