Skip to content

Conversation

@nakabonne
Copy link
Member

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1209

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

TODO

The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use /todo skip command.

Details

1. Control not to reach the rate limit

https://github.com/pipe-cd/pipe/blob/f411dd489899f7ee97efbb06241ad6768dc630b9/pkg/app/piped/imagewatcher/watcher.go#L177-L180

This was created by todo plugin since "TODO:" was found in f411dd4 when #1246 was merged. cc: @nakabonne.

@nakabonne
Copy link
Member Author

/todo skip

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.72%. This pull request does not change code coverage.

err := repo.Pull(ctx, branch)
w.mu.Unlock()
if err != nil {
return nil, fmt.Errorf("failed to update repository branch: %w", err)
Copy link
Member

Choose a reason for hiding this comment

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

nit: "failed to get update from branch" or "failed to pull branch"

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, you're right, thank you!

}
// checkOutdated checks if the image defined in the given target is identical to the one in image provider.
func checkOutdated(ctx context.Context, target config.ImageWatcherTarget, repo git.Repo, provider imageprovider.Provider) (bool, error) {
if provider.Name() != target.Provider {
Copy link
Member

Choose a reason for hiding this comment

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

nit: could you add notes to clarify why do we treat this case as a not outdated image 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

As you feel, it's unclear. gonna update them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated them.
The Run() spawns runners for each image provider, so the checkOutdated function is called in the context for image provider. We should ignore the targets for other providers.

Copy link
Member

Choose a reason for hiding this comment

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

🙆

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.72%. This pull request does not change code coverage.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.72%. This pull request does not change code coverage.

@khanhtc1202
Copy link
Member

Nice 👍
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit 3866f2d into master Dec 14, 2020
@pipecd-bot pipecd-bot deleted the compare-image branch December 14, 2020 06:47
@pipecd-bot pipecd-bot mentioned this pull request Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compares between image repos in the image registry and image repos in git

4 participants