Handle go-project-modules.json file parsing [gemnasium only] [sbomgen-golang only]

What does this MR do?

This MR adds the ability for the Go parser to handle parsing go-project-modules.json files. The Go parser intentionally breaks the dependency inversion principle here to optimize parsing. It assumes that the reader passed in is a file so that it can match the name to the required parsing logic. Without this, the parser would have to first attempt to parse a go-project-modules.json file. If this fails, it would then use the go.sum parser and return an error if one was encountered. This strategy is sub-optimal because it would result in a bigger cpu and memory footprint.

Merge Request Stack

This MR is a member of a merge request stack. A merge request stack groups changes that are related.

  1. Add go toolchain required for go builder [gemna... (!389 - merged)
  2. Create go builder [gemnasium only] (!390 - merged)
  3. Handle go-project-modules.json file parsing [ge... (!391 - merged) You are currently viewing this entry
  4. Add golang builder to gemnasium and sbomgen-gol... (!392 - merged)

What are the relevant issue numbers?

Incorrect usage of go.sum in go dependency scan... (gitlab-org/gitlab#321081 - closed)

Does this MR meet the acceptance criteria?

Edited by Oscar Tovar

Merge request reports

Loading