Skip to content

Read Mattermost fix_versions given as a JSON string - #2554

Open
Jean-Regis-M wants to merge 1 commit into
aboutcode-org:mainfrom
Jean-Regis-M:fix/mattermost-json-fix-versions
Open

Jean-Regis-M wants to merge 1 commit into
aboutcode-org:mainfrom
Jean-Regis-M:fix/mattermost-json-fix-versions

Conversation

@Jean-Regis-M

Copy link
Copy Markdown

Fixes #2551

Some Mattermost feed entries now give fix_versions as a JSON string instead of a list. The importer read the whole string as one version, so 21 advisories were stored with no affected package.

The string is now decoded when it starts with [. A broken one is logged and falls through to the old path, so one bad entry does not stop the import.

Checked:

  • New test fails on main and passes here. The Mattermost importer tests: 18 passed.
  • Full import into an empty PostgreSQL: advisories with packages go from 584 to 605 of 610.
  • Only those 21 advisories differ from main (62 fixed versions).

Newer feed entries hold the list as a string, for example
'["12.0","11.11.1"]'. It was treated as a single version, rejected, and
the advisory was stored without any affected package.

Signed-off-by: JEAN REGIS <190766850+Jean-Regis-M@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

mattermost importer stores 21 advisories with no affected package (fix_versions is now a JSON string)

1 participant