feat(polyswarm-enrichment): verify connector (#6793)#6795
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6795 +/- ##
===========================================
- Coverage 33.38% 1.28% -32.11%
===========================================
Files 1994 1902 -92
Lines 122846 120242 -2604
===========================================
- Hits 41017 1544 -39473
- Misses 81829 118698 +36869
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR verifies and hardens the polyswarm-enrichment internal enrichment connector, aligning formatting with repo CI defaults and expanding the test suite to meet the stated patch coverage target.
Changes:
- Refactors connector/client/converter logging to use
helper.connector_loggerconsistently and updates several STIX-building paths (incl.stix2.Identity/stix2.Relationshipusage). - Enables
cleanup_inconsistent_bundle=Truewhen sending bundles and updates TLP extraction to consider OpenCTI entity markings. - Adds/updates unit + e2e tests and marks the connector as verified in metadata, with generated config schema/docs.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal-enrichment/polyswarm-enrichment/tests/test_smoke.py | Updates relationship test IDs to valid STIX-like IDs. |
| internal-enrichment/polyswarm-enrichment/tests/test_network_iocs.py | Extends stubs to include connector_logger for updated logging usage. |
| internal-enrichment/polyswarm-enrichment/tests/test_e2e_opencti.py | Formatting change for multiline GraphQL query string interpolation. |
| internal-enrichment/polyswarm-enrichment/tests/test_e2e_network_iocs.py | Formatting change for multiline GraphQL query string interpolation. |
| internal-enrichment/polyswarm-enrichment/tests/test_e2e_keydoor.py | Formatting change for multiline GraphQL query string interpolation. |
| internal-enrichment/polyswarm-enrichment/tests/test_converter_to_stix.py | Updates relationship tests to use valid STIX-like IDs and variables. |
| internal-enrichment/polyswarm-enrichment/tests/test_connector_coverage.py | Adds a large patch-coverage-focused test suite for connector/client/converter error/edge paths. |
| internal-enrichment/polyswarm-enrichment/src/polyswarm_enrichment/converter_to_stix.py | Switches author/relationship creation to stix2, updates logging calls and author reference handling. |
| internal-enrichment/polyswarm-enrichment/src/polyswarm_enrichment/connector.py | Updates imports, author reference usage, TLP extraction, artifact filename preservation, and bundle sending cleanup behavior. |
| internal-enrichment/polyswarm-enrichment/src/polyswarm_enrichment/client_api.py | Updates imports and converts logging calls to connector_logger. |
| internal-enrichment/polyswarm-enrichment/src/polyswarm_enrichment/attack_pattern_handler.py | Converts logging calls to connector_logger. |
| internal-enrichment/polyswarm-enrichment/src/polyswarm_enrichment/init.py | Switches to absolute imports for package exports. |
| internal-enrichment/polyswarm-enrichment/src/main.py | Simplifies entrypoint to run directly under __main__. |
| internal-enrichment/polyswarm-enrichment/pyproject.toml | Removes connector-local formatting overrides (line-length 120). |
| internal-enrichment/polyswarm-enrichment/entrypoint.sh | Removes shell entrypoint script. |
| internal-enrichment/polyswarm-enrichment/Dockerfile | Uses WORKDIR + direct Python entrypoint (python3 main.py). |
| internal-enrichment/polyswarm-enrichment/docker-compose.yml | Updates image tag and environment variables (currently inconsistent with settings/schema). |
| internal-enrichment/polyswarm-enrichment/metadata/connector_manifest.json | Marks connector verified and manager-supported with a last verified date. |
| internal-enrichment/polyswarm-enrichment/metadata/connector_config_schema.json | Adds generated JSON schema for connector configuration. |
| internal-enrichment/polyswarm-enrichment/metadata/CONNECTOR_CONFIG_DOC.md | Adds generated configuration documentation table. |
Comments suppressed due to low confidence (1)
internal-enrichment/polyswarm-enrichment/src/polyswarm_enrichment/converter_to_stix.py:1595
connector_loggermetadata should be passed via themeta=keyword rather than as a second positional argument (consistent with connectors-sdk ConnectorLogger and other connectors).
self.helper.connector_logger.error(
"This observable value is not a valid IPv4 or IPv6 address nor DomainName: ",
{"value": value},
)
cd84897 to
0cdb165
Compare
maximerafaillac
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Related issues
Checklist
Further comments