From 5e651e487e33e5b13fa0e9fea4fd754d36513125 Mon Sep 17 00:00:00 2001 From: Spencer Schrock Date: Tue, 2 Jul 2024 16:58:16 -0700 Subject: [PATCH] convert attestor 2 Signed-off-by: Spencer Schrock --- e2e/attestor_policy_test.go | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/e2e/attestor_policy_test.go b/e2e/attestor_policy_test.go index c3c0f2b16f3..04602e6a9b4 100644 --- a/e2e/attestor_policy_test.go +++ b/e2e/attestor_policy_test.go @@ -26,10 +26,8 @@ import ( "github.com/ossf/scorecard/v5/attestor/command" "github.com/ossf/scorecard/v5/attestor/policy" - "github.com/ossf/scorecard/v5/checker" - "github.com/ossf/scorecard/v5/checks" - "github.com/ossf/scorecard/v5/clients" - sclog "github.com/ossf/scorecard/v5/log" + "github.com/ossf/scorecard/v5/clients/githubrepo" + "github.com/ossf/scorecard/v5/internal/checknames" "github.com/ossf/scorecard/v5/pkg" ) @@ -226,27 +224,15 @@ var _ = Describe("E2E TEST PAT: scorecard-attestor policy", func() { func getScorecardResult(repoURL string) (pkg.ScorecardResult, error) { ctx := context.Background() - logger := sclog.NewLogger(sclog.DefaultLevel) - - enabledChecks := map[string]checker.Check{ - checks.CheckBinaryArtifacts: { - Fn: checks.BinaryArtifacts, - }, - checks.CheckVulnerabilities: { - Fn: checks.Vulnerabilities, - }, - checks.CheckCodeReview: { - Fn: checks.CodeReview, - }, - checks.CheckPinnedDependencies: { - Fn: checks.PinningDependencies, - }, + enabledChecks := []string{ + checknames.BinaryArtifacts, + checknames.Vulnerabilities, + checknames.CodeReview, + checknames.PinnedDependencies, } - repo, repoClient, ossFuzzRepoClient, ciiClient, vulnsClient, projectClient, err := checker.GetClients( - ctx, repoURL, "", logger) + repo, err := githubrepo.MakeGithubRepo(repoURL) if err != nil { - return pkg.ScorecardResult{}, fmt.Errorf("couldn't set up clients: %w", err) + return pkg.ScorecardResult{}, fmt.Errorf("couldn't set up repo: %w", err) } - - return pkg.RunScorecard(ctx, repo, clients.HeadSHA, 0, enabledChecks, repoClient, ossFuzzRepoClient, ciiClient, vulnsClient, projectClient) + return pkg.Run(ctx, repo, pkg.WithChecks(enabledChecks)) }