-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚡ discover assets in parallel #4973
Merged
+212
−102
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
42f0627
:zap: workerpool package to submit parallel requests
afiune 5ae3d75
:zap: fetch org repositories in parallel
afiune 93ca08d
⚙️ add a collector to the workerpool
afiune 4765ace
:rotating_light: fix race conditions
afiune 8c98904
:zap: discover assets in parallel
afiune b3dc6d8
🧪 decrease workerpool wait ticker to 10ms
afiune 17f7beb
🐛 make `DiscoveredAssets.AddError()` thread safe
afiune 842e1e7
:thread: add mutex when running `provider.connect()`
afiune e785c76
Merge branch 'main' of github.com:mondoohq/cnquery into afiune/parall…
afiune e3a58fd
⚙️ reduce the workerpool Task function
afiune 4ffb815
⚙️ return `pool.Result` as a combined struct
afiune 842f60e
🏎️ fix more data race conditions
afiune 8badda7
🤖 Run race detector on CI
afiune ceb2585
⚙️ split plugin connect func and assignation
afiune File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading status checks…
⚡ discover assets in parallel
Signed-off-by: Salim Afiune Maya <[email protected]>
commit 8c989040693f91d4b216995182acafdea1ec5212
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,6 +198,18 @@ | |
"shell", "ssh", "[email protected]", | ||
], | ||
}, | ||
{ | ||
"name": "scan github org", | ||
"type": "go", | ||
"request": "launch", | ||
"program": "${workspaceRoot}/apps/cnquery/cnquery.go", | ||
"args": [ | ||
"scan", | ||
"github", | ||
"org", "hit-training", | ||
"--log-level", "trace" | ||
] | ||
}, | ||
{ | ||
"name": "Configure Built-in Providers", | ||
"type": "go", | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ func NewGithubConnection(id uint32, asset *inventory.Asset) (*GithubConnection, | |
ctx := context.WithValue(context.Background(), github.SleepUntilPrimaryRateLimitResetWhenRateLimited, true) | ||
|
||
// perform a quick call to verify the token's validity. | ||
// @afiune do we need to validate the token for every connection? can this be a "once" operation? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fixed with #4980 |
||
_, resp, err := client.Meta.Zen(ctx) | ||
if err != nil { | ||
if resp != nil && resp.StatusCode == 401 { | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you mean to keep this in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think it is useful for folks testing, specially now that we have https://github.com/hit-training.
I can remove it.