Skip to content

feat(daemons): support description and tags on the collector security platform (#319) - #320

Merged
SamuelHassine merged 2 commits into
mainfrom
feat/security-platform-description-tags
Jul 26, 2026
Merged

feat(daemons): support description and tags on the collector security platform (#319)#320
SamuelHassine merged 2 commits into
mainfrom
feat/security-platform-description-tags

Conversation

@SamuelHassine

@SamuelHassine SamuelHassine commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • CollectorDaemon._setup now reads two new optional configuration keys when a collector_platform is declared: collector_platform_description (passed as asset_description) and collector_platform_tags (list of tag names or comma-separated string; names are stripped in both forms, each tag is upserted with a neutral grey color and the ids are passed as asset_tags).
  • ConfigLoaderCollector gains matching optional platform_description / platform_tags fields (default None) so pydantic-based collector configs can declare them; platform_tags accepts a list or a comma-separated string, matching the daemon's runtime behavior (env vars provide strings).
  • Tag upsert failures are logged and skipped so collector setup never fails because of a tag. When the keys are absent, the upsert payload is byte-for-byte unchanged (fully backward compatible).

Fixes the empty read-only security platform cards created by collectors (no description, no tags). Companion sweep setting defaults for all 19 collectors: OpenAEV-Platform/collectors#539.

Closes #319

Test plan

  • New unit tests: description + tags carried in the security platform upsert payload (including the neutral grey tag_color and stripping of padded list values); comma-separated string tags accepted; payload unchanged and no tag upsert when the keys are absent.
  • pytest test/ (172 passed)
  • black + isort + flake8 clean on modified files
  • Verified against the platform API: SecurityPlatformUpsertInput extends AssetInput (asset_description, asset_tags as tag ids) and upsertSecurityPlatform applies both on the create and update paths.

Copilot AI left a comment

Copy link
Copy Markdown

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 extends the collector daemon’s security platform auto-upsert behavior to optionally include a description and tags, addressing the “empty read-only card” problem for platforms created by collectors. It also updates the pydantic config model and adds unit tests to validate the new payload behavior and backwards compatibility.

Changes:

  • Add optional collector_platform_description and collector_platform_tags handling to CollectorDaemon._setup, including tag upsert logic.
  • Add platform_description / platform_tags optional fields to ConfigLoaderCollector.
  • Add unit tests covering description + tags, comma-separated tag strings, and unchanged payload when keys are absent.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pyoaev/daemons/collector_daemon.py Builds security platform upsert payload with optional description and tag IDs (tag upsert + skip-on-failure).
pyoaev/configuration/settings_loader.py Extends pydantic collector config model with optional platform description/tags fields.
test/daemons/test_collector_daemon.py Adds tests for new description/tags behavior and backwards compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyoaev/configuration/settings_loader.py Outdated
Comment thread pyoaev/daemons/collector_daemon.py
Comment thread test/daemons/test_collector_daemon.py
…ist values (#319)

- ConfigLoaderCollector.platform_tags now accepts a comma-separated string
  as well as a list, matching the daemon's runtime behavior (env vars
  provide strings).
- Tag names from list inputs are stripped like string ones.
- Tests assert the neutral grey tag color and the stripped list value.
@SamuelHassine

Copy link
Copy Markdown
Member Author

Review-and-fix pass complete:

  • Independent review done against the platform consumers: SecurityPlatformUpsertInput extends AssetInput (asset_description, asset_tags as tag ids) and upsertSecurityPlatform applies both on the create and update paths, so the new payload keys are effective. TagManager.upsert posts {tag_name, tag_color} to /tags/upsert, and the neutral grey #6b7280 matches the _create_or_get_tag default already used across collectors. Backward compatibility confirmed: when the keys are absent the payload is unchanged.
  • Addressed all three Copilot comments in 5e2ac5e: ConfigLoaderCollector.platform_tags is now typed list[str] | str | None so schema validation matches the daemon's comma-separated string support; tag names from list inputs are stripped like string ones (test uses a padded value); and the tests now assert the tag_color on the upsert payload. All threads replied to and resolved.
  • Verified locally: full pytest suite passes (172 tests), black, isort and flake8 clean. All CI checks are green on the new head, both commits are signed, the PR is linked to feat(collector): support description and tags on the security platform auto-created by collectors #319 and the title matches the repository convention.

Still pending: an approving review from another maintainer (I cannot approve my own PR).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +40 to +44
@patch("pyoaev.apis.SecurityPlatformManager.upsert")
@patch("pyoaev.apis.TagManager.upsert")
@patch("pyoaev.apis.DocumentManager.upsert")
@patch("pyoaev.apis.CollectorManager.create")
@patch("builtins.open", new_callable=mock_open, read_data="data")
@SamuelHassine
SamuelHassine merged commit 096d27b into main Jul 26, 2026
16 checks passed
@SamuelHassine
SamuelHassine deleted the feat/security-platform-description-tags branch July 26, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(collector): support description and tags on the security platform auto-created by collectors

3 participants