-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Crier gerrit reporter authenticate right after orgs/repos update #24236
Conversation
/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()) |
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.
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.
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.
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.
61d7cc1
to
26ef6fb
Compare
[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 |
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.