Skip to content
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

fix: split the collector into collector+extractor #6564

Merged
merged 5 commits into from
Dec 7, 2023
Merged

Conversation

abeizn
Copy link
Contributor

@abeizn abeizn commented Dec 5, 2023

Summary

fix: split the collector into collector+extractor

Does this close any open issues?

Closes #6495

Screenshots

Include any relevant screenshots here.

Other Information

Any other information that is important to this PR.

EntryPoint: CollectAndExtractDeployments,
var CollectDeploymentsMeta = plugin.SubTaskMeta{
Name: "CollectDeployments",
EntryPoint: CollectDeployments,
EnabledByDefault: true,
Description: "collect and extract github deployments to raw and tool layer from GithubGraphql api",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description should be updated too.

return nil, err
}
accounts := apiAccount.Users
results := make([]interface{}, 0, 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var result []interface is more idiomatic.

// ResponseParser's return will be stored to tool layer. So it's called CollectorAndExtractor.
func CollectAndExtractDeployments(taskCtx plugin.SubTaskContext) errors.Error {
func CollectDeployments(taskCtx plugin.SubTaskContext) errors.Error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment in line 87 should be updated too.

githubDeployment, err := convertGithubDeployment(deployment, data.Options.ConnectionId, data.Options.GithubId)
if err != nil {
return nil, err
isFinish := false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can ResponseParser return nil, nil directly?

//Labels: ``, // not on use
//RunnerID: ``, // not on use
//RunnerName: ``, // not on use
//RunnerGroupID: ``, // not on use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think not on use should be not in use.

Name: "CollectPr",
EntryPoint: CollectPr,
var CollectPrsMeta = plugin.SubTaskMeta{
Name: "CollectPrs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this name be conflict with tasks in github/tasks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

@abeizn abeizn merged commit 536a9f0 into main Dec 7, 2023
10 checks passed
@abeizn abeizn deleted the github-graphql-split branch December 7, 2023 02:47
github-actions bot pushed a commit that referenced this pull request Dec 7, 2023
* fix: split the collector into collector+extractor

* fix: impl

* fix: github graphql incremental collector

* fix: lint

* fix: some detail
Copy link

github-actions bot commented Dec 7, 2023

🤖 cherry pick finished successfully 🎉!

@github-actions github-actions bot added the bot/auto-cherry-pick-completed auto cherry pick completed label Dec 7, 2023
abeizn added a commit that referenced this pull request Dec 7, 2023
* fix: split the collector into collector+extractor

* fix: impl

* fix: github graphql incremental collector

* fix: lint

* fix: some detail

Co-authored-by: abeizn <zikuan.an@merico.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants