tasks/release.py
def _update_release_json(release_json, release_entry, new_version: Version, max_version: Version, github_token):
    """
    Updates the provided release.json object by fetching compatible versions for all dependencies
    of the provided Agent version, constructing the new entry, adding it to the release.json object
    and returning it.
    """

    allowed_major_versions = COMPATIBLE_MAJOR_VERSIONS[new_version.major]

    # Part 1: repositories which follow the Agent version scheme

    # For repositories which follow the Agent version scheme, we want to only get
    # tags with the same minor version, to avoid problems when releasing a patch
    # version while a minor version release is ongoing.
    compatible_version_re = build_compatible_version_re(allowed_major_versions, new_version.minor)

    # If the new version is a final version, set the check_for_rc flag to true to warn if a dependency's version
    # is an RC.
    check_for_rc = not new_version.is_rc()

    integrations_version = _fetch_dependency_repo_version(
        "integrations-core",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )

    omnibus_software_version = _fetch_dependency_repo_version(
        "omnibus-software",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )

    omnibus_ruby_version = _fetch_dependency_repo_version(
        "omnibus-ruby",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )

    macos_build_version = _fetch_dependency_repo_version(
        "datadog-agent-macos-build",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )

    # Part 2: repositories which have their own version scheme
    jmxfetch_version = _fetch_independent_dependency_repo_version(
        "jmxfetch", release_json, new_version.major, github_token, "JMXFETCH_VERSION"
    )

    security_agent_policies_version = _fetch_independent_dependency_repo_version(
        "security-agent-policies", release_json, new_version.major, github_token, "SECURITY_AGENT_POLICIES_VERSION"
    )

    windows_ddnpm_driver, windows_ddnpm_version, windows_ddnpm_shasum = _get_windows_ddnpm_release_json_info(
        release_json, new_version.major, is_first_rc=(new_version.rc == 1)
    )

    # Add new entry to the release.json object and return it
    return _update_release_json_entry(
        release_json,
        release_entry,
        integrations_version,
        omnibus_software_version,
        omnibus_ruby_version,
        jmxfetch_version,
        security_agent_policies_version,
        macos_build_version,
        windows_ddnpm_driver,
        windows_ddnpm_version,
        windows_ddnpm_shasum,
    )

    Updates the provided release.json object by fetching compatible versions for all dependencies
    of the provided Agent version, constructing the new entry, adding it to the release.json object
    and returning it.
    
Updates the provided release.json object by fetching compatible versions for all dependencies
of the provided Agent version, constructing the new entry, adding it to the release.json object
and returning it.
Updates the provided release . json object by fetching compatible versions for all dependencies of the provided Agent version constructing the new entry adding it to the release . json object and returning it .
def _update_release_json(release_json, release_entry, new_version: Version, max_version: Version, github_token):
    allowed_major_versions = COMPATIBLE_MAJOR_VERSIONS[new_version.major]
    compatible_version_re = build_compatible_version_re(allowed_major_versions, new_version.minor)
    check_for_rc = not new_version.is_rc()
    integrations_version = _fetch_dependency_repo_version(
        "integrations-core",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )
    omnibus_software_version = _fetch_dependency_repo_version(
        "omnibus-software",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )
    omnibus_ruby_version = _fetch_dependency_repo_version(
        "omnibus-ruby",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )
    macos_build_version = _fetch_dependency_repo_version(
        "datadog-agent-macos-build",
        new_version,
        max_version,
        allowed_major_versions,
        compatible_version_re,
        github_token,
        check_for_rc,
    )
    jmxfetch_version = _fetch_independent_dependency_repo_version(
        "jmxfetch", release_json, new_version.major, github_token, "JMXFETCH_VERSION"
    )
    security_agent_policies_version = _fetch_independent_dependency_repo_version(
        "security-agent-policies", release_json, new_version.major, github_token, "SECURITY_AGENT_POLICIES_VERSION"
    )
    windows_ddnpm_driver, windows_ddnpm_version, windows_ddnpm_shasum = _get_windows_ddnpm_release_json_info(
        release_json, new_version.major, is_first_rc=(new_version.rc == 1)
    )
    return _update_release_json_entry(
        release_json,
        release_entry,
        integrations_version,
        omnibus_software_version,
        omnibus_ruby_version,
        jmxfetch_version,
        security_agent_policies_version,
        macos_build_version,
        windows_ddnpm_driver,
        windows_ddnpm_version,
        windows_ddnpm_shasum,
    )
def _update_release_json ( release_json , release_entry , new_version : Version , max_version : Version , github_token ) : allowed_major_versions = COMPATIBLE_MAJOR_VERSIONS [ new_version . major ] compatible_version_re = build_compatible_version_re ( allowed_major_versions , new_version . minor ) check_for_rc = not new_version . is_rc ( ) integrations_version = _fetch_dependency_repo_version ( "integrations-core" , new_version , max_version , allowed_major_versions , compatible_version_re , github_token , check_for_rc , ) omnibus_software_version = _fetch_dependency_repo_version ( "omnibus-software" , new_version , max_version , allowed_major_versions , compatible_version_re , github_token , check_for_rc , ) omnibus_ruby_version = _fetch_dependency_repo_version ( "omnibus-ruby" , new_version , max_version , allowed_major_versions , compatible_version_re , github_token , check_for_rc , ) macos_build_version = _fetch_dependency_repo_version ( "datadog-agent-macos-build" , new_version , max_version , allowed_major_versions , compatible_version_re , github_token , check_for_rc , ) jmxfetch_version = _fetch_independent_dependency_repo_version ( "jmxfetch" , release_json , new_version . major , github_token , "JMXFETCH_VERSION" ) security_agent_policies_version = _fetch_independent_dependency_repo_version ( "security-agent-policies" , release_json , new_version . major , github_token , "SECURITY_AGENT_POLICIES_VERSION" ) windows_ddnpm_driver , windows_ddnpm_version , windows_ddnpm_shasum = _get_windows_ddnpm_release_json_info ( release_json , new_version . major , is_first_rc = ( new_version . rc == 1 ) ) return _update_release_json_entry ( release_json , release_entry , integrations_version , omnibus_software_version , omnibus_ruby_version , jmxfetch_version , security_agent_policies_version , macos_build_version , windows_ddnpm_driver , windows_ddnpm_version , windows_ddnpm_shasum , )
Updates the provided release.json object by fetching compatible versions for all dependencies
of the provided Agent version, constructing the new entry, adding it to the release.json object
and returning it.
Updates the provided release . json object by fetching compatible versions for all dependencies of the provided Agent version constructing the new entry adding it to the release . json object and returning it .
"""
    Updates the provided release.json object by fetching compatible versions for all dependencies
    of the provided Agent version, constructing the new entry, adding it to the release.json object
    and returning it.
    """ # Part 1: repositories which follow the Agent version scheme # For repositories which follow the Agent version scheme, we want to only get # tags with the same minor version, to avoid problems when releasing a patch # version while a minor version release is ongoing. # If the new version is a final version, set the check_for_rc flag to true to warn if a dependency's version # is an RC. # Part 2: repositories which have their own version scheme # Add new entry to the release.json object and return it
release_json
release_entry
new_version
Version
max_version
Version
github_token