Skip to content

feat(polyswarm-enrichment): verify connector (#6793)#6795

Merged
throuxel merged 1 commit into
masterfrom
feat/verify-polyswarn-enrichment
Jun 24, 2026
Merged

feat(polyswarm-enrichment): verify connector (#6793)#6795
throuxel merged 1 commit into
masterfrom
feat/verify-polyswarn-enrichment

Conversation

@throuxel

@throuxel throuxel commented Jun 23, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Verify polyswarm-enrichment connector
  • Add unit tests for patch coverage >= 80%
  • Tested with connector composer

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

Copilot AI review requested due to automatic review settings June 23, 2026 13:09
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.55556% with 35 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...m-enrichment/src/polyswarm_enrichment/connector.py 75.75% 16 Missing ⚠️
...-enrichment/src/polyswarm_enrichment/client_api.py 82.00% 9 Missing ⚠️
...ment/src/polyswarm_enrichment/converter_to_stix.py 90.19% 5 Missing ⚠️
...src/polyswarm_enrichment/attack_pattern_handler.py 66.66% 3 Missing ⚠️
...ternal-enrichment/polyswarm-enrichment/src/main.py 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (143e8c5) and HEAD (0cdb165). Click for more details.

HEAD has 119 uploads less than BASE
Flag BASE (143e8c5) HEAD (0cdb165)
connectors 123 4
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     
Files with missing lines Coverage Δ
...rm-enrichment/src/polyswarm_enrichment/__init__.py 100.00% <100.00%> (ø)
...ternal-enrichment/polyswarm-enrichment/src/main.py 0.00% <0.00%> (ø)
...src/polyswarm_enrichment/attack_pattern_handler.py 77.35% <66.66%> (+1.88%) ⬆️
...ment/src/polyswarm_enrichment/converter_to_stix.py 80.13% <90.19%> (+9.59%) ⬆️
...-enrichment/src/polyswarm_enrichment/client_api.py 86.80% <82.00%> (+39.84%) ⬆️
...m-enrichment/src/polyswarm_enrichment/connector.py 79.01% <75.75%> (+68.47%) ⬆️

... and 1137 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@throuxel throuxel changed the title test(polyswarm-enrichment): verify connector (#6793) feat(polyswarm-enrichment): verify connector (#6793) Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_logger consistently and updates several STIX-building paths (incl. stix2.Identity/stix2.Relationship usage).
  • Enables cleanup_inconsistent_bundle=True when 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_logger metadata should be passed via the meta= 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},
        )

Comment thread internal-enrichment/polyswarm-enrichment/docker-compose.yml
Comment thread internal-enrichment/polyswarm-enrichment/docker-compose.yml Outdated
Comment thread internal-enrichment/polyswarm-enrichment/tests/test_connector_coverage.py Outdated
@throuxel throuxel force-pushed the feat/verify-polyswarn-enrichment branch from cd84897 to 0cdb165 Compare June 23, 2026 15:16
@throuxel throuxel merged commit 8ef97a0 into master Jun 24, 2026
28 checks passed
@throuxel throuxel deleted the feat/verify-polyswarn-enrichment branch June 24, 2026 07:45
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.

test(polyswarm-enrichment): verify connector

4 participants