Skip to content

Fix scan reimport: use reimport-scan endpoint when scan type already exists in DefectDojo#40

Merged
Nitr4x merged 4 commits into
mainfrom
copilot/fix-scan-reimport-issue
Apr 16, 2026
Merged

Fix scan reimport: use reimport-scan endpoint when scan type already exists in DefectDojo#40
Nitr4x merged 4 commits into
mainfrom
copilot/fix-scan-reimport-issue

Conversation

Copilot AI commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
  • Add ReimportScanPath, GetTestsPath, GetTests, ReimportScan plumbing
  • Add TestId int with form:"test" to ScanPayload
  • Skip zero-value int fields in createMultipartFromScanPayload (so test=0 is never sent on import)
  • Set payload.TestId = tests[0].Id in kics, grype, and opengrep Sync methods
  • Updated tests: mock captures reimportedPayload, assertions confirm TestId matches the test returned by GetTests
  • New TestCreateMultipartFromScanPayload sub-tests assert zero TestId is omitted and non-zero is included
  • All tests pass

Copilot AI linked an issue Apr 16, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix scan type reimporting behavior Fix scan reimport: use reimport-scan endpoint when scan type already exists in DefectDojo Apr 16, 2026
Copilot AI requested a review from Nitr4x April 16, 2026 19:43
@Nitr4x Nitr4x marked this pull request as ready for review April 16, 2026 19:58
@Nitr4x Nitr4x merged commit b57b7f4 into main Apr 16, 2026
2 checks passed
@Nitr4x Nitr4x deleted the copilot/fix-scan-reimport-issue branch April 16, 2026 19:59
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.

[Bug] Scan reimport

2 participants