Skip to content

extractor: fix plugin monkey-patch not taking effect for load_cves_from_sources#17

Merged
danielturull merged 2 commits into
mainfrom
fix/plugin-input-source-validation
Jun 9, 2026
Merged

extractor: fix plugin monkey-patch not taking effect for load_cves_from_sources#17
danielturull merged 2 commits into
mainfrom
fix/plugin-input-source-validation

Conversation

@danielturull

Copy link
Copy Markdown
Contributor

Summary

__main__.py imported load_cves_from_sources as a direct name binding, so the NDJSON input plugin's monkey-patch on the cve_sources module was never visible at the call site. This caused --cve-ndjson to produce 0 CVEs.

Changes

  • Import cve_sources module in __main__.py instead of binding the function directly, so the attribute lookup picks up the patched function at call time.
  • Update test mock targets to patch at the function's defining module.

Testing

  • Verified 266 CVEs loaded from NDJSON bulletin after the fix.
  • All 15 extractor tests pass (4 skipped).

Update extra/README.md with separate examples for data enrichment
sources and input source plugins. Highlight the requirement that
is_enabled() must work purely from parsed args.

Assisted-by: Kiro:claude-opus-4.6
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
…om_sources

__main__.py imported load_cves_from_sources as a direct name binding,
so the NDJSON input plugin's replacement on the cve_sources module was
never visible at the call site. Import the module instead so the
attribute lookup picks up the patched function.

Update test mock targets to patch at the function's defining module.

Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
@danielturull danielturull merged commit f4c29d1 into main Jun 9, 2026
6 checks passed
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.

1 participant