feat(github): Add repositories multiplexer#8074
Merged
kodiakhq[bot] merged 4 commits intoFeb 14, 2023
Merged
Conversation
This PR has the following changes to source plugin(s) tables:
|
erezrokah
commented
Feb 14, 2023
| for _, w := range workflows.Workflows { | ||
| res <- Workflow{Workflow: w, Repository: *repo.Name} | ||
| } | ||
| opts.Page = resp.NextPage |
Member
Author
There was a problem hiding this comment.
There was a bug here, this should be actionOpts.Page
erezrokah
commented
Feb 14, 2023
| func buildRepositiories(t *testing.T, ctrl *gomock.Controller) client.GithubServices { | ||
| mock := mocks.NewMockRepositoriesService(ctrl) | ||
|
|
||
| var cs github.Repository |
Member
Author
There was a problem hiding this comment.
Moved to GithubMockTestHelper as needed by the multiplexer
| orgRepos := make(map[string][]*github.Repository) | ||
| for _, org := range orgs { | ||
| for { | ||
| repos, resp, err := client.Repositories.ListByOrg(ctx, org, opts) |
Contributor
There was a problem hiding this comment.
Since we're here.... it would be really nice if this also supported personal accounts, not just orgs 😄
But happy to leave that for a future update also
Member
Author
There was a problem hiding this comment.
Yeah, I think it's another feature, as our spec says orgs and we'll need to verify the API calls in all the resources (I think not all GitHub APIs are supported for personal accounts)
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
kodiakhq Bot
pushed a commit
that referenced
this pull request
Feb 21, 2023
🤖 I have created a release *beep* *boop* --- ## [4.0.0](plugins-source-github-v3.0.1...plugins-source-github-v4.0.0) (2023-02-21) ### ⚠ BREAKING CHANGES * **github:** Remove `repository` column from `github_workflows` * **github:** Change `github_organization_dependabot_alerts` PK from `(org,number)` to `(org,html_url)` ([#8070](#8070)) ### Features * **github-resources:** Add Traffic resources ([#8085](#8085)) ([cc22f56](cc22f56)) * **github:** Add repositories multiplexer ([#8074](#8074)) ([f5f874d](f5f874d)) * **github:** Handle secondary rate limit ([#8078](#8078)) ([bf1f1cc](bf1f1cc)) * **github:** Remove `repository` column from `github_workflows` ([21905a4](21905a4)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.38.2 ([#8156](#8156)) ([ac2d2d7](ac2d2d7)) * **deps:** Update module golang.org/x/net to v0.7.0 [SECURITY] ([#8176](#8176)) ([fc4cef8](fc4cef8)) * **github:** Add `repository_id` to `github_workflows` PK ([21905a4](21905a4)) * **github:** Change `github_organization_dependabot_alerts` PK from `(org,number)` to `(org,html_url)` ([#8070](#8070)) ([a7c64cd](a7c64cd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A first step for implementing #6247.
The APIs in that issue require passing a repository. We already list those twice for
github_workflowsandgithub_repositoriesso I think it's time to add a multiplexer