Skip to content

Commit

Permalink
Fixing lint/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jdslaugh committed Sep 3, 2024
1 parent bb6e7a7 commit 7b46118
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ backend-dev-mock:

.PHONY: backend-lint # Lint the backend code.
backend-lint: preflight-checks-backend
tools/golangci-lint.sh run
tools/golangci-lint.sh run --verbose

.PHONY: backend-lint-fix # Lint and fix the backend code.
backend-lint-fix: preflight-checks-backend
Expand Down
17 changes: 17 additions & 0 deletions backend/mock/service/githubmock/githubmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ func (s svc) CreateCommit(ctx context.Context, ref *github.RemoteRef, message st
}, nil
}

func (s *svc) SearchCode(ctx context.Context, query string, opts *githubv3.SearchOptions) (*githubv3.CodeSearchResult, error) {
var codeResults []*githubv3.CodeResult

codeResults = append(codeResults, &githubv3.CodeResult{
Name: githubv3.String("file.go"),
Path: githubv3.String("path/to/file.go"),
SHA: githubv3.String("2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"),
HTMLURL: githubv3.String("https://github.com/owner/repo/path/to/file.go"),
Repository: nil,
})
return &githubv3.CodeSearchResult{
Total: githubv3.Int(1),
IncompleteResults: githubv3.Bool(false),
CodeResults: codeResults,
}, nil
}

func NewAsService(*any.Any, *zap.Logger, tally.Scope) (service.Service, error) {
return New(), nil
}
2 changes: 0 additions & 2 deletions backend/service/github/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ type v3repositories interface {
CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *githubv3.ListOptions) (*githubv3.CommitsComparison, *githubv3.Response, error)
// GetCommit fetches the specified commit, including all details about it.
GetCommit(ctx context.Context, owner, repo, sha string, opts *githubv3.ListOptions) (*githubv3.RepositoryCommit, *githubv3.Response, error)
// GetBranch gets the specified branch for a repository.
GetBranch(ctx context.Context, owner, repo, branch string, followRedirects bool) (*githubv3.Branch, *githubv3.Response, error)
// DeleteFile deletes a file from a repository and returns the commit.
// Requires the blob SHA of the file to be deleted.
DeleteFile(ctx context.Context, owner, repo, path string, opts *githubv3.RepositoryContentFileOptions) (*githubv3.RepositoryContentResponse, *githubv3.Response, error)
Expand Down

0 comments on commit 7b46118

Please sign in to comment.