feat(daemons): support description and tags on the collector security platform (#319) - #320
Merged
Merged
Conversation
4 tasks
There was a problem hiding this comment.
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_descriptionandcollector_platform_tagshandling toCollectorDaemon._setup, including tag upsert logic. - Add
platform_description/platform_tagsoptional fields toConfigLoaderCollector. - 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.
…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.
Member
Author
|
Review-and-fix pass complete:
Still pending: an approving review from another maintainer (I cannot approve my own PR). |
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") |
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.
Summary
CollectorDaemon._setupnow reads two new optional configuration keys when acollector_platformis declared:collector_platform_description(passed asasset_description) andcollector_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 asasset_tags).ConfigLoaderCollectorgains matching optionalplatform_description/platform_tagsfields (default None) so pydantic-based collector configs can declare them;platform_tagsaccepts a list or a comma-separated string, matching the daemon's runtime behavior (env vars provide strings).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
tag_colorand 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)SecurityPlatformUpsertInputextendsAssetInput(asset_description,asset_tagsas tag ids) andupsertSecurityPlatformapplies both on the create and update paths.