Skip to content

Conversation

@AndreMarcel99
Copy link
Collaborator

SUMMARY

Filter to get data set names Fixes #2165

ISSUE TYPE
  • Enhancement Pull Request
COMPONENT NAME

Generate data set name from the components use on the tests data set helpers
Screenshot 2025-10-29 at 5 01 44 p m

Screenshot 2025-10-29 at 5 01 27 p m

@AndreMarcel99 AndreMarcel99 changed the title Filter/2165/filter for data set name [Filter][2165]filter_for_data_set_name Oct 29, 2025
@AndreMarcel99 AndreMarcel99 marked this pull request as ready for review October 29, 2025 23:03
Copy link
Collaborator

@richp405 richp405 left a comment

Choose a reason for hiding this comment

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

This can't be merged until the pep8 and bandit issues are resolved.
It looks like a decent change, but non-standard... should be an easy couple of fixes.

richp405
richp405 previously approved these changes Oct 31, 2025
Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

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

Requested one change and asked a question

from ansible.errors import AnsibleFilterError


def generate_data_set_name(value, generations=1):
Copy link
Collaborator

Choose a reason for hiding this comment

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

At first sight generations might seem to be referring to a different thing, it will be better to use something like count or num_names


EXAMPLES: |
# Get only one data set name.
clean_output: "{{ hlq | ibm.ibm_zos_core.generate_data_set_name}}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the result if I do this ?

{{ ibm.ibm_zos_core.generate_data_set_name }}

Asking because I would expect to have either an error or a randomly generated hlq, when using mvstmp it uses the result of whoami command

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think in this case we cannot generate a valid HLQ even having the ansible user, so we could fail in case no HLQ is provided

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding this!!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update the copyright year

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good, would only add one testing when is empty (if possible even)

Copy link
Collaborator

@rexemin rexemin left a comment

Choose a reason for hiding this comment

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

Looks great, just spotted a couple of typos and I would also like to see a response to Fernando's comments about calling the filter without parameters

richp405
richp405 previously approved these changes Nov 11, 2025
Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

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

requested one last change

- Middle level qualifier to be used in the data set names.
type: str
required: false
last_level_qualifier:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I recommend to change last_level_qualifier to low_level_qualifier since that is how it is referred in the IBM docs.

@AndreMarcel99
Copy link
Collaborator Author

Screenshot 2025-11-11 at 4 23 07 p m Screenshot 2025-11-11 at 4 23 58 p m

Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

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

Looks good to me now thanks

@fernandofloresg fernandofloresg merged commit d4bae16 into dev Nov 13, 2025
17 checks passed
@fernandofloresg fernandofloresg deleted the filter/2165/Filter_for_data_set_name branch November 13, 2025 20:53
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.

[Enhancement][Filters] Create a filter that returns a valid temporary data set name

6 participants