diff --git a/.changelog/4302.yml b/.changelog/4302.yml new file mode 100644 index 0000000000..45b896e878 --- /dev/null +++ b/.changelog/4302.yml @@ -0,0 +1,4 @@ +changes: +- description: Removed support for hybrid packs for the `defaultDataSource` field in the pack metadata. + type: feature +pr_number: 4139 diff --git a/demisto_sdk/commands/content_graph/objects/pack_metadata.py b/demisto_sdk/commands/content_graph/objects/pack_metadata.py index e34ad79cdf..da308db490 100644 --- a/demisto_sdk/commands/content_graph/objects/pack_metadata.py +++ b/demisto_sdk/commands/content_graph/objects/pack_metadata.py @@ -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. @@ -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 ) @@ -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( @@ -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() ) @@ -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)) diff --git a/demisto_sdk/commands/validate/validators/PA_validators/PA131_is_default_data_source_provided.py b/demisto_sdk/commands/validate/validators/PA_validators/PA131_is_default_data_source_provided.py index 0e403fdd57..adb83221af 100644 --- a/demisto_sdk/commands/validate/validators/PA_validators/PA131_is_default_data_source_provided.py +++ b/demisto_sdk/commands/validate/validators/PA_validators/PA131_is_default_data_source_provided.py @@ -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