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

Platform-content-support_supported-modules-and-playbook-tags #4832

Conversation

barryyosi-panw
Copy link
Contributor

@barryyosi-panw barryyosi-panw commented Feb 24, 2025

Related Issues

fixes: CIAC-12869

Description

  • Added support for playbooks tags in content items metadata dump.
  • Enhanced content-graph support for "supportedModules" field on content item level and metadata dump.
  • Determined default supported modules

Copy link

Changelog(s) in markdown:

  • Added support for playbook tags in metadata dump, and support for supportedModules field. #4832

Copy link

Changelog(s) in markdown:

  • Added support for playbook tags in metadata dump, and support for supportedModules field. #4832

@barryyosi-panw
Copy link
Contributor Author

@thefrieddan1 @RosenbergYehuda
Please take a look

Copy link
Contributor Author

@barryyosi-panw barryyosi-panw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@RosenbergYehuda RosenbergYehuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! 🎉

See my comments—some of them might be misunderstandings on my part. We can discuss them.

Any: The same data object with supported modules appended.
"""

if isinstance(data, dict):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"""data (Any): The data to process, which can be a dictionary, list, or string."""
Why are we handling only dict?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, I checked the type hints on the previous method that accepts this argument .
But self.data can only be a dict. Fixing

# Replace incorrect marketplace references
data = replace_marketplace_references(data, current_marketplace, str(self.path))
data = append_supported_modules(data, self.supportedModules)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain this?
Why adding in to the object is not enough? because you need it in the bucket?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - need to explicitly add it to the dumped .yml or .json

Copy link
Contributor Author

@barryyosi-panw barryyosi-panw Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - we inherit it from pack so we don't necessarily need to specify it on the content item level (unless we want to override the pack's value) - but server needs it explicitly, so we have to add it to the dumped content item.

@@ -124,6 +125,7 @@ def upload_zip(

class Pack(BaseContent, PackMetadata, content_type=ContentType.PACK):
path: Path
supportedModules: List[str] = DEFAULT_SUPPORTED_MODULES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add this if it was already added to BaseNode (which we inherit via BaseContent)? The only reason to do so would be if we plan to override it. Is that the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - we would override it.

git_sha: Optional[str] = None,
) -> None:
super().__init__(path, pack_marketplaces, git_sha=git_sha)
super().__init__(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here—after defining it in ContentItemParser, why do we need to do the same for all its inheritors? Won't it already be inherited?
This is the same question for all inherited classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we inherit it both from Base Node in (OOP wise), but, we also need to be able to inherit this from the pack level - so its used while parsing the pack's content items.

@barryyosi-panw barryyosi-panw merged commit fb94d04 into master Mar 11, 2025
25 checks passed
@barryyosi-panw barryyosi-panw deleted the platform-content-support_supported-modules-and-playbook-tags branch March 11, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants