Append unique info and hash to AAP resource names#39
Merged
Conversation
| 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 |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
Updated accordingly!
d4f6f06 to
bcaa3ba
Compare
alinabuzachis
approved these changes
Sep 17, 2025
| Creates controller labels and returns model instances. | ||
| Args: | ||
| instance (PatternInstance): The PatternInstance object. | ||
| pattern (Pattern): The related Pattern object. |
Contributor
There was a problem hiding this comment.
Is this something that need to be removed?
GomathiselviS
approved these changes
Sep 17, 2025
GomathiselviS
left a comment
Contributor
There was a problem hiding this comment.
Docstring update needed. Otherwise LGTM.
mandar242
approved these changes
Sep 17, 2025
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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}