Skip to content

Commit

Permalink
correct issues
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 Mar 6, 2024
1 parent bc11501 commit a43a169
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions checks/raw/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package raw

import (
"fmt"
"io"
"regexp"
"slices"

Expand Down Expand Up @@ -110,13 +111,19 @@ func checkSbomStandard(c *checker.CheckRequest, fileList []string) (*checker.Sbo

standardsFileName := fileList[idx]

contents, err := c.RepoClient.GetFileContent(standardsFileName)
reader, err := c.RepoClient.GetFileReader(standardsFileName)
if err != nil {
return nil, fmt.Errorf("error getting fileContent in checkSbomStandard: %w", err)
return nil, fmt.Errorf("error getting filereader in checkSbomStandard: %w", err)
}

Check warning on line 117 in checks/raw/sbom.go

View check run for this annotation

Codecov / codecov/patch

checks/raw/sbom.go#L112-L117

Added lines #L112 - L117 were not covered by tests

securityInsightsFile := clients.SecurityInsightsSchema{}

contents, err := io.ReadAll(reader)
reader.Close()
if err != nil {
return nil, fmt.Errorf("error getting fileContent in checkSbomStandard: %w", err)
}

Check warning on line 125 in checks/raw/sbom.go

View check run for this annotation

Codecov / codecov/patch

checks/raw/sbom.go#L119-L125

Added lines #L119 - L125 were not covered by tests

err = yaml.Unmarshal(contents, &securityInsightsFile)
if err != nil {
return nil, fmt.Errorf("error parsing security insights file: %w", err)
Expand Down
4 changes: 4 additions & 0 deletions clients/git/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ func (c *Client) ListCheckRunsForRef(ref string) ([]clients.CheckRun, error) {
return nil, clients.ErrUnsupportedFeature
}

func (c *Client) ListSboms() ([]clients.Sbom, error) {
return nil, clients.ErrUnsupportedFeature

Check warning on line 366 in clients/git/client.go

View check run for this annotation

Codecov / codecov/patch

clients/git/client.go#L365-L366

Added lines #L365 - L366 were not covered by tests
}

func (c *Client) ListStatuses(ref string) ([]clients.Status, error) {
return nil, clients.ErrUnsupportedFeature
}
Expand Down

0 comments on commit a43a169

Please sign in to comment.