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

Checks within the SecurityPolicy checks makes it hard to test #1491

Closed
naveensrinivasan opened this issue Jan 19, 2022 · 3 comments
Closed
Labels
kind/bug Something isn't working needs discussion

Comments

@naveensrinivasan
Copy link
Member

The security policy check instantiates repo client within the check which makes it hard to unit test

dotGitHub := &checker.CheckRequest{
Ctx: c.Ctx,
Dlogger: c.Dlogger,
RepoClient: githubrepo.CreateGithubRepoClient(c.Ctx, logger),
Repo: c.Repo.Org(),
}

@naveensrinivasan naveensrinivasan added kind/bug Something isn't working needs discussion labels Jan 19, 2022
@justaugustus
Copy link
Member

@naveensrinivasan -- my team in Kubernetes Release Engineering maintains a GitHub package, which is pretty well-tested and would allow you to offload this.

Could you look around and see if some of this fits your needs?

https://github.com/kubernetes-sigs/release-sdk/blob/main/github/github.go

@naveensrinivasan
Copy link
Member Author

@justaugustus We already have this capability within the scorecard. We use the GitHub library extensively. It so happens this code doesn't use the right method which makes it hard to write unit tests.

@justaugustus
Copy link
Member

@naveensrinivasan — closing this as discussed in today's meeting that the code path has very likely changed since 2022. Feel free to reopen, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working needs discussion
Projects
Status: Done
Status: Done
Development

No branches or pull requests

2 participants