From f9e558b9b52ee5e6f62b1aacd68c7df26ffcec79 Mon Sep 17 00:00:00 2001 From: John McBride Date: Wed, 18 Sep 2024 10:57:10 -0600 Subject: [PATCH] feat: Upgrades to v2 packages to track with v2 git tag Signed-off-by: John McBride --- api/auth/auth.go | 2 +- api/client.go | 8 ++++---- api/services/contributors/contributors_test.go | 4 ++-- api/services/contributors/spec.go | 2 +- api/services/histogram/histogram_test.go | 2 +- api/services/repository/repository_test.go | 4 ++-- api/services/workspaces/spec.go | 2 +- api/services/workspaces/userlists/spec.go | 2 +- .../workspaces/userlists/userlists_test.go | 4 ++-- api/services/workspaces/workspaces.go | 2 +- api/services/workspaces/workspaces_test.go | 4 ++-- cmd/auth/auth.go | 6 +++--- cmd/generate/codeowners/codeowners.go | 8 ++++---- cmd/generate/codeowners/output.go | 2 +- cmd/generate/codeowners/output_test.go | 2 +- cmd/generate/codeowners/traversal.go | 2 +- cmd/generate/config/config.go | 4 ++-- cmd/generate/config/output.go | 4 ++-- cmd/generate/generate.go | 6 +++--- cmd/generate/insight/insight.go | 14 +++++++------- cmd/insights/contributors.go | 10 +++++----- cmd/insights/insights.go | 2 +- cmd/insights/repositories.go | 10 +++++----- cmd/insights/user-contributions.go | 6 +++--- cmd/insights/utils.go | 6 +++--- cmd/root/root.go | 12 ++++++------ cmd/version/version.go | 2 +- go.mod | 2 +- go.sum | 2 -- main.go | 4 ++-- pkg/utils/root.go | 2 +- telemetry.go | 2 +- 32 files changed, 71 insertions(+), 73 deletions(-) diff --git a/api/auth/auth.go b/api/auth/auth.go index 970aa2d..9fb2baa 100644 --- a/api/auth/auth.go +++ b/api/auth/auth.go @@ -19,7 +19,7 @@ import ( "github.com/cli/browser" "github.com/go-chi/chi/v5" - "github.com/open-sauced/pizza-cli/pkg/config" + "github.com/open-sauced/pizza-cli/v2/pkg/config" ) // The success HTML file is embedded directly as a var. diff --git a/api/client.go b/api/client.go index 04bf1de..e026e14 100644 --- a/api/client.go +++ b/api/client.go @@ -4,10 +4,10 @@ import ( "net/http" "time" - "github.com/open-sauced/pizza-cli/api/services/contributors" - "github.com/open-sauced/pizza-cli/api/services/histogram" - "github.com/open-sauced/pizza-cli/api/services/repository" - "github.com/open-sauced/pizza-cli/api/services/workspaces" + "github.com/open-sauced/pizza-cli/v2/api/services/contributors" + "github.com/open-sauced/pizza-cli/v2/api/services/histogram" + "github.com/open-sauced/pizza-cli/v2/api/services/repository" + "github.com/open-sauced/pizza-cli/v2/api/services/workspaces" ) // Client is the API client for OpenSauced API diff --git a/api/services/contributors/contributors_test.go b/api/services/contributors/contributors_test.go index 6d6cd8c..b9a902c 100644 --- a/api/services/contributors/contributors_test.go +++ b/api/services/contributors/contributors_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-sauced/pizza-cli/api/mock" - "github.com/open-sauced/pizza-cli/api/services" + "github.com/open-sauced/pizza-cli/v2/api/mock" + "github.com/open-sauced/pizza-cli/v2/api/services" ) func TestNewPullrequestContributors(t *testing.T) { diff --git a/api/services/contributors/spec.go b/api/services/contributors/spec.go index 92552dc..54bae1b 100644 --- a/api/services/contributors/spec.go +++ b/api/services/contributors/spec.go @@ -3,7 +3,7 @@ package contributors import ( "time" - "github.com/open-sauced/pizza-cli/api/services" + "github.com/open-sauced/pizza-cli/v2/api/services" ) type DbContributor struct { diff --git a/api/services/histogram/histogram_test.go b/api/services/histogram/histogram_test.go index a630565..3f64100 100644 --- a/api/services/histogram/histogram_test.go +++ b/api/services/histogram/histogram_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-sauced/pizza-cli/api/mock" + "github.com/open-sauced/pizza-cli/v2/api/mock" ) func TestPrsHistogram(t *testing.T) { diff --git a/api/services/repository/repository_test.go b/api/services/repository/repository_test.go index 3d85cfd..ffc560d 100644 --- a/api/services/repository/repository_test.go +++ b/api/services/repository/repository_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-sauced/pizza-cli/api/mock" - "github.com/open-sauced/pizza-cli/api/services" + "github.com/open-sauced/pizza-cli/v2/api/mock" + "github.com/open-sauced/pizza-cli/v2/api/services" ) func TestFindOneByOwnerAndRepo(t *testing.T) { diff --git a/api/services/workspaces/spec.go b/api/services/workspaces/spec.go index 4044d41..3b9952d 100644 --- a/api/services/workspaces/spec.go +++ b/api/services/workspaces/spec.go @@ -3,7 +3,7 @@ package workspaces import ( "time" - "github.com/open-sauced/pizza-cli/api/services" + "github.com/open-sauced/pizza-cli/v2/api/services" ) type DbWorkspace struct { diff --git a/api/services/workspaces/userlists/spec.go b/api/services/workspaces/userlists/spec.go index 0fb0531..acc0aec 100644 --- a/api/services/workspaces/userlists/spec.go +++ b/api/services/workspaces/userlists/spec.go @@ -3,7 +3,7 @@ package userlists import ( "time" - "github.com/open-sauced/pizza-cli/api/services" + "github.com/open-sauced/pizza-cli/v2/api/services" ) type DbUserListContributor struct { diff --git a/api/services/workspaces/userlists/userlists_test.go b/api/services/workspaces/userlists/userlists_test.go index 3b277c8..51a708c 100644 --- a/api/services/workspaces/userlists/userlists_test.go +++ b/api/services/workspaces/userlists/userlists_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-sauced/pizza-cli/api/mock" - "github.com/open-sauced/pizza-cli/api/services" + "github.com/open-sauced/pizza-cli/v2/api/mock" + "github.com/open-sauced/pizza-cli/v2/api/services" ) func TestGetUserLists(t *testing.T) { diff --git a/api/services/workspaces/workspaces.go b/api/services/workspaces/workspaces.go index 0d243b6..adfa798 100644 --- a/api/services/workspaces/workspaces.go +++ b/api/services/workspaces/workspaces.go @@ -8,7 +8,7 @@ import ( "net/url" "strconv" - "github.com/open-sauced/pizza-cli/api/services/workspaces/userlists" + "github.com/open-sauced/pizza-cli/v2/api/services/workspaces/userlists" ) // Service is used to access the "v2/workspaces" endpoints and services. diff --git a/api/services/workspaces/workspaces_test.go b/api/services/workspaces/workspaces_test.go index 3da2b50..5de56ec 100644 --- a/api/services/workspaces/workspaces_test.go +++ b/api/services/workspaces/workspaces_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/open-sauced/pizza-cli/api/mock" - "github.com/open-sauced/pizza-cli/api/services" + "github.com/open-sauced/pizza-cli/v2/api/mock" + "github.com/open-sauced/pizza-cli/v2/api/services" ) func TestGetWorkspaces(t *testing.T) { diff --git a/cmd/auth/auth.go b/cmd/auth/auth.go index 86835dd..f7b3213 100644 --- a/cmd/auth/auth.go +++ b/cmd/auth/auth.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/api/auth" - "github.com/open-sauced/pizza-cli/pkg/constants" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/api/auth" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) // Options are the persistent options for the login command diff --git a/cmd/generate/codeowners/codeowners.go b/cmd/generate/codeowners/codeowners.go index f2ad82b..3da44f8 100644 --- a/cmd/generate/codeowners/codeowners.go +++ b/cmd/generate/codeowners/codeowners.go @@ -11,10 +11,10 @@ import ( "github.com/jpmcb/gopherlogs/pkg/colors" "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/pkg/config" - "github.com/open-sauced/pizza-cli/pkg/constants" - "github.com/open-sauced/pizza-cli/pkg/logging" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/pkg/config" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/logging" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) // Options for the codeowners generation command diff --git a/cmd/generate/codeowners/output.go b/cmd/generate/codeowners/output.go index 800b103..a4bd1c4 100644 --- a/cmd/generate/codeowners/output.go +++ b/cmd/generate/codeowners/output.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/open-sauced/pizza-cli/pkg/config" + "github.com/open-sauced/pizza-cli/v2/pkg/config" ) func generateOutputFile(fileStats FileStats, outputPath string, opts *Options, cmd *cobra.Command) error { diff --git a/cmd/generate/codeowners/output_test.go b/cmd/generate/codeowners/output_test.go index 02ac7c6..c93a260 100644 --- a/cmd/generate/codeowners/output_test.go +++ b/cmd/generate/codeowners/output_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/open-sauced/pizza-cli/pkg/config" + "github.com/open-sauced/pizza-cli/v2/pkg/config" ) func TestCleanFilename(testRunner *testing.T) { diff --git a/cmd/generate/codeowners/traversal.go b/cmd/generate/codeowners/traversal.go index 2e2f1e8..c22591b 100644 --- a/cmd/generate/codeowners/traversal.go +++ b/cmd/generate/codeowners/traversal.go @@ -13,7 +13,7 @@ import ( "github.com/jpmcb/gopherlogs" "github.com/jpmcb/gopherlogs/pkg/colors" - "github.com/open-sauced/pizza-cli/pkg/logging" + "github.com/open-sauced/pizza-cli/v2/pkg/logging" ) // ProcessOptions are the options for iterating a git reflog and deriving the codeowners diff --git a/cmd/generate/config/config.go b/cmd/generate/config/config.go index bc39df4..fca34b6 100644 --- a/cmd/generate/config/config.go +++ b/cmd/generate/config/config.go @@ -12,8 +12,8 @@ import ( "github.com/go-git/go-git/v5/plumbing/object" "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/pkg/constants" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) // Options for the config generation command diff --git a/cmd/generate/config/output.go b/cmd/generate/config/output.go index f8db065..2743b5a 100644 --- a/cmd/generate/config/output.go +++ b/cmd/generate/config/output.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/open-sauced/pizza-cli/pkg/config" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/pkg/config" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) func generateOutputFile(outputPath string, attributionMap map[string][]string) error { diff --git a/cmd/generate/generate.go b/cmd/generate/generate.go index 47edbd0..cf1930c 100644 --- a/cmd/generate/generate.go +++ b/cmd/generate/generate.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/cmd/generate/codeowners" - "github.com/open-sauced/pizza-cli/cmd/generate/config" - "github.com/open-sauced/pizza-cli/cmd/generate/insight" + "github.com/open-sauced/pizza-cli/v2/cmd/generate/codeowners" + "github.com/open-sauced/pizza-cli/v2/cmd/generate/config" + "github.com/open-sauced/pizza-cli/v2/cmd/generate/insight" ) const generateLongDesc string = `The 'generate' command provides tools to automate the creation of important project documentation and derive insights from your codebase.` diff --git a/cmd/generate/insight/insight.go b/cmd/generate/insight/insight.go index 5769316..601ea79 100644 --- a/cmd/generate/insight/insight.go +++ b/cmd/generate/insight/insight.go @@ -12,13 +12,13 @@ import ( "github.com/jpmcb/gopherlogs/pkg/colors" "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/api" - "github.com/open-sauced/pizza-cli/api/auth" - "github.com/open-sauced/pizza-cli/api/services/workspaces" - "github.com/open-sauced/pizza-cli/api/services/workspaces/userlists" - "github.com/open-sauced/pizza-cli/pkg/constants" - "github.com/open-sauced/pizza-cli/pkg/logging" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/api" + "github.com/open-sauced/pizza-cli/v2/api/auth" + "github.com/open-sauced/pizza-cli/v2/api/services/workspaces" + "github.com/open-sauced/pizza-cli/v2/api/services/workspaces/userlists" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/logging" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) // Options for the codeowners generation command diff --git a/cmd/insights/contributors.go b/cmd/insights/contributors.go index 031d033..96e793c 100644 --- a/cmd/insights/contributors.go +++ b/cmd/insights/contributors.go @@ -12,11 +12,11 @@ import ( bubblesTable "github.com/charmbracelet/bubbles/table" "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/api" - "github.com/open-sauced/pizza-cli/api/services/contributors" - apiUtils "github.com/open-sauced/pizza-cli/api/utils" - "github.com/open-sauced/pizza-cli/pkg/constants" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/api" + "github.com/open-sauced/pizza-cli/v2/api/services/contributors" + apiUtils "github.com/open-sauced/pizza-cli/v2/api/utils" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) type contributorsOptions struct { diff --git a/cmd/insights/insights.go b/cmd/insights/insights.go index de426e4..1ae3681 100644 --- a/cmd/insights/insights.go +++ b/cmd/insights/insights.go @@ -3,7 +3,7 @@ package insights import ( "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" ) // NewInsightsCommand returns a new cobra command for 'pizza insights' diff --git a/cmd/insights/repositories.go b/cmd/insights/repositories.go index ca4a1fe..519c06d 100644 --- a/cmd/insights/repositories.go +++ b/cmd/insights/repositories.go @@ -10,11 +10,11 @@ import ( bubblesTable "github.com/charmbracelet/bubbles/table" "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/api" - "github.com/open-sauced/pizza-cli/api/services/contributors" - "github.com/open-sauced/pizza-cli/api/services/histogram" - "github.com/open-sauced/pizza-cli/pkg/constants" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/api" + "github.com/open-sauced/pizza-cli/v2/api/services/contributors" + "github.com/open-sauced/pizza-cli/v2/api/services/histogram" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) type repositoriesOptions struct { diff --git a/cmd/insights/user-contributions.go b/cmd/insights/user-contributions.go index b729756..bdb10f8 100644 --- a/cmd/insights/user-contributions.go +++ b/cmd/insights/user-contributions.go @@ -12,9 +12,9 @@ import ( bubblesTable "github.com/charmbracelet/bubbles/table" "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/api" - "github.com/open-sauced/pizza-cli/pkg/constants" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/api" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) type userContributionsOptions struct { diff --git a/cmd/insights/utils.go b/cmd/insights/utils.go index d81b02d..b756d00 100644 --- a/cmd/insights/utils.go +++ b/cmd/insights/utils.go @@ -4,9 +4,9 @@ import ( "fmt" "net/http" - "github.com/open-sauced/pizza-cli/api" - "github.com/open-sauced/pizza-cli/api/services/repository" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/api" + "github.com/open-sauced/pizza-cli/v2/api/services/repository" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) // findRepositoryByOwnerAndRepoName returns an API client Db Repo diff --git a/cmd/root/root.go b/cmd/root/root.go index bbf81ae..d41a435 100644 --- a/cmd/root/root.go +++ b/cmd/root/root.go @@ -6,12 +6,12 @@ import ( "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/cmd/auth" - "github.com/open-sauced/pizza-cli/cmd/docs" - "github.com/open-sauced/pizza-cli/cmd/generate" - "github.com/open-sauced/pizza-cli/cmd/insights" - "github.com/open-sauced/pizza-cli/cmd/version" - "github.com/open-sauced/pizza-cli/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/cmd/auth" + "github.com/open-sauced/pizza-cli/v2/cmd/docs" + "github.com/open-sauced/pizza-cli/v2/cmd/generate" + "github.com/open-sauced/pizza-cli/v2/cmd/insights" + "github.com/open-sauced/pizza-cli/v2/cmd/version" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" ) // NewRootCommand bootstraps a new root cobra command for the pizza CLI diff --git a/cmd/version/version.go b/cmd/version/version.go index f10b607..7fe1ceb 100644 --- a/cmd/version/version.go +++ b/cmd/version/version.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) func NewVersionCommand() *cobra.Command { diff --git a/go.mod b/go.mod index 225b9ea..9a248d2 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/open-sauced/pizza-cli +module github.com/open-sauced/pizza-cli/v2 go 1.22 diff --git a/go.sum b/go.sum index ed93523..6fe1896 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,6 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posthog/posthog-go v1.2.19 h1:0udGG2do4LjOzE0D/ik7S3uM2wwFKwzSqswBfdcQ1y4= -github.com/posthog/posthog-go v1.2.19/go.mod h1:uYC2l1Yktc8E+9FAHJ9QZG4vQf/NHJPD800Hsm7DzoM= github.com/posthog/posthog-go v1.2.21 h1:p2ea0l+Qwtk+VC2LCAI87Dz36vwj9i+QHw5s6CpRikA= github.com/posthog/posthog-go v1.2.21/go.mod h1:uYC2l1Yktc8E+9FAHJ9QZG4vQf/NHJPD800Hsm7DzoM= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= diff --git a/main.go b/main.go index 8ceebdf..431581f 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,8 @@ import ( "log" "os" - "github.com/open-sauced/pizza-cli/cmd/root" - "github.com/open-sauced/pizza-cli/pkg/utils" + "github.com/open-sauced/pizza-cli/v2/cmd/root" + "github.com/open-sauced/pizza-cli/v2/pkg/utils" ) func main() { diff --git a/pkg/utils/root.go b/pkg/utils/root.go index fb9369d..9fe8b37 100644 --- a/pkg/utils/root.go +++ b/pkg/utils/root.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/pflag" "golang.org/x/term" - "github.com/open-sauced/pizza-cli/pkg/constants" + "github.com/open-sauced/pizza-cli/v2/pkg/constants" ) // SetupRootCommand is a convenience utility for applying templates and nice diff --git a/telemetry.go b/telemetry.go index 7f2c74a..76beed9 100644 --- a/telemetry.go +++ b/telemetry.go @@ -3,7 +3,7 @@ package main -import "github.com/open-sauced/pizza-cli/pkg/utils" +import "github.com/open-sauced/pizza-cli/v2/pkg/utils" // This alternate main is used as a one-shot for bootstrapping Posthog events: // the various events called herein do not exist in Posthog's datalake until the