-
Notifications
You must be signed in to change notification settings - Fork 10
Append unique info and hash to AAP resource names #39
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
Conversation
core/task_runner.py
Outdated
| task.mark_running({"info": "Creating job templates"}) | ||
| automations = create_job_templates( | ||
| session, instance, pattern_def, project_id, ee_id | ||
| session, instance, pattern, pattern_def, project_id, ee_id |
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.
I do not understand the reason you need to pass pattern instance here. Cannot you access the information needed from pattern_def already? If that's not the case, I would only pass the pattern instance and remove pattern_def, because pattern_def can be obtained pattern_def = pattern.pattern_definition inside create_job_templates.
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.
Updated accordingly!
d4f6f06 to
bcaa3ba
Compare
abikouo
left a comment
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
core/utils/controller/helpers.py
Outdated
| Creates controller labels and returns model instances. | ||
| Args: | ||
| instance (PatternInstance): The PatternInstance object. | ||
| pattern (Pattern): The related Pattern object. |
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.
Is this something that need to be removed?
GomathiselviS
left a comment
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.
Docstring update needed. Otherwise LGTM.
|



Resolves AAP-51478
A new helper function for generating a unique name for an AAP resource. The function appends the resource name from the pattern definition with the collection name and pattern name, plus a short hash generated from the combination of the collection name, pattern name, collection version, and organization ID.
This new unique name is in the format of:
{original_resource_name} {collection_name}.{pattern_name} {hash}