Skip to content

Commit

Permalink
Merge pull request #1679 from chainguard-dev/revert-ruby-sca
Browse files Browse the repository at this point in the history
fix(sca): Revert recent SCA changes for Ruby
  • Loading branch information
EyeCantCU authored Dec 7, 2024
2 parents b5d4d74 + 012ff8d commit e788406
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/sca/sca.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ func generatePythonDeps(ctx context.Context, hdl SCAHandle, generated *config.De
return nil
}

// generateRubyDeps generates a ruby-X.Y-base dependency for packages which ship
// generateRubyDeps generates a ruby-X.Y dependency for packages which ship
// Ruby gems.
func generateRubyDeps(ctx context.Context, hdl SCAHandle, generated *config.Dependencies) error {
log := clog.FromContext(ctx)
Expand Down Expand Up @@ -590,8 +590,8 @@ func generateRubyDeps(ctx context.Context, hdl SCAHandle, generated *config.Depe
}
}

log.Infof(" found ruby gem, generating ruby-%s-base dependency", rubyGemVer)
generated.Runtime = append(generated.Runtime, fmt.Sprintf("ruby-%s-base", rubyGemVer))
log.Infof(" found ruby gem, generating ruby-%s dependency", rubyGemVer)
generated.Runtime = append(generated.Runtime, fmt.Sprintf("ruby-%s", rubyGemVer))

return nil
}
Expand Down Expand Up @@ -669,7 +669,7 @@ func sonameLibver(soname string) string {
func getShbang(fp io.Reader) (string, error) {
// python3 and sh are symlinks and generateCmdProviders currently only considers
// regular files. Since nothing will fulfill such a depend, do not generate one.
ignores := map[string]bool{"python3": true, "python": true, "ruby": true, "sh": true, "awk": true}
ignores := map[string]bool{"python3": true, "python": true, "sh": true, "awk": true}

buf := make([]byte, 80)
blen, err := io.ReadFull(fp, buf)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sca/sca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestRubySca(t *testing.T) {
t.Fatal(err)
}

want := config.Dependencies{Runtime: []string{"ruby-3.2-base"}}
want := config.Dependencies{Runtime: []string{"ruby-3.2"}}

if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("Analyze(): (-want, +got):\n%s", diff)
Expand Down

0 comments on commit e788406

Please sign in to comment.