Skip to content

Commit

Permalink
Fix Data Source Tag for Hybrid Pack (#4302)
Browse files Browse the repository at this point in the history
* fix hybrid

* add changelog

* reduce hybrid places
  • Loading branch information
BEAdi committed May 27, 2024
1 parent aec398f commit adf7fdc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changelog/4302.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Removed support for the `defaultDataSource` field in the pack metadata for hybrid packs.
type: feature
pr_number: 4139
8 changes: 7 additions & 1 deletion demisto_sdk/commands/content_graph/objects/pack_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def _enhance_pack_properties(
pack_id (str): The pack ID.
content_items (PackContentItems): The pack content items object.
"""
self._set_default_data_source(content_items)
if not self.hybrid:
self._set_default_data_source(content_items)
self.tags = self._get_pack_tags(marketplace, pack_id, content_items)
self.author = self._get_author(self.author, marketplace)
# We want to add the pipeline_id only if this is called within our repo.
Expand Down Expand Up @@ -134,6 +135,7 @@ def _format_metadata(
if self.default_data_source_name
and self.default_data_source_id
and marketplace == MarketplaceVersions.MarketplaceV2
and not self.hybrid
else None # if the pack is multiple marketplace, override the initially set str default_data_source_id
)

Expand Down Expand Up @@ -217,6 +219,7 @@ def _get_content_items_and_displays_metadata(
and self.default_data_source_name
and collected_content_items
and marketplace == MarketplaceVersions.MarketplaceV2
and not self.hybrid
):
# order collected_content_items integration list so that the defaultDataSource will be first
self._place_data_source_integration_first(
Expand Down Expand Up @@ -366,6 +369,9 @@ def _get_tags_by_marketplace(self, marketplace: str):

def is_data_source(self, content_items: PackContentItems) -> bool:
"""Returns a boolean result on whether the pack should be considered as a "Data Source" pack."""
if self.hybrid:
# hybrid packs have a builtin data source
return False
if self.default_data_source_id and self.default_data_source_name:
return True
return any(self.get_valid_data_source_integrations(content_items))
Expand Down

0 comments on commit adf7fdc

Please sign in to comment.