Skip to content

Commit

Permalink
Merge 5f1e8ac into aec398f
Browse files Browse the repository at this point in the history
  • Loading branch information
BEAdi committed May 27, 2024
2 parents aec398f + 5f1e8ac commit a3da7a1
Show file tree
Hide file tree
Showing 3 changed files with 13 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 hybrid packs for the `defaultDataSource` field in the pack metadata.
type: feature
pr_number: 4139
9 changes: 8 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 @@ -332,6 +335,7 @@ def _get_pack_tags(
{PackTags.DATA_SOURCE}
if self.is_data_source(content_items)
and marketplace == MarketplaceVersions.MarketplaceV2
and not self.hybrid
else set()
)

Expand Down Expand Up @@ -366,6 +370,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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def is_valid(self, content_items: Iterable[ContentTypes]) -> List[ValidationResu
)
for content_item in content_items
if MarketplaceVersions.MarketplaceV2 in content_item.marketplaces
and not content_item.hybrid
and (
content_item.is_data_source(content_item.content_items)
and not content_item.default_data_source_id
Expand Down

0 comments on commit a3da7a1

Please sign in to comment.