Skip to content

bundler:chore - improve tests and code cleaning#925

Merged
matheusalcantarazup merged 1 commit into
mainfrom
bundler-improvements
Jan 19, 2022
Merged

bundler:chore - improve tests and code cleaning#925
matheusalcantarazup merged 1 commit into
mainfrom
bundler-improvements

Conversation

@matheusalcantarazup

Copy link
Copy Markdown
Contributor

This commit add some new asserts on successful parsing bundler results
to verify that all fields of Vulnerability was filled.

Some code organization was also made, and the entities and enum packages
was removed and the bundler schema output was moved to bundler package.

This commit also fix a bug when parsing invalid output from Bundler.
The strings.Split(output, "Name:") on parseOutput return a list with
one element when the split fails, so when Bundler return an output that
is not expected we still try to parse this invalid output which results
invalid vulnerabilities. To fix this a validation was added before the
split to check if output contains the Name: field.

Updates #718

Signed-off-by: Matheus Alcantara [email protected]

- What I did

- How to verify it

- Description for the changelog

Comment thread internal/services/formatters/ruby/bundler/formatter.go
This commit add some new asserts on successful parsing bundler results
to verify that all fields of Vulnerability was filled.

Some code organization was also made, and the entities and enum packages
was removed and the bundler schema output was moved to bundler package.

This commit also fix a bug when parsing invalid output from Bundler.
The `strings.Split(output, "Name:")` on `parseOutput` return a list with
one element when the split fails, so when Bundler return an output that
is not expected we still try to parse this invalid output which results
invalid vulnerabilities. To fix this a validation was added before the
split to check if output contains the `Name:` field.

Updates #718

Signed-off-by: Matheus Alcantara <[email protected]>
@matheusalcantarazup
matheusalcantarazup merged commit 112e82e into main Jan 19, 2022
@matheusalcantarazup
matheusalcantarazup deleted the bundler-improvements branch January 19, 2022 20:26
matheusalcantarazup added a commit that referenced this pull request Jan 21, 2022
This commit add some new asserts on successful parsing bundler results
to verify that all fields of Vulnerability was filled.

Some code organization was also made, and the entities and enum packages
was removed and the bundler schema output was moved to bundler package.

This commit also fix a bug when parsing invalid output from Bundler.
The `strings.Split(output, "Name:")` on `parseOutput` return a list with
one element when the split fails, so when Bundler return an output that
is not expected we still try to parse this invalid output which results
invalid vulnerabilities. To fix this a validation was added before the
split to check if output contains the `Name:` field.

Updates #718

Signed-off-by: Matheus Alcantara <[email protected]>
(cherry picked from commit 112e82e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants