-
Notifications
You must be signed in to change notification settings - Fork 79
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
Platform-content-support_supported-modules-and-playbook-tags #4832
Conversation
Changelog(s) in markdown:
|
Changelog(s) in markdown:
|
demisto_sdk/commands/common/content/objects/pack_objects/pack_metadata/pack_metadata.py
Outdated
Show resolved
Hide resolved
demisto_sdk/commands/common/content/objects/pack_objects/pack_metadata/pack_metadata.py
Outdated
Show resolved
Hide resolved
@thefrieddan1 @RosenbergYehuda |
…upported-modules-and-playbook-tags
Fixing unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this 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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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__( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Related Issues
fixes: CIAC-12869
Description