Skip to content

Commit

Permalink
revert unnecessary changes, correct check documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
  • Loading branch information
ashearin committed May 14, 2024
1 parent 3c99ee6 commit ba44f55
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 361 deletions.
6 changes: 3 additions & 3 deletions checks/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestWebhooks(t *testing.T) {
name: "No Webhooks",
uri: "github.com/owner/repo",
expected: checker.CheckResult{
Score: checker.MaxResultScore,
Score: 10,
},
err: nil,
webhooks: []clients.Webhook{},
Expand All @@ -47,7 +47,7 @@ func TestWebhooks(t *testing.T) {
name: "With Webhooks and secret set",
uri: "github.com/owner/repo",
expected: checker.CheckResult{
Score: checker.MaxResultScore,
Score: 10,
},
err: nil,
webhooks: []clients.Webhook{
Expand All @@ -61,7 +61,7 @@ func TestWebhooks(t *testing.T) {
name: "With Webhooks and no secret set",
uri: "github.com/owner/repo",
expected: checker.CheckResult{
Score: checker.MinResultScore,
Score: 0,
},
err: nil,
webhooks: []clients.Webhook{
Expand Down
10 changes: 5 additions & 5 deletions clients/githubrepo/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
)

//nolint:govet
type graphqlMRData struct {
type graphqlData struct {
Repository struct {
IsArchived githubv4.Boolean
Object struct {
Expand Down Expand Up @@ -136,7 +136,7 @@ type graphqlMRData struct {

type graphqlHandler struct {
client *githubv4.Client
data *graphqlMRData
data *graphqlData
setupOnce *sync.Once
ctx context.Context
errSetup error
Expand All @@ -150,7 +150,7 @@ type graphqlHandler struct {
func (handler *graphqlHandler) init(ctx context.Context, repourl *repoURL, commitDepth int) {
handler.ctx = ctx
handler.repourl = repourl
handler.data = new(graphqlMRData)
handler.data = new(graphqlData)
handler.errSetup = nil
handler.setupOnce = new(sync.Once)
handler.commitDepth = commitDepth
Expand Down Expand Up @@ -239,7 +239,7 @@ func (handler *graphqlHandler) isArchived() (bool, error) {
return handler.archived, nil
}

func commitsFrom(data *graphqlMRData, repoOwner, repoName string) ([]clients.Commit, error) {
func commitsFrom(data *graphqlData, repoOwner, repoName string) ([]clients.Commit, error) {
ret := make([]clients.Commit, 0)
for _, commit := range data.Repository.Object.Commit.History.Nodes {
var committer string
Expand Down Expand Up @@ -308,7 +308,7 @@ func commitsFrom(data *graphqlMRData, repoOwner, repoName string) ([]clients.Com
return ret, nil
}

func issuesFrom(data *graphqlMRData) []clients.Issue {
func issuesFrom(data *graphqlData) []clients.Issue {
var ret []clients.Issue
for _, issue := range data.Repository.Issues.Nodes {
var tmpIssue clients.Issue
Expand Down
62 changes: 0 additions & 62 deletions clients/githubrepo/testdata/artifact-matches-response

This file was deleted.

76 changes: 0 additions & 76 deletions clients/githubrepo/testdata/asset-matches-response

This file was deleted.

4 changes: 0 additions & 4 deletions clients/githubrepo/testdata/empty-artifact-response

This file was deleted.

19 changes: 0 additions & 19 deletions clients/githubrepo/testdata/empty-asset-response

This file was deleted.

62 changes: 0 additions & 62 deletions clients/githubrepo/testdata/no-artifact-matches-response

This file was deleted.

76 changes: 0 additions & 76 deletions clients/githubrepo/testdata/no-asset-matches-response

This file was deleted.

Loading

0 comments on commit ba44f55

Please sign in to comment.