Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sca): Revert recent SCA changes for Ruby #1679

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading