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

Get All Versions improvements #83

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

istairbn
Copy link
Contributor

2 changes to Get All Versions

  1. Recursion. Change to the root Client. Defaults to off (mimics current behaviour) but if active then it will recurse through directories. This covers situations where some foldershave a mixture of CIs and core.Directory objects.

  2. ListBox population. Currently the app can populate a List... but not a ListBox. This is a simple addition that prevents having a second script to simply populate a user input List box.

Get All Versions task needs two extra features:
 - Add recursion (allows it to recurse through child directories, defaults to False, which is standard behaviour
 - Populate a list box. Allows users to get all versions and add to a list box
Allows Get All Versions to complete a list box rather than a list
get_all_package_version has the recurse option, allowing it to search through child directories
@jdewinne
Copy link
Contributor

I'm not following on the recursion feature. If the input is an application id, how can there be a core.Directory under that level? As far as I know, an udm.Application can not have a core.Directory as a child. Or am i mistaken?

@istairbn
Copy link
Contributor Author

If the input is udm.Application, then you are correct.

However, Get All Versions is powerful because it returns all children of anything - not just applications. So you can give it an environment and it’ll return the deployeds.

The recursion feature allows you to give it a core.Directory and it’ll return all top level CIs. For example, a structure set up thus:

Team
Team/buisnessApp
Team/anotherApp
Team/dB/mySqlApp
Team/dB/oracleApp

Targeting team with get all Versions recursive will return 4 Apps. I then populate a list box, the user selects an app they want. Now the user has selected an app, we run Get All versions again to get the version of what they want to Deploy.

Arguably I’m not using “Get all Versions” for its original purpose - but adding recursion and leaving it defaulting to false means it simply extends the capability to make it more functional whilst leaving default behaviour untouched.

Copy link
Contributor

@jdewinne jdewinne left a comment

Choose a reason for hiding this comment

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

How about leaving GetAllVersions intact, and making an additional task GetChildConfigurationItems that does what you want. They can both share the same code, but that way the recurse doesn't need to be present on GetAllVersions.

description="If True, the Task will fail if the CI doesn't exist" default="false"/>
<property name="throwOnFail" category="input" kind="boolean" label="Throw on Fail" description="If True, the Task will fail if the CI doesn't exist" default="false"/>
<property name="recurse" category="input" kind="boolean" label="Recursive" description="If True, recurses through child directories" default="false"/>
<property name="target_list_box" category="input" kind="string" label="List Box" description="If you wish to populate a List Box, provide the existing release variable name here (without ${ or })"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not be an output property?

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.

2 participants