tasks/release.py
def _get_release_version_from_release_json(release_json, major_version, version_re, release_json_key=None):
    """
    If release_json_key is None, returns the highest version entry in release.json.
    If release_json_key is set, returns the entry for release_json_key of the highest version entry in release.json.
    """

    release_version = None
    release_component_version = None

    # Get the release entry for the given Agent major version
    release_entry_name = release_entry_for(major_version)
    release_json_entry = release_json.get(release_entry_name, None)

    # Check that the release entry exists, otherwise fail
    if release_json_entry:
        release_version = release_entry_name

        # Check that the component's version is defined in the release entry
        if release_json_key is not None:
            match = version_re.match(release_json_entry.get(release_json_key, ""))
            if match:
                release_component_version = _create_version_from_match(match)
            else:
                print(
                    f"{release_entry_name} does not have a valid {release_json_key} ({release_json_entry.get(release_json_key, '')}), ignoring"
                )

    if not release_version:
        raise Exit(f"Couldn't find any matching {release_version} version.", 1)

    if release_json_key is not None:
        return release_component_version

    return release_version

    If release_json_key is None, returns the highest version entry in release.json.
    If release_json_key is set, returns the entry for release_json_key of the highest version entry in release.json.
    
If release_json_key is None, returns the highest version entry in release.json.
If release_json_key is set, returns the entry for release_json_key of the highest version entry in release.json.
If release_json_key is None returns the highest version entry in release . json . If release_json_key is set returns the entry for release_json_key of the highest version entry in release . json .
def _get_release_version_from_release_json(release_json, major_version, version_re, release_json_key=None):
    release_version = None
    release_component_version = None
    release_entry_name = release_entry_for(major_version)
    release_json_entry = release_json.get(release_entry_name, None)
    if release_json_entry:
        release_version = release_entry_name
        if release_json_key is not None:
            match = version_re.match(release_json_entry.get(release_json_key, ""))
            if match:
                release_component_version = _create_version_from_match(match)
            else:
                print(
                    f"{release_entry_name} does not have a valid {release_json_key} ({release_json_entry.get(release_json_key, '')}), ignoring"
                )
    if not release_version:
        raise Exit(f"Couldn't find any matching {release_version} version.", 1)
    if release_json_key is not None:
        return release_component_version
    return release_version
def _get_release_version_from_release_json ( release_json , major_version , version_re , release_json_key = None ) : release_version = None release_component_version = None release_entry_name = release_entry_for ( major_version ) release_json_entry = release_json . get ( release_entry_name , None ) if release_json_entry : release_version = release_entry_name if release_json_key is not None : match = version_re . match ( release_json_entry . get ( release_json_key , "" ) ) if match : release_component_version = _create_version_from_match ( match ) else : print ( f"{release_entry_name} does not have a valid {release_json_key} ({release_json_entry.get(release_json_key, '')}), ignoring" ) if not release_version : raise Exit ( f"Couldn't find any matching {release_version} version." , 1 ) if release_json_key is not None : return release_component_version return release_version
If release_json_key is None, returns the highest version entry in release.json.
If release_json_key is None returns the highest version entry in release . json .
"""
    If release_json_key is None, returns the highest version entry in release.json.
    If release_json_key is set, returns the entry for release_json_key of the highest version entry in release.json.
    """ # Get the release entry for the given Agent major version # Check that the release entry exists, otherwise fail # Check that the component's version is defined in the release entry
release_json
major_version
version_re
release_json_key