From fa9808a1ee59440c02f18251a3bca1f96a4affb4 Mon Sep 17 00:00:00 2001 From: Kin NG <59541661+k1nho@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:43:00 -0500 Subject: [PATCH 1/8] add sort capabilities to user contributions (#65) --- cmd/insights/user-contributions.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cmd/insights/user-contributions.go b/cmd/insights/user-contributions.go index 4fb2171..4ea03b6 100644 --- a/cmd/insights/user-contributions.go +++ b/cmd/insights/user-contributions.go @@ -6,6 +6,7 @@ import ( "encoding/csv" "errors" "fmt" + "sort" "strconv" "sync" @@ -38,6 +39,9 @@ type userContributionsOptions struct { // Output is the formatting style for command output Output string + + // Sort is the column to be used to sort user contributions (total, commits, pr, none) + Sort string } // NewUserContributionsCommand returns a new user-contributions command @@ -68,6 +72,7 @@ func NewUserContributionsCommand() *cobra.Command { cmd.Flags().StringVarP(&opts.FilePath, constants.FlagNameFile, "f", "", "Path to yaml file containing an array of git repository urls") cmd.Flags().Int32VarP(&opts.Period, constants.FlagNamePeriod, "p", 30, "Number of days, used for query filtering") cmd.Flags().StringSliceVarP(&opts.Users, "users", "u", []string{}, "Inclusive comma separated list of GitHub usernames to filter for") + cmd.Flags().StringVarP(&opts.Sort, "sort", "s", "none", "Sort user contributions by (total, commits, prs)") return cmd } @@ -130,6 +135,10 @@ func (opts *userContributionsOptions) run(ctx context.Context) error { return allErrors } + if opts.Sort != "none" { + sortUserContributions(insights, opts.Sort) + } + for _, insight := range insights { output, err := insight.BuildOutput(opts.Output) if err != nil { @@ -283,3 +292,21 @@ func findAllUserContributionsInsights(ctx context.Context, opts *userContributio return repoUserContributionsInsightGroup, nil } + +func sortUserContributions(ucig []*userContributionsInsightGroup, sortBy string) { + for _, group := range ucig { + if group != nil { + sort.SliceStable(group.Insights, func(i, j int) bool { + switch sortBy { + case "total": + return group.Insights[i].TotalContributions > group.Insights[j].TotalContributions + case "prs": + return group.Insights[i].PrsCreated > group.Insights[j].PrsCreated + case "commits": + return group.Insights[i].Commits > group.Insights[j].Commits + } + return group.Insights[i].Login < group.Insights[j].Login + }) + } + } +} From cc214ccd74bd9c8732a9ab2114db98feb265dbb0 Mon Sep 17 00:00:00 2001 From: Kin NG <59541661+k1nho@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:21:31 -0500 Subject: [PATCH 2/8] validate range value (#67) --- cmd/insights/contributors.go | 6 +++++- pkg/api/validation.go | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 pkg/api/validation.go diff --git a/cmd/insights/contributors.go b/cmd/insights/contributors.go index 4757dc1..fab046f 100644 --- a/cmd/insights/contributors.go +++ b/cmd/insights/contributors.go @@ -59,11 +59,15 @@ func NewContributorsCommand() *cobra.Command { }, } cmd.Flags().StringVarP(&opts.FilePath, constants.FlagNameFile, "f", "", "Path to yaml file containing an array of git repository urls") - cmd.Flags().Int32VarP(&opts.Period, constants.FlagNamePeriod, "p", 30, "Number of days, used for query filtering") + cmd.Flags().Int32VarP(&opts.Period, constants.FlagNamePeriod, "p", 30, "Number of days, used for query filtering (7,30,90)") return cmd } func (opts *contributorsOptions) run(ctx context.Context) error { + if !api.IsValidRange(opts.Period) { + return fmt.Errorf("invalid period: %d, accepts (7,30,90)", opts.Period) + } + repositories, err := utils.HandleRepositoryValues(opts.Repos, opts.FilePath) if err != nil { return err diff --git a/pkg/api/validation.go b/pkg/api/validation.go new file mode 100644 index 0000000..6236ac5 --- /dev/null +++ b/pkg/api/validation.go @@ -0,0 +1,5 @@ +package api + +func IsValidRange(period int32) bool { + return period == 7 || period == 30 || period == 90 +} From 02177d5c81c330385f4f73c5d5f2df045c96757e Mon Sep 17 00:00:00 2001 From: John McBride Date: Wed, 29 Nov 2023 13:17:11 -0700 Subject: [PATCH 3/8] fix: Force publish of package to build go binaries during release (#69) Signed-off-by: John McBride --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 958c6c1..f7c9204 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -37,6 +37,9 @@ jobs: - name: "🚀 release" id: semantic-release env: + # This ensures that publishing happens on every single trigger which then + # forces the go binaries to be built in the next step and attached to the GitHub release + FORCE_PUBLISH: "patch" GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_PACKAGE_ROOT: "npm" From ae5a165ed871301b38b2a77ab73463c034c79c47 Mon Sep 17 00:00:00 2001 From: John McBride Date: Wed, 29 Nov 2023 20:17:45 +0000 Subject: [PATCH 4/8] chore(patch): release 1.1.1-beta.1 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.1.1-beta.1](https://github.com/open-sauced/pizza-cli/compare/v1.1.0...v1.1.1-beta.1) (2023-11-29) ### 🐛 Bug Fixes * Force publish of package to build go binaries during release ([#69](https://github.com/open-sauced/pizza-cli/issues/69)) ([02177d5](https://github.com/open-sauced/pizza-cli/commit/02177d5c81c330385f4f73c5d5f2df045c96757e)) --- CHANGELOG.md | 7 +++++++ npm/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14838e9..592fbed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ > All notable changes to this project will be documented in this file +## [1.1.1-beta.1](https://github.com/open-sauced/pizza-cli/compare/v1.1.0...v1.1.1-beta.1) (2023-11-29) + + +### 🐛 Bug Fixes + +* Force publish of package to build go binaries during release ([#69](https://github.com/open-sauced/pizza-cli/issues/69)) ([02177d5](https://github.com/open-sauced/pizza-cli/commit/02177d5c81c330385f4f73c5d5f2df045c96757e)) + ## [1.1.0](https://github.com/open-sauced/pizza-cli/compare/v1.0.1...v1.1.0) (2023-10-26) diff --git a/npm/package.json b/npm/package.json index 14419c1..906aa08 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "pizza", - "version": "1.1.0", + "version": "1.1.1-beta.1", "description": "A command line utility for insights, metrics, and all things OpenSauced", "repository": "https://github.com/open-sauced/pizza-cli", "license": "MIT", From f6d2f1d11bda7760edf585279099f3a874661973 Mon Sep 17 00:00:00 2001 From: dtemir Date: Sat, 3 Feb 2024 17:28:33 -0600 Subject: [PATCH 5/8] fix: avoid requiring CGO for now (#71) --- .github/workflows/release.yaml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f7c9204..1af6ad4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -72,7 +72,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \ + CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build \ -ldflags="-s -w" \ -ldflags="-X 'github.com/open-sauced/pizza-cli/pkg/utils.writeOnlyPublicPosthogKey=${{ vars.POSTHOG_WRITE_PUBLIC_KEY }}'" \ -ldflags="-X 'github.com/open-sauced/pizza-cli/pkg/utils.Version=${{ needs.release.outputs.release-tag }}'" \ diff --git a/Makefile b/Makefile index c1da7b6..cb0873f 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ test: go test ./... build: - go build -o build/pizza main.go + CGO_ENABLED=0 go build -o build/pizza main.go install: build sudo mv build/pizza /usr/local/bin/ From 96f93a33a858d51ddb281c5b0caedf113e61f65a Mon Sep 17 00:00:00 2001 From: dtemir Date: Sat, 3 Feb 2024 23:29:07 +0000 Subject: [PATCH 6/8] chore(patch): release 1.1.1-beta.2 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.1.1-beta.2](https://github.com/open-sauced/pizza-cli/compare/v1.1.1-beta.1...v1.1.1-beta.2) (2024-02-03) ### 🐛 Bug Fixes * avoid requiring CGO for now ([#71](https://github.com/open-sauced/pizza-cli/issues/71)) ([f6d2f1d](https://github.com/open-sauced/pizza-cli/commit/f6d2f1d11bda7760edf585279099f3a874661973)) --- CHANGELOG.md | 7 +++++++ npm/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 592fbed..0fc406f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ > All notable changes to this project will be documented in this file +## [1.1.1-beta.2](https://github.com/open-sauced/pizza-cli/compare/v1.1.1-beta.1...v1.1.1-beta.2) (2024-02-03) + + +### 🐛 Bug Fixes + +* avoid requiring CGO for now ([#71](https://github.com/open-sauced/pizza-cli/issues/71)) ([f6d2f1d](https://github.com/open-sauced/pizza-cli/commit/f6d2f1d11bda7760edf585279099f3a874661973)) + ## [1.1.1-beta.1](https://github.com/open-sauced/pizza-cli/compare/v1.1.0...v1.1.1-beta.1) (2023-11-29) diff --git a/npm/package.json b/npm/package.json index 906aa08..e8a2287 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "pizza", - "version": "1.1.1-beta.1", + "version": "1.1.1-beta.2", "description": "A command line utility for insights, metrics, and all things OpenSauced", "repository": "https://github.com/open-sauced/pizza-cli", "license": "MIT", From 40b468be69bdffb1fa7170861abf98601acb6c68 Mon Sep 17 00:00:00 2001 From: John McBride Date: Mon, 5 Feb 2024 09:50:54 -0700 Subject: [PATCH 7/8] fix: Upgrade to v2 API (#73) Signed-off-by: John McBride --- cmd/insights/contributors.go | 32 +++++++++++++++--------------- cmd/insights/repositories.go | 20 +++++++++---------- cmd/insights/user-contributions.go | 8 ++++---- cmd/show/contributors.go | 18 ++++++++--------- cmd/show/dashboard.go | 4 ++-- go.mod | 2 +- go.sum | 4 ++++ 7 files changed, 46 insertions(+), 42 deletions(-) diff --git a/cmd/insights/contributors.go b/cmd/insights/contributors.go index fab046f..e9f2dd5 100644 --- a/cmd/insights/contributors.go +++ b/cmd/insights/contributors.go @@ -228,7 +228,7 @@ func findAllContributorsInsights(ctx context.Context, opts *contributorsOptions, waitGroup.Add(1) go func() { defer waitGroup.Done() - response, err := findNewRepositoryContributors(ctx, opts.APIClient, repo.Id, opts.Period) + response, err := findNewRepositoryContributors(ctx, opts.APIClient, repo.Name, opts.Period) if err != nil { errorChan <- err return @@ -240,7 +240,7 @@ func findAllContributorsInsights(ctx context.Context, opts *contributorsOptions, waitGroup.Add(1) go func() { defer waitGroup.Done() - response, err := findRecentRepositoryContributors(ctx, opts.APIClient, repo.Id, opts.Period) + response, err := findRecentRepositoryContributors(ctx, opts.APIClient, repo.Name, opts.Period) if err != nil { errorChan <- err return @@ -252,7 +252,7 @@ func findAllContributorsInsights(ctx context.Context, opts *contributorsOptions, waitGroup.Add(1) go func() { defer waitGroup.Done() - response, err := findAlumniRepositoryContributors(ctx, opts.APIClient, repo.Id, opts.Period) + response, err := findAlumniRepositoryContributors(ctx, opts.APIClient, repo.Name, opts.Period) if err != nil { errorChan <- err return @@ -264,7 +264,7 @@ func findAllContributorsInsights(ctx context.Context, opts *contributorsOptions, waitGroup.Add(1) go func() { defer waitGroup.Done() - response, err := findRepeatRepositoryContributors(ctx, opts.APIClient, repo.Id, opts.Period) + response, err := findRepeatRepositoryContributors(ctx, opts.APIClient, repo.Name, opts.Period) if err != nil { errorChan <- err return @@ -285,50 +285,50 @@ func findAllContributorsInsights(ctx context.Context, opts *contributorsOptions, return repoContributorsInsights, nil } -func findNewRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repoID, period int32) (*client.SearchAllPullRequestContributors200Response, error) { +func findNewRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repo string, period int32) (*client.SearchAllPullRequestContributors200Response, error) { data, _, err := apiClient.ContributorsServiceAPI. NewPullRequestContributors(ctx). - RepoIds(fmt.Sprintf("%d", repoID)). + Repos(repo). Range_(period). Execute() if err != nil { - return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.NewPullRequestContributors' with repository %d': %w", repoID, err) + return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.NewPullRequestContributors' with repository %s': %w", repo, err) } return data, nil } -func findRecentRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repoID, period int32) (*client.SearchAllPullRequestContributors200Response, error) { +func findRecentRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repo string, period int32) (*client.SearchAllPullRequestContributors200Response, error) { data, _, err := apiClient.ContributorsServiceAPI. FindAllRecentPullRequestContributors(ctx). - RepoIds(fmt.Sprintf("%d", repoID)). + Repos(repo). Range_(period). Execute() if err != nil { - return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.FindAllRecentPullRequestContributors' with repository %d': %w", repoID, err) + return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.FindAllRecentPullRequestContributors' with repository %s': %w", repo, err) } return data, nil } -func findAlumniRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repoID, period int32) (*client.SearchAllPullRequestContributors200Response, error) { +func findAlumniRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repo string, period int32) (*client.SearchAllPullRequestContributors200Response, error) { data, _, err := apiClient.ContributorsServiceAPI. FindAllChurnPullRequestContributors(ctx). - RepoIds(fmt.Sprintf("%d", repoID)). + Repos(repo). Range_(period). Execute() if err != nil { - return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.FindAllChurnPullRequestContributors' with repository %d': %w", repoID, err) + return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.FindAllChurnPullRequestContributors' with repository %s': %w", repo, err) } return data, nil } -func findRepeatRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repoID, period int32) (*client.SearchAllPullRequestContributors200Response, error) { +func findRepeatRepositoryContributors(ctx context.Context, apiClient *client.APIClient, repo string, period int32) (*client.SearchAllPullRequestContributors200Response, error) { data, _, err := apiClient.ContributorsServiceAPI. FindAllRepeatPullRequestContributors(ctx). - RepoIds(fmt.Sprintf("%d", repoID)). + Repos(repo). Range_(period). Execute() if err != nil { - return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.FindAllRepeatPullRequestContributors' with repository %d: %w", repoID, err) + return nil, fmt.Errorf("error while calling 'ContributorsServiceAPI.FindAllRepeatPullRequestContributors' with repository %s: %w", repo, err) } return data, nil } diff --git a/cmd/insights/repositories.go b/cmd/insights/repositories.go index b93568f..cb03509 100644 --- a/cmd/insights/repositories.go +++ b/cmd/insights/repositories.go @@ -197,12 +197,12 @@ func findAllRepositoryInsights(ctx context.Context, opts *repositoriesOptions, r waitGroup.Add(1) go func() { defer waitGroup.Done() - response, err := getPullRequestInsights(ctx, opts.APIClient, repo.Id, opts.Period) + response, err := getPullRequestInsights(ctx, opts.APIClient, repo.Name, opts.Period) if err != nil { errorChan <- err return } - repoInsights.AllPullRequests = int(response.AllPrs) + repoInsights.AllPullRequests = int(response.PrCount) repoInsights.AcceptedPullRequests = int(response.AcceptedPrs) repoInsights.SpamPullRequests = int(response.SpamPrs) }() @@ -232,19 +232,19 @@ func findAllRepositoryInsights(ctx context.Context, opts *repositoriesOptions, r return repoInsights, nil } -func getPullRequestInsights(ctx context.Context, apiClient *client.APIClient, repoID, period int32) (*client.DbPRInsight, error) { - data, _, err := apiClient.PullRequestsServiceAPI. - GetPullRequestInsights(ctx). - RepoIds(strconv.Itoa(int(repoID))). +func getPullRequestInsights(ctx context.Context, apiClient *client.APIClient, repo string, period int32) (*client.DbPullRequestGitHubEventsHistogram, error) { + data, _, err := apiClient.HistogramGenerationServiceAPI. + PrsHistogram(ctx). + Repo(repo). Execute() if err != nil { - return nil, fmt.Errorf("error while calling 'PullRequestsServiceAPI.GetPullRequestInsights' with repository %d': %w", repoID, err) + return nil, fmt.Errorf("error while calling 'PullRequestsServiceAPI.GetPullRequestInsights' with repository %s': %w", repo, err) } - index := slices.IndexFunc(data, func(insight client.DbPRInsight) bool { - return insight.Interval == period + index := slices.IndexFunc(data, func(prHisto client.DbPullRequestGitHubEventsHistogram) bool { + return int32(prHisto.Bucket.Unix()) == period }) if index == -1 { - return nil, fmt.Errorf("could not find pull request insights for repository %d with interval %d", repoID, period) + return nil, fmt.Errorf("could not find pull request insights for repository %s with interval %d", repo, period) } return &data[index], nil } diff --git a/cmd/insights/user-contributions.go b/cmd/insights/user-contributions.go index 4ea03b6..4f6e312 100644 --- a/cmd/insights/user-contributions.go +++ b/cmd/insights/user-contributions.go @@ -270,7 +270,7 @@ func findAllUserContributionsInsights(ctx context.Context, opts *userContributio dataPoints, _, err := opts. APIClient. RepositoryServiceAPI. - FindAllContributorsByRepoId(ctx, owner, name). + FindContributorsByOwnerAndRepo(ctx, owner, name). Range_(opts.Period). Execute() @@ -278,11 +278,11 @@ func findAllUserContributionsInsights(ctx context.Context, opts *userContributio return nil, fmt.Errorf("error while calling 'RepositoryServiceAPI.FindAllContributorsByRepoId' with repository %s/%s': %w", owner, name, err) } - for _, data := range dataPoints { - _, ok := opts.usersMap[*data.Login] + for _, data := range dataPoints.Data { + _, ok := opts.usersMap[data.Login] if len(opts.usersMap) == 0 || ok { repoUserContributionsInsightGroup.Insights = append(repoUserContributionsInsightGroup.Insights, userContributionsInsights{ - Login: *data.Login, + Login: data.Login, Commits: int(data.Commits), PrsCreated: int(data.PrsCreated), TotalContributions: int(data.Commits) + int(data.PrsCreated), diff --git a/cmd/show/contributors.go b/cmd/show/contributors.go index e021b2f..7e198cf 100644 --- a/cmd/show/contributors.go +++ b/cmd/show/contributors.go @@ -17,12 +17,12 @@ import ( ) // prItem: type for pull request to satisfy the list.Item interface -type prItem client.DbPullRequest +type prItem client.DbPullRequestGitHubEvents -func (i prItem) FilterValue() string { return i.Title } +func (i prItem) FilterValue() string { return i.PrTitle } func (i prItem) GetRepoName() string { - if i.FullName != nil { - return *i.FullName + if i.RepoName != "" { + return i.RepoName } return "" } @@ -38,12 +38,12 @@ func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list return } - prTitle := i.Title + prTitle := i.PrTitle if len(prTitle) >= 60 { prTitle = fmt.Sprintf("%s...", prTitle[:60]) } - str := fmt.Sprintf("#%d %s\n%s\n(%s)", i.Number, i.GetRepoName(), prTitle, i.State) + str := fmt.Sprintf("#%d %s\n%s\n(%s)", i.PrNumber, i.GetRepoName(), prTitle, i.PrState) fn := ItemStyle.Render if index == m.Index() { @@ -114,7 +114,7 @@ func (m ContributorModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if !m.prList.SettingFilter() { pr, ok := m.prList.SelectedItem().(prItem) if ok { - err := browser.OpenURL(fmt.Sprintf("https://github.com/%s/pull/%d", pr.GetRepoName(), pr.Number)) + err := browser.OpenURL(fmt.Sprintf("https://github.com/%s/pull/%d", pr.GetRepoName(), pr.PrNumber)) if err != nil { fmt.Println("could not open pull request in browser") } @@ -191,7 +191,7 @@ func (m *ContributorModel) fetchContributorInfo(name string) error { // fetchContributorPRs: fetches the contributor pull requests and creates pull request list func (m *ContributorModel) fetchContributorPRs(name string) error { - resp, r, err := m.APIClient.UserServiceAPI.FindContributorPullRequests(m.serverContext, name).Range_(30).Execute() + resp, r, err := m.APIClient.UserServiceAPI.FindContributorPullRequestGitHubEvents(m.serverContext, name).Range_(30).Execute() if err != nil { return err } @@ -204,7 +204,7 @@ func (m *ContributorModel) fetchContributorPRs(name string) error { var items []list.Item var mergedPullRequests int for _, pr := range resp.Data { - if strings.ToLower(pr.State) == "merged" { + if pr.PrIsMerged { mergedPullRequests++ } items = append(items, prItem(pr)) diff --git a/cmd/show/dashboard.go b/cmd/show/dashboard.go index 14efb55..92dece7 100644 --- a/cmd/show/dashboard.go +++ b/cmd/show/dashboard.go @@ -264,7 +264,7 @@ func (m *DashboardModel) FetchAllContributors() error { // FetchNewContributors: Returns all the new contributors func (m *DashboardModel) FetchNewContributors() ([]client.DbPullRequestContributor, error) { resp, r, err := m.APIClient.ContributorsServiceAPI.NewPullRequestContributors(m.serverContext).Page(int32(m.queryOptions[0])). - Limit(int32(m.queryOptions[1])).RepoIds(strconv.Itoa(int(m.RepositoryInfo.Id))).Execute() + Limit(int32(m.queryOptions[1])).Repos(m.RepositoryInfo.FullName).Execute() if err != nil { return nil, err } @@ -281,7 +281,7 @@ func (m *DashboardModel) FetchNewContributors() ([]client.DbPullRequestContribut func (m *DashboardModel) FetchAlumniContributors() ([]client.DbPullRequestContributor, error) { resp, r, err := m.APIClient.ContributorsServiceAPI.FindAllChurnPullRequestContributors(m.serverContext). Page(int32(m.queryOptions[0])).Limit(int32(m.queryOptions[1])). - Range_(int32(m.queryOptions[2])).RepoIds(strconv.Itoa(int(m.RepositoryInfo.Id))).Execute() + Range_(int32(m.queryOptions[2])).Repos(m.RepositoryInfo.FullName).Execute() if err != nil { return nil, err } diff --git a/go.mod b/go.mod index 12817ed..0445ee7 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/charmbracelet/bubbletea v0.24.2 github.com/charmbracelet/lipgloss v0.9.1 github.com/cli/browser v1.3.0 - github.com/open-sauced/go-api/client v0.0.0-20231025234817-a8f01f3b26d8 + github.com/open-sauced/go-api/client v0.0.0-20240205155059-a3159bc0517e github.com/posthog/posthog-go v0.0.0-20230801140217-d607812dee69 github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 9e024aa..628dc94 100644 --- a/go.sum +++ b/go.sum @@ -47,6 +47,10 @@ github.com/open-sauced/go-api/client v0.0.0-20231024233005-61e58f577005 h1:qrsKq github.com/open-sauced/go-api/client v0.0.0-20231024233005-61e58f577005/go.mod h1:W/TRuLUqYpMvkmElDUQvQ07xlxhK8TOfpwRh8SCAuNA= github.com/open-sauced/go-api/client v0.0.0-20231025234817-a8f01f3b26d8 h1:qzSaxN4BdovOr2DjXcYJz4LH7RSXEdhw98zAdnJVqJU= github.com/open-sauced/go-api/client v0.0.0-20231025234817-a8f01f3b26d8/go.mod h1:W/TRuLUqYpMvkmElDUQvQ07xlxhK8TOfpwRh8SCAuNA= +github.com/open-sauced/go-api/client v0.0.0-20240202223515-f3f8157b083d h1:e9c07oVveXyHHhcu85hKHicl2K+ruAcAXX5BUd4StO8= +github.com/open-sauced/go-api/client v0.0.0-20240202223515-f3f8157b083d/go.mod h1:W/TRuLUqYpMvkmElDUQvQ07xlxhK8TOfpwRh8SCAuNA= +github.com/open-sauced/go-api/client v0.0.0-20240205155059-a3159bc0517e h1:3j5r7ArokAO+u8vhgQPklp5qnGxA+MkXluRYt2qTnik= +github.com/open-sauced/go-api/client v0.0.0-20240205155059-a3159bc0517e/go.mod h1:W/TRuLUqYpMvkmElDUQvQ07xlxhK8TOfpwRh8SCAuNA= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posthog/posthog-go v0.0.0-20230801140217-d607812dee69 h1:01dHVodha5BzrMtVmcpPeA4VYbZEsTXQ6m4123zQXJk= github.com/posthog/posthog-go v0.0.0-20230801140217-d607812dee69/go.mod h1:migYMxlAqcnQy+3eN8mcL0b2tpKy6R+8Zc0lxwk4dKM= From fbf424feb9243d203367d354df681e41f1bee2f9 Mon Sep 17 00:00:00 2001 From: John McBride Date: Mon, 5 Feb 2024 16:51:28 +0000 Subject: [PATCH 8/8] chore(patch): release 1.1.1-beta.3 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.1.1-beta.3](https://github.com/open-sauced/pizza-cli/compare/v1.1.1-beta.2...v1.1.1-beta.3) (2024-02-05) ### 🐛 Bug Fixes * Upgrade to v2 API ([#73](https://github.com/open-sauced/pizza-cli/issues/73)) ([40b468b](https://github.com/open-sauced/pizza-cli/commit/40b468be69bdffb1fa7170861abf98601acb6c68)) --- CHANGELOG.md | 7 +++++++ npm/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fc406f..fef2902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ > All notable changes to this project will be documented in this file +## [1.1.1-beta.3](https://github.com/open-sauced/pizza-cli/compare/v1.1.1-beta.2...v1.1.1-beta.3) (2024-02-05) + + +### 🐛 Bug Fixes + +* Upgrade to v2 API ([#73](https://github.com/open-sauced/pizza-cli/issues/73)) ([40b468b](https://github.com/open-sauced/pizza-cli/commit/40b468be69bdffb1fa7170861abf98601acb6c68)) + ## [1.1.1-beta.2](https://github.com/open-sauced/pizza-cli/compare/v1.1.1-beta.1...v1.1.1-beta.2) (2024-02-03) diff --git a/npm/package.json b/npm/package.json index e8a2287..f725c75 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,6 +1,6 @@ { "name": "pizza", - "version": "1.1.1-beta.2", + "version": "1.1.1-beta.3", "description": "A command line utility for insights, metrics, and all things OpenSauced", "repository": "https://github.com/open-sauced/pizza-cli", "license": "MIT",