Skip to content

feat(parser): set fix_available on GitHub Vulnerability parser#14943

Open
jsayerascb wants to merge 1 commit into
DefectDojo:devfrom
jsayerascb:feat/github-vuln-parser-fix-available
Open

feat(parser): set fix_available on GitHub Vulnerability parser#14943
jsayerascb wants to merge 1 commit into
DefectDojo:devfrom
jsayerascb:feat/github-vuln-parser-fix-available

Conversation

@jsayerascb
Copy link
Copy Markdown

Populate fix_available from firstPatchedVersion in the GraphQL response.

⚠️ Pre-Approval check ⚠️

We don't want to waste your time, so if you're unsure whether your hypothetical enhancement meets the criteria for approval, please file an issue to get pre-approval before beginning work on a PR.
Learn more here: https://github.com/DefectDojo/django-DefectDojo/blob/master/readme-docs/CONTRIBUTING.md#submission-pre-approval

Description

Populate fix_available from firstPatchedVersion in the GraphQL response.

Test results

Unit tests added

test_parser_version (existing test, extended):

  • Asserts finding.fix_available == True when the GraphQL response contains "firstPatchedVersion": {"identifier": "6.0.0"}

test_parse_no_fix_available (new test):

  • Uses new fixture github-1-vuln-no-fix.json with "firstPatchedVersion": null
  • Asserts finding.fix_available == False
  • Also validates title, severity, component_name, and component_version are parsed correctly

Edge cases verified manually

  • firstPatchedVersion key missing entirely from the response → fix_available = False
  • Existing test fixtures (5-vuln, search, h2, shiro, etc.) still parse without errors

Documentation

Please update any documentation when needed in the documentation folder)

Checklist

This checklist is for your information.

  • Make sure to rebase your PR against the very latest dev.
  • Features/Changes should be submitted against the dev.
  • Bugfixes should be submitted against the bugfix branch.
  • Give a meaningful name to your PR, as it may end up being used in the release notes.
  • Your code is Ruff compliant (see ruff.toml).
  • Your code is python 3.13 compliant.
  • If this is a new feature and not a bug fix, you've included the proper documentation in the docs at https://github.com/DefectDojo/django-DefectDojo/tree/dev/docs as part of this PR.
  • Model changes must include the necessary migrations in the dojo/db_migrations folder.
  • Add applicable tests to the unit tests.
  • Add the proper label to categorize your PR.

Extra information

Please clear everything below when submitting your pull request, it's here purely for your information.

Moderators: Labels currently accepted for PRs:

  • Import Scans (for new scanners/importers)
  • enhancement
  • performance
  • feature
  • bugfix
  • maintenance (a.k.a chores)
  • dependencies
  • New Migration (when the PR introduces a DB migration)
  • settings_changes (when the PR introduces changes or new settings in settings.dist.py)

Contributors: Git Tips

Rebase on dev branch

If the dev branch has changed since you started working on it, please rebase your work after the current dev.

On your working branch mybranch:

git rebase dev mybranch

In case of conflict:

 git mergetool
 git rebase --continue

When everything's fine on your local branch, force push to your myOrigin remote:

git push myOrigin --force-with-lease

To cancel everything:

git rebase --abort

Squashing commits

git rebase -i origin/dev
  • Replace pick by fixup on the commits you want squashed out
  • Replace pick by reword on the first commit if you want to change the commit message
  • Save the file and quit your editor

Force push to your myOrigin remote:

git push myOrigin --force-with-lease

Populate fix_available from firstPatchedVersion in the GraphQL response.
Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@valentijnscholten valentijnscholten added this to the 2.60.0 milestone Jun 2, 2026
Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mtesauro mtesauro requested review from Jino-T and dogboat June 3, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants