Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP platform: added support for hidden commands #4836

Merged
merged 4 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/4836.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Added support for hidden commands.
type: internal
pr_number: 4836
6 changes: 5 additions & 1 deletion demisto_sdk/commands/common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions demisto_sdk/commands/content_graph/parsers/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
class CommandParser:
name: str
deprecated: bool
hidden: bool
description: str
args: List[dict]
outputs: List[dict]
Expand Down Expand Up @@ -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 []
Expand All @@ -109,6 +111,7 @@ def connect_to_commands(self) -> None:
name=name,
description=description,
deprecated=deprecated,
hidden=hidden,
args=args,
outputs=outputs,
quickaction=quickaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down