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

Prow pubsub: supports presubmit jobs #22777

Merged
merged 2 commits into from
Jul 12, 2021

Conversation

chaodaiG
Copy link
Contributor

@chaodaiG chaodaiG commented Jul 2, 2021

Part of #22764

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 2, 2021
@k8s-ci-robot k8s-ci-robot added area/prow/pubsub Issues or PRs related to prow's pubsub reporter component approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. labels Jul 2, 2021
@chaodaiG
Copy link
Contributor Author

chaodaiG commented Jul 2, 2021

/hold
Soliciting first pass of code review before adding unit tests
/cc @cjwagner @mpherman2
cc @alvaroaleman , not sure whether you care about this component or not

prow/pubsub/subscriber/subscriber.go Outdated Show resolved Hide resolved
prow/pubsub/subscriber/subscriber.go Outdated Show resolved Hide resolved
prow/pubsub/subscriber/subscriber.go Outdated Show resolved Hide resolved
prow/pubsub/subscriber/subscriber.go Outdated Show resolved Hide resolved
@chaodaiG chaodaiG force-pushed the pubsub-presubmit branch 2 times, most recently from dbfa072 to 8fba9dd Compare July 2, 2021 23:30
Copy link
Member

@cjwagner cjwagner left a comment

Choose a reason for hiding this comment

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

Please add some unit tests too.

prow/pubsub/subscriber/subscriber.go Show resolved Hide resolved
prow/pubsub/subscriber/subscriber.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 12, 2021
logrus.WithError(err).Fatal("Error starting secrets agent.")
}
tokenGenerator = secretAgent.GetTokenGenerator(flagOptions.pushSecretFile)
gitClient, err := flagOptions.github.GitClient(secretAgent, flagOptions.dryRun)
Copy link
Member

Choose a reason for hiding this comment

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

Does this couple us to GitHub or does it work with Gerrit as well? We just need a git client so we should probably avoid coupling to GH.

Copy link
Member

Choose a reason for hiding this comment

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

/hold

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This client is for inrepoconfig, which is not supported in gerrit yet. We can change here once inrepoconfig is supported in gerrit

Copy link
Member

Choose a reason for hiding this comment

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

That makes sense, but I'm more wondering how this behaves without GitHub credentials supplied. In subscriber.go@198 we try to use the git client independent of whether we are using GitHub or Gerrit. It seems strange to use a client for a different code review provider when know it won't work and that also seems like it will result in misleading error messages.


Looks like we never try to use the git client until after we've checked if InRepoConfig is enabled for the repo and flag validation should pass if no GitHub flags are supplied so I think this is ok.
/shrug
/hold cancel

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 12, 2021
logrus.WithError(err).Fatal("Error starting secrets agent.")
}
tokenGenerator = secretAgent.GetTokenGenerator(flagOptions.pushSecretFile)
gitClient, err := flagOptions.github.GitClient(secretAgent, flagOptions.dryRun)
Copy link
Member

Choose a reason for hiding this comment

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

That makes sense, but I'm more wondering how this behaves without GitHub credentials supplied. In subscriber.go@198 we try to use the git client independent of whether we are using GitHub or Gerrit. It seems strange to use a client for a different code review provider when know it won't work and that also seems like it will result in misleading error messages.


Looks like we never try to use the git client until after we've checked if InRepoConfig is enabled for the repo and flag validation should pass if no GitHub flags are supplied so I think this is ok.
/shrug
/hold cancel

@k8s-ci-robot k8s-ci-robot added ¯\_(ツ)_/¯ ¯\\\_(ツ)_/¯ and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jul 12, 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 161e384 into kubernetes:master Jul 12, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jul 12, 2021
@chaodaiG chaodaiG deleted the pubsub-presubmit branch July 12, 2021 20:56
listx pushed a commit to listx/test-infra that referenced this pull request Sep 24, 2021
It has been obsolete since kubernetes#22777.
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/pubsub Issues or PRs related to prow's pubsub reporter 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. ¯\_(ツ)_/¯ ¯\\\_(ツ)_/¯
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants