Skip to content

Commit c5eade6

Browse files
feat(github): Add github_repository_branches table (#10044)
#### Summary This PR addresses #10020 by adding the table `github_repository_branches` containing information retrieved from the `/repos/{owner}/{repo}/branches` and `/repos/{owner}/{repo}/branches/{branch}/protection` endpoints for each repository and branch. - [X] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md) 🧑‍🎓 - [X] Run `make lint` to ensure the proposed changes follow the coding style 🚨 (install golangci-lint [here](https://golangci-lint.run/usage/install/#local-installation)) - [X] Run `make test` to ensure the proposed changes pass the tests 🧪 - [X] If changing a source plugin run `make gen` to ensure docs are up to date 📝 - [X] Ensure the status checks below are successful ✅
1 parent 5b4f219 commit c5eade6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+200
-59
lines changed

plugins/source/github/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/cloudquery/plugin-sdk/schema"
1414
"github.com/cloudquery/plugin-sdk/specs"
1515
"github.com/gofri/go-github-ratelimit/github_ratelimit"
16-
"github.com/google/go-github/v48/github"
16+
"github.com/google/go-github/v49/github"
1717
"github.com/rs/zerolog"
1818
"golang.org/x/oauth2"
1919
)

plugins/source/github/client/mocks/mock_actions.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/github/client/mocks/mock_billing.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/github/client/mocks/mock_dependabot.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/github/client/mocks/mock_issues.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/github/client/mocks/mock_orgs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/github/client/mocks/mock_repositories.go

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/github/client/mocks/mock_teams.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/source/github/client/services.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package client
33
import (
44
"context"
55

6-
"github.com/google/go-github/v48/github"
6+
"github.com/google/go-github/v49/github"
77
)
88

99
type GithubServices struct {
@@ -36,6 +36,8 @@ type BillingService interface {
3636
type RepositoriesService interface {
3737
Get(ctx context.Context, owner, repo string) (*github.Repository, *github.Response, error)
3838
GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error)
39+
GetBranchProtection(ctx context.Context, owner string, repo string, branch string) (*github.Protection, *github.Response, error)
40+
ListBranches(ctx context.Context, owner string, repo string, opts *github.BranchListOptions) ([]*github.Branch, *github.Response, error)
3941
ListByOrg(ctx context.Context, org string, opts *github.RepositoryListByOrgOptions) ([]*github.Repository, *github.Response, error)
4042
ListReleases(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error)
4143
ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *github.ListOptions) ([]*github.ReleaseAsset, *github.Response, error)

plugins/source/github/client/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/cloudquery/plugin-sdk/schema"
1212
"github.com/cloudquery/plugin-sdk/specs"
1313
"github.com/golang/mock/gomock"
14-
"github.com/google/go-github/v48/github"
14+
"github.com/google/go-github/v49/github"
1515
"github.com/rs/zerolog"
1616
)
1717

0 commit comments

Comments
 (0)