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

Add GetRepository() to github pkg and RepoIsForkOf() to verify inheritance #1287

Merged
merged 1 commit into from
May 15, 2020

Conversation

puerco
Copy link
Member

@puerco puerco commented May 15, 2020

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR Adds the following features to the github package:

  • It adds a new function GetRepository() to the github package that returns a github.Repository from the GitHub API
  • It adds implementations of this function to the real client, githubNotesRecordClient, githubNotesReplayClient and to the fake client.
  • It implements a new function in the github package called RepoIsForkOf() which verifies that one repo is a fork of another using the github API.
  • Adds tests to github_test.go for said functions

Which issue(s) this PR fixes:

Relates to #834

Special notes for your reviewer:

I've tried to emulate the record/replay functionality by following the patterns found in the code. But I'm not familiar with that feature, please let me know if they are implemented right.

Does this PR introduce a user-facing change?

* Add `RepoIsForkOf()` to check repository inheritance.
* Add `GetRepository()` functions in all clients to get repository data from the GitHub API.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 15, 2020
@k8s-ci-robot k8s-ci-robot added area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. labels May 15, 2020
@puerco puerco force-pushed the github-check-repository branch from 7d68b08 to 4b5b476 Compare May 15, 2020 02:00
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Nice!

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: puerco, saschagrunert

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 added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 15, 2020
@k8s-ci-robot k8s-ci-robot merged commit 464939b into kubernetes:master May 15, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone May 15, 2020
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/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. 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