tasks/release.py
def add_dca_prelude(ctx, version, agent7_version, agent6_version=""):
    """
    Release of the Cluster Agent should be pinned to a version of the Agent.
    """
    res = ctx.run(f"reno --rel-notes-dir releasenotes-dca new prelude-release-{version}")
    new_releasenote = res.stdout.split(' ')[-1].strip()  # get the new releasenote file path

    if agent6_version != "":
        agent6_version = (
            f"--{agent6_version.replace('.', '')}"  # generate the right hyperlink to the agent's changelog.
        )

    with open(new_releasenote, "w") as f:
        f.write(
            f"""prelude:
    |
    Released on: {date.today()}
    Pinned to datadog-agent v{agent7_version}: `CHANGELOG <https://github.com/{REPOSITORY_NAME}/blob/{DEFAULT_BRANCH}/CHANGELOG.rst#{agent7_version.replace('.', '')}{agent6_version}>`_."""
        )

    ctx.run(f"git add {new_releasenote}")
    print("\nCommit this with:")
    print(f"git commit -m \"Add prelude for {version} release\"")

    Release of the Cluster Agent should be pinned to a version of the Agent.
    
Release of the Cluster Agent should be pinned to a version of the Agent.
Release of the Cluster Agent should be pinned to a version of the Agent .
def add_dca_prelude(ctx, version, agent7_version, agent6_version=""):
    res = ctx.run(f"reno --rel-notes-dir releasenotes-dca new prelude-release-{version}")
    new_releasenote = res.stdout.split(' ')[-1].strip()  
    if agent6_version != "":
        agent6_version = (
            f"--{agent6_version.replace('.', '')}"  
        )
    with open(new_releasenote, "w") as f:
        f.write(
            f"""prelude:
    |
    Released on: {date.today()}
    Pinned to datadog-agent v{agent7_version}: `CHANGELOG <https://github.com/{REPOSITORY_NAME}/blob/{DEFAULT_BRANCH}/CHANGELOG.rst#{agent7_version.replace('.', '')}{agent6_version}>`_."""
        )
    ctx.run(f"git add {new_releasenote}")
    print("\nCommit this with:")
    print(f"git commit -m \"Add prelude for {version} release\"")
def add_dca_prelude ( ctx , version , agent7_version , agent6_version = "" ) : res = ctx . run ( f"reno --rel-notes-dir releasenotes-dca new prelude-release-{version}" ) new_releasenote = res . stdout . split ( ' ' ) [ - 1 ] . strip ( ) if agent6_version != "" : agent6_version = ( f"--{agent6_version.replace('.', '')}" ) with open ( new_releasenote , "w" ) as f : f . write ( f"""prelude:
    |
    Released on: {date.today()}
    Pinned to datadog-agent v{agent7_version}: `CHANGELOG <https://github.com/{REPOSITORY_NAME}/blob/{DEFAULT_BRANCH}/CHANGELOG.rst#{agent7_version.replace('.', '')}{agent6_version}>`_.""" ) ctx . run ( f"git add {new_releasenote}" ) print ( "\nCommit this with:" ) print ( f"git commit -m \"Add prelude for {version} release\"" )
Release of the Cluster Agent should be pinned to a version of the Agent.
Release of the Cluster Agent should be pinned to a version of the Agent .
"""
    Release of the Cluster Agent should be pinned to a version of the Agent.
    """ # get the new releasenote file path # generate the right hyperlink to the agent's changelog.
ctx
version
agent7_version
agent6_version