diff options
author | sudoforge <no-reply@sudoforge.com> | 2024-08-24 08:08:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-24 08:08:00 -0700 |
commit | 2004fa79e6ae7645d964a03e2ae2dd808f7d486a (patch) | |
tree | 64f3d5291d6957bd57fdb168b6aa10452f0fa1cb /bridge/github | |
parent | 63295b1106e0ad01bc1e0d682b71df14558b293a (diff) | |
download | git-bug-2004fa79e6ae7645d964a03e2ae2dd808f7d486a.tar.gz git-bug-2004fa79e6ae7645d964a03e2ae2dd808f7d486a.zip |
feat: update references to the git-bug organization (#1249)
The repository was recently moved to the git-bug organization on github.
This change refactors references to the repository to ensure that they
use the updated owner URI.
Closes: #1243
Change-Id: I799712354c6ba25cdd8b06286275850c52efe6ff
Diffstat (limited to 'bridge/github')
-rw-r--r-- | bridge/github/client.go | 2 | ||||
-rw-r--r-- | bridge/github/config.go | 10 | ||||
-rw-r--r-- | bridge/github/config_test.go | 46 | ||||
-rw-r--r-- | bridge/github/export.go | 14 | ||||
-rw-r--r-- | bridge/github/export_test.go | 14 | ||||
-rw-r--r-- | bridge/github/github.go | 4 | ||||
-rw-r--r-- | bridge/github/import.go | 10 | ||||
-rw-r--r-- | bridge/github/import_integration_test.go | 10 | ||||
-rw-r--r-- | bridge/github/import_test.go | 73 |
9 files changed, 107 insertions, 76 deletions
diff --git a/bridge/github/client.go b/bridge/github/client.go index e33b28d4..1072d7cb 100644 --- a/bridge/github/client.go +++ b/bridge/github/client.go @@ -9,7 +9,7 @@ import ( "github.com/shurcooL/githubv4" - "github.com/MichaelMure/git-bug/bridge/core" + "github.com/git-bug/git-bug/bridge/core" ) var _ Client = &githubv4.Client{} diff --git a/bridge/github/config.go b/bridge/github/config.go index 9ae1d187..401149a8 100644 --- a/bridge/github/config.go +++ b/bridge/github/config.go @@ -15,11 +15,11 @@ import ( "github.com/pkg/errors" - "github.com/MichaelMure/git-bug/bridge/core" - "github.com/MichaelMure/git-bug/bridge/core/auth" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/commands/input" - "github.com/MichaelMure/git-bug/repository" + "github.com/git-bug/git-bug/bridge/core" + "github.com/git-bug/git-bug/bridge/core/auth" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/commands/input" + "github.com/git-bug/git-bug/repository" ) const githubClientID = "ce3600aa56c2e69f18a5" // git-bug org diff --git a/bridge/github/config_test.go b/bridge/github/config_test.go index 01907435..a2043404 100644 --- a/bridge/github/config_test.go +++ b/bridge/github/config_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/MichaelMure/git-bug/bridge/core/auth" + "github.com/git-bug/git-bug/bridge/core/auth" ) func TestSplitURL(t *testing.T) { @@ -26,10 +26,10 @@ func TestSplitURL(t *testing.T) { { name: "default url", args: args{ - url: "https://github.com/MichaelMure/git-bug", + url: "https://github.com/git-bug/git-bug", }, want: want{ - owner: "MichaelMure", + owner: "git-bug", project: "git-bug", err: nil, }, @@ -37,10 +37,10 @@ func TestSplitURL(t *testing.T) { { name: "default issues url", args: args{ - url: "https://github.com/MichaelMure/git-bug/issues", + url: "https://github.com/git-bug/git-bug/issues", }, want: want{ - owner: "MichaelMure", + owner: "git-bug", project: "git-bug", err: nil, }, @@ -48,10 +48,10 @@ func TestSplitURL(t *testing.T) { { name: "default url with git extension", args: args{ - url: "https://github.com/MichaelMure/git-bug.git", + url: "https://github.com/git-bug/git-bug.git", }, want: want{ - owner: "MichaelMure", + owner: "git-bug", project: "git-bug", err: nil, }, @@ -59,10 +59,10 @@ func TestSplitURL(t *testing.T) { { name: "url with git protocol", args: args{ - url: "git://github.com/MichaelMure/git-bug.git", + url: "git://github.com/git-bug/git-bug.git", }, want: want{ - owner: "MichaelMure", + owner: "git-bug", project: "git-bug", err: nil, }, @@ -70,10 +70,10 @@ func TestSplitURL(t *testing.T) { { name: "ssh url", args: args{ - url: "git@github.com:MichaelMure/git-bug.git", + url: "git@github.com:git-bug/git-bug.git", }, want: want{ - owner: "MichaelMure", + owner: "git-bug", project: "git-bug", err: nil, }, @@ -81,7 +81,7 @@ func TestSplitURL(t *testing.T) { { name: "bad url", args: args{ - url: "https://githb.com/MichaelMure/git-bug.git", + url: "https://githb.com/git-bug/git-bug.git", }, want: want{ err: ErrBadProjectURL, @@ -115,26 +115,26 @@ func TestValidateUsername(t *testing.T) { }{ { name: "existing username", - input: "MichaelMure", - fixed: "MichaelMure", + input: "git-bug", + fixed: "git-bug", ok: true, }, { name: "existing username with bad case", - input: "MicHaelmurE", - fixed: "MichaelMure", + input: "GiT-bUg", + fixed: "git-bug", ok: true, }, { name: "existing organisation", - input: "ipfs", - fixed: "ipfs", + input: "git-bug", + fixed: "git-bug", ok: true, }, { name: "existing organisation with bad case", - input: "iPfS", - fixed: "ipfs", + input: "gIt-BuG", + fixed: "git-bug", ok: true, }, { @@ -183,7 +183,7 @@ func TestValidateProject(t *testing.T) { name: "public repository and token with scope 'public_repo'", args: args{ project: "git-bug", - owner: "MichaelMure", + owner: "git-bug", token: tokenPublic, }, want: true, @@ -192,7 +192,7 @@ func TestValidateProject(t *testing.T) { name: "private repository and token with scope 'repo'", args: args{ project: "git-bug-test-github-bridge", - owner: "MichaelMure", + owner: "git-bug", token: tokenPrivate, }, want: true, @@ -201,7 +201,7 @@ func TestValidateProject(t *testing.T) { name: "private repository and token with scope 'public_repo'", args: args{ project: "git-bug-test-github-bridge", - owner: "MichaelMure", + owner: "git-bug", token: tokenPublic, }, want: false, diff --git a/bridge/github/export.go b/bridge/github/export.go index 30e064c0..6f882637 100644 --- a/bridge/github/export.go +++ b/bridge/github/export.go @@ -15,13 +15,13 @@ import ( "github.com/shurcooL/githubv4" "golang.org/x/sync/errgroup" - "github.com/MichaelMure/git-bug/bridge/core" - "github.com/MichaelMure/git-bug/bridge/core/auth" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/entities/bug" - "github.com/MichaelMure/git-bug/entities/common" - "github.com/MichaelMure/git-bug/entity" - "github.com/MichaelMure/git-bug/entity/dag" + "github.com/git-bug/git-bug/bridge/core" + "github.com/git-bug/git-bug/bridge/core/auth" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/entities/bug" + "github.com/git-bug/git-bug/entities/common" + "github.com/git-bug/git-bug/entity" + "github.com/git-bug/git-bug/entity/dag" ) var ( diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go index e06457d4..9b10020d 100644 --- a/bridge/github/export_test.go +++ b/bridge/github/export_test.go @@ -13,13 +13,13 @@ import ( "github.com/stretchr/testify/require" - "github.com/MichaelMure/git-bug/bridge/core" - "github.com/MichaelMure/git-bug/bridge/core/auth" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/entity" - "github.com/MichaelMure/git-bug/entity/dag" - "github.com/MichaelMure/git-bug/repository" - "github.com/MichaelMure/git-bug/util/interrupt" + "github.com/git-bug/git-bug/bridge/core" + "github.com/git-bug/git-bug/bridge/core/auth" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/entity" + "github.com/git-bug/git-bug/entity/dag" + "github.com/git-bug/git-bug/repository" + "github.com/git-bug/git-bug/util/interrupt" ) const ( diff --git a/bridge/github/github.go b/bridge/github/github.go index cbeb03eb..09a352a8 100644 --- a/bridge/github/github.go +++ b/bridge/github/github.go @@ -7,8 +7,8 @@ import ( "golang.org/x/oauth2" - "github.com/MichaelMure/git-bug/bridge/core" - "github.com/MichaelMure/git-bug/bridge/core/auth" + "github.com/git-bug/git-bug/bridge/core" + "github.com/git-bug/git-bug/bridge/core/auth" ) const ( diff --git a/bridge/github/import.go b/bridge/github/import.go index 4a51d117..2268d9e7 100644 --- a/bridge/github/import.go +++ b/bridge/github/import.go @@ -7,11 +7,11 @@ import ( "github.com/shurcooL/githubv4" - "github.com/MichaelMure/git-bug/bridge/core" - "github.com/MichaelMure/git-bug/bridge/core/auth" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/entity" - "github.com/MichaelMure/git-bug/util/text" + "github.com/git-bug/git-bug/bridge/core" + "github.com/git-bug/git-bug/bridge/core/auth" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/entity" + "github.com/git-bug/git-bug/util/text" ) const EmptyTitlePlaceholder = "<empty string>" diff --git a/bridge/github/import_integration_test.go b/bridge/github/import_integration_test.go index 8c411d8d..a642d374 100644 --- a/bridge/github/import_integration_test.go +++ b/bridge/github/import_integration_test.go @@ -11,11 +11,11 @@ import ( m "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/MichaelMure/git-bug/bridge/github/mocks" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/entities/bug" - "github.com/MichaelMure/git-bug/repository" - "github.com/MichaelMure/git-bug/util/interrupt" + "github.com/git-bug/git-bug/bridge/github/mocks" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/entities/bug" + "github.com/git-bug/git-bug/repository" + "github.com/git-bug/git-bug/util/interrupt" ) // using testify/mock and mockery diff --git a/bridge/github/import_test.go b/bridge/github/import_test.go index b0ff2f99..80be5116 100644 --- a/bridge/github/import_test.go +++ b/bridge/github/import_test.go @@ -4,20 +4,21 @@ import ( "context" "fmt" "os" + "strings" "testing" "time" "github.com/stretchr/testify/require" - "github.com/MichaelMure/git-bug/bridge/core" - "github.com/MichaelMure/git-bug/bridge/core/auth" - "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/entities/bug" - "github.com/MichaelMure/git-bug/entities/common" - "github.com/MichaelMure/git-bug/entities/identity" - "github.com/MichaelMure/git-bug/entity/dag" - "github.com/MichaelMure/git-bug/repository" - "github.com/MichaelMure/git-bug/util/interrupt" + "github.com/git-bug/git-bug/bridge/core" + "github.com/git-bug/git-bug/bridge/core/auth" + "github.com/git-bug/git-bug/cache" + "github.com/git-bug/git-bug/entities/bug" + "github.com/git-bug/git-bug/entities/common" + "github.com/git-bug/git-bug/entities/identity" + "github.com/git-bug/git-bug/entity/dag" + "github.com/git-bug/git-bug/repository" + "github.com/git-bug/git-bug/util/interrupt" ) func TestGithubImporter(t *testing.T) { @@ -34,7 +35,10 @@ func TestGithubImporter(t *testing.T) { defer backend.Close() interrupt.RegisterCleaner(backend.Close) - author, err := identity.NewIdentity(repo, "Michael Muré", "batolettre@gmail.com") + author, err := identity.NewIdentity(repo, "Michael Muré", "no-reply@git-bug.test") + require.NoError(t, err) + + complexIssueEditAuthor, err := identity.NewIdentity(repo, "sudoforge", "no-reply@git-bug.test") require.NoError(t, err) tests := []struct { @@ -44,7 +48,7 @@ func TestGithubImporter(t *testing.T) { }{ { name: "simple issue", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/1", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/1", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "simple issue", "initial comment", nil), @@ -55,7 +59,7 @@ func TestGithubImporter(t *testing.T) { }, { name: "empty issue", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/2", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/2", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "empty issue", "", nil), @@ -64,14 +68,41 @@ func TestGithubImporter(t *testing.T) { }, { name: "complex issue", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/3", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/3", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "complex issue", "initial comment", nil), bug.NewLabelChangeOperation(author, 0, []bug.Label{"bug"}, []bug.Label{}), bug.NewLabelChangeOperation(author, 0, []bug.Label{"duplicate"}, []bug.Label{}), bug.NewLabelChangeOperation(author, 0, []bug.Label{}, []bug.Label{"duplicate"}), - bug.NewAddCommentOp(author, 0, "### header\n\n**bold**\n\n_italic_\n\n> with quote\n\n`inline code`\n\n```\nmultiline code\n```\n\n- bulleted\n- list\n\n1. numbered\n1. list\n\n- [ ] task\n- [x] list\n\n@MichaelMure mention\n\n#2 reference issue\n#3 auto-reference issue\n\n", nil), + bug.NewAddCommentOp(author, 0, strings.Join([]string{ + "### header", + "**bold**", + "_italic_", + "> with quote", + "`inline code`", + "```\nmultiline code\n```", + "- bulleted\n- list", + "1. numbered\n1. list", + "- [ ] task\n- [x] list", + "@MichaelMure mention", + "#2 reference issue\n#3 auto-reference issue", + "", + }, "\n\n"), nil), + bug.NewEditCommentOp(complexIssueEditAuthor, 0, "", strings.Join([]string{ + "### header", + "**bold**", + "_italic_", + "> with quote", + "`inline code`", + "```\nmultiline code\n```", + "- bulleted\n- list", + "1. numbered\n1. list", + "- [ ] task\n- [x] list", + "@git-bug/maintainers mention", + "#2 reference issue\n#3 auto-reference issue", + "", + }, "\n\n"), nil), bug.NewSetTitleOp(author, 0, "complex issue edited", "complex issue"), bug.NewSetTitleOp(author, 0, "complex issue", "complex issue edited"), bug.NewSetStatusOp(author, 0, common.ClosedStatus), @@ -81,7 +112,7 @@ func TestGithubImporter(t *testing.T) { }, { name: "editions", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/4", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/4", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "editions", "initial comment edited", nil), @@ -93,7 +124,7 @@ func TestGithubImporter(t *testing.T) { }, { name: "comment deletion", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/5", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/5", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "comment deletion", "", nil), @@ -102,7 +133,7 @@ func TestGithubImporter(t *testing.T) { }, { name: "edition deletion", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/6", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/6", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "edition deletion", "initial comment", nil), @@ -114,7 +145,7 @@ func TestGithubImporter(t *testing.T) { }, { name: "hidden comment", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/7", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/7", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "hidden comment", "initial comment", nil), @@ -124,7 +155,7 @@ func TestGithubImporter(t *testing.T) { }, { name: "transferred issue", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/8", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/8", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "transfered issue", "", nil), @@ -133,7 +164,7 @@ func TestGithubImporter(t *testing.T) { }, { name: "unicode control characters", - url: "https://github.com/MichaelMure/git-bug-test-github-bridge/issues/10", + url: "https://github.com/git-bug/git-bug-test-github-bridge/issues/10", bug: &bug.Snapshot{ Operations: []dag.Operation{ bug.NewCreateOp(author, 0, "unicode control characters", "u0000: \nu0001: \nu0002: \nu0003: \nu0004: \nu0005: \nu0006: \nu0007: \nu0008: \nu0009: \t\nu0010: \nu0011: \nu0012: \nu0013: \nu0014: \nu0015: \nu0016: \nu0017: \nu0018: \nu0019:", nil), @@ -154,7 +185,7 @@ func TestGithubImporter(t *testing.T) { importer := &githubImporter{} err = importer.Init(ctx, backend, core.Configuration{ - confKeyOwner: "MichaelMure", + confKeyOwner: "git-bug", confKeyProject: "git-bug-test-github-bridge", confKeyDefaultLogin: login, }) |