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

Crier gerrit reporter authenticate right after orgs/repos update #24236

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

chaodaiG
Copy link
Contributor

@chaodaiG chaodaiG commented Nov 4, 2021

Newly added orgs/repos are only authenticated by the goroutine when token secret rotated, which is up to 1 hour after config change. Explicitly call here to get them authenticated immediately.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 4, 2021
@chaodaiG
Copy link
Contributor Author

chaodaiG commented Nov 4, 2021

/cc @cjwagner @michelle192837

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 4, 2021
@k8s-ci-robot k8s-ci-robot requested a review from fejta November 4, 2021 14:09
@k8s-ci-robot k8s-ci-robot added area/prow Issues or PRs related to prow area/prow/crier Issues or PRs related to prow's crier component sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Nov 4, 2021
@chaodaiG
Copy link
Contributor Author

chaodaiG commented Nov 4, 2021

/retest

@@ -106,7 +106,14 @@ func NewReporter(cfg config.Getter, cookiefilePath string, projects map[string][
time.Sleep(time.Second)
continue
}
// Updates clients based on global gerrit config.
gc.UpdateClients(orgReposConfig.AllRepos())
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't look like we respect the global org repo config immediately when NewReporter is called, that happens asynchronously. If we follow the same pattern used by the gerrit adapter (maybe even use the same code) we won't risk transient errors on start up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, updated the code.

use the same code

Technically this could be done by adding this logic in gerrit Client, however it might be an overkill for gerrit Client to understand prow config, so duplicated code instead, which is not too much code anyways

Newly added orgs/repos are only authenticated by the goroutine when token secret rotated, which is up to 1 hour after config change. Explicitly call here to get them authenticated immediately.
@chaodaiG chaodaiG force-pushed the gerrit-crier-auth-always branch from 61d7cc1 to 26ef6fb Compare November 4, 2021 17:30
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 4, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 4, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chaodaiG, cjwagner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit da1e6cb into kubernetes:master Nov 4, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Nov 4, 2021
@chaodaiG chaodaiG deleted the gerrit-crier-auth-always branch November 8, 2021 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow/crier Issues or PRs related to prow's crier component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants