diff --git a/pkg/cmd/skills/publish/publish_test.go b/pkg/cmd/skills/publish/publish_test.go index 27bdfb768..04f400733 100644 --- a/pkg/cmd/skills/publish/publish_test.go +++ b/pkg/cmd/skills/publish/publish_test.go @@ -161,11 +161,11 @@ func TestPublishRun_UnsupportedHost(t *testing.T) { ios, _, _, _ := iostreams.Test() initGitRepo(t, dir, map[string]string{"origin": "https://github.com/monalisa/skills-repo.git"}) err := publishRun(&PublishOptions{ - IO: ios, - Dir: dir, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{}, nil }, - host: "acme.ghes.com", + host: "acme.ghes.com", }) require.ErrorContains(t, err, "supports only github.com") } @@ -285,12 +285,12 @@ func TestPublishRun(t *testing.T) { opts: func(ios *iostreams.IOStreams, dir string, reg *httpmock.Registry) *PublishOptions { t.Helper() return &PublishOptions{ - IO: ios, - Dir: dir, - DryRun: true, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + DryRun: true, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "1 skill(s) validated successfully", @@ -322,12 +322,12 @@ func TestPublishRun(t *testing.T) { opts: func(ios *iostreams.IOStreams, dir string, reg *httpmock.Registry) *PublishOptions { t.Helper() return &PublishOptions{ - IO: ios, - Dir: dir, - DryRun: true, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + DryRun: true, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "1 skill(s) validated successfully", @@ -356,12 +356,12 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/monalisa/skills-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - DryRun: true, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + DryRun: true, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "1 skill(s) validated successfully", @@ -415,9 +415,9 @@ func TestPublishRun(t *testing.T) { Prompter: &prompter.PrompterMock{ ConfirmFunc: func(msg string, def bool) (bool, error) { return true, nil }, }, - GitClient: &git.Client{}, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "Published v1.0.1", @@ -563,11 +563,11 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/octocat/secure-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "secret scanning is not enabled", @@ -616,11 +616,11 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/octocat/tag-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "tag protection", @@ -679,12 +679,12 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/octocat/code-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - DryRun: true, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + DryRun: true, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStderr: "code scanning", @@ -744,12 +744,12 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/octocat/dep-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - DryRun: true, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + DryRun: true, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStderr: "Dependabot", @@ -894,12 +894,12 @@ func TestPublishRun(t *testing.T) { "upstream": "git@github.com:octocat/repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - DryRun: true, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + DryRun: true, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStderr: "octocat/repo", @@ -986,9 +986,9 @@ func TestPublishRun(t *testing.T) { Prompter: &prompter.PrompterMock{ ConfirmFunc: func(msg string, def bool) (bool, error) { return true, nil }, }, - GitClient: &git.Client{}, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "Added \"agent-skills\" topic", @@ -1058,12 +1058,12 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/monalisa/skills-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - Tag: "v2.3.5", - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + Tag: "v2.3.5", + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "Published v2.3.5", @@ -1090,12 +1090,12 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/monalisa/skills-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - Tag: "v1.0.0", // same as stubAllSecureRemote's existing tag - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + Tag: "v1.0.0", // same as stubAllSecureRemote's existing tag + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantErr: "tag v1.0.0 already exists", @@ -1123,11 +1123,11 @@ func TestPublishRun(t *testing.T) { "origin": "https://github.com/monalisa/skills-repo.git", }) return &PublishOptions{ - IO: ios, - Dir: dir, - GitClient: &git.Client{}, + IO: ios, + Dir: dir, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "ok", @@ -1236,9 +1236,9 @@ func TestPublishRun(t *testing.T) { return "v1.0.0", nil // accept suggested tag }, }, - GitClient: &git.Client{}, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "Published v1.0.0", @@ -1293,9 +1293,9 @@ func TestPublishRun(t *testing.T) { return "beta-1", nil }, }, - GitClient: &git.Client{}, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "Published beta-1", @@ -1349,9 +1349,9 @@ func TestPublishRun(t *testing.T) { return "v1.0.1", nil }, }, - GitClient: &git.Client{}, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantErr: "CancelError", @@ -1413,9 +1413,9 @@ func TestPublishRun(t *testing.T) { return "v1.0.1", nil }, }, - GitClient: &git.Client{}, + GitClient: &git.Client{}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", } }, wantStdout: "Enabled immutable releases", @@ -1527,12 +1527,12 @@ func TestPublishRun_DirArgUsesTargetRemote(t *testing.T) { stubAllSecureRemote(reg, "monalisa", "target-repo") err := publishRun(&PublishOptions{ - IO: ios, - Dir: targetRepo, - DryRun: true, - GitClient: &git.Client{RepoDir: cwdRepo}, + IO: ios, + Dir: targetRepo, + DryRun: true, + GitClient: &git.Client{RepoDir: cwdRepo}, HttpClient: func() (*http.Client, error) { return &http.Client{Transport: reg}, nil }, - host: "github.com", + host: "github.com", }) require.NoError(t, err)