diff --git a/.changelog/4836.yml b/.changelog/4836.yml new file mode 100644 index 0000000000..bebf979136 --- /dev/null +++ b/.changelog/4836.yml @@ -0,0 +1,4 @@ +changes: +- description: Added support for hidden commands. + type: internal +pr_number: 4836 diff --git a/demisto_sdk/commands/common/tools.py b/demisto_sdk/commands/common/tools.py index f031490a56..dd29f79299 100644 --- a/demisto_sdk/commands/common/tools.py +++ b/demisto_sdk/commands/common/tools.py @@ -3540,7 +3540,11 @@ def extract_none_deprecated_command_names_from_yml(yml_data: dict) -> list: """ commands_ls = [] for command in yml_data.get("script", {}).get("commands", {}): - if command.get("name") and not command.get("deprecated"): + if ( + command.get("name") + and not command.get("deprecated") + and not command.get("hidden") + ): commands_ls.append(command.get("name")) return commands_ls diff --git a/demisto_sdk/commands/content_graph/objects/integration.py b/demisto_sdk/commands/content_graph/objects/integration.py index 62e4d1f04e..9d4d3fd7d4 100644 --- a/demisto_sdk/commands/content_graph/objects/integration.py +++ b/demisto_sdk/commands/content_graph/objects/integration.py @@ -62,6 +62,7 @@ class Command(BaseNode, content_type=ContentType.COMMAND): # type: ignore[call- outputs: List[IntegrationOutput] = Field([], exclude=True) deprecated: bool = Field(False) + hidden: bool = Field(False) description: Optional[str] = Field("") # missing attributes in DB diff --git a/demisto_sdk/commands/content_graph/parsers/integration.py b/demisto_sdk/commands/content_graph/parsers/integration.py index 0e3276b350..3435715046 100644 --- a/demisto_sdk/commands/content_graph/parsers/integration.py +++ b/demisto_sdk/commands/content_graph/parsers/integration.py @@ -21,6 +21,7 @@ class CommandParser: name: str deprecated: bool + hidden: bool description: str args: List[dict] outputs: List[dict] @@ -91,6 +92,7 @@ def connect_to_commands(self) -> None: for command_data in self.script_info.get("commands", []): name = command_data.get("name") deprecated = command_data.get("deprecated", False) or self.deprecated + hidden = command_data.get("hidden", False) description = command_data.get("description") args = command_data.get("arguments") or [] outputs = command_data.get("outputs") or [] @@ -109,6 +111,7 @@ def connect_to_commands(self) -> None: name=name, description=description, deprecated=deprecated, + hidden=hidden, args=args, outputs=outputs, quickaction=quickaction, diff --git a/demisto_sdk/commands/validate/validators/RM_validators/RM110_is_commands_in_readme.py b/demisto_sdk/commands/validate/validators/RM_validators/RM110_is_commands_in_readme.py index cf16a4c28c..69ae341cc0 100644 --- a/demisto_sdk/commands/validate/validators/RM_validators/RM110_is_commands_in_readme.py +++ b/demisto_sdk/commands/validate/validators/RM_validators/RM110_is_commands_in_readme.py @@ -41,6 +41,7 @@ def obtain_invalid_content_items( if command.name not in content_item.readme.file_content and command.name not in COMMANDS_EXCLUDED_FROM_README_DOCUMENTATION and not command.deprecated + and not command.hidden and not command.name.endswith("get-indicators") ] if undocumented_commands: