From bc0b54950a5072a94b64a00bd9d689f6bd439654 Mon Sep 17 00:00:00 2001 From: ohemorange Date: Fri, 20 Jun 2025 09:38:34 -0700 Subject: [PATCH] Run changelog generation stage on ubuntu-latest, nightly (#10349) Fixes https://github.com/certbot/certbot/issues/10328 This PR: 1) Moves changelog generation to ubuntu-latest instead of deprecated windows, and 2) Sets it to run nightly so we catch breakages before release day 3) Modifies `update_changelog.py` to also allow `.dev0` version numbers and headings with `main` instead of the date in them, for testing. I could have been more specific about only matching `main` or a date, but that seemed honestly unnecessary. Here is a manually triggered nightly test; the test branch just [removes](https://github.com/certbot/certbot/compare/changelog-gen...nightly-changelog-gen?expand=1) all the other tests for speed: https://dev.azure.com/certbot/certbot/_build/results?buildId=9250&view=results You can download the created changelog artifact here: https://dev.azure.com/certbot/certbot/_build/results?buildId=9250&view=artifacts&pathAsName=false&type=publishedArtifacts --- .azure-pipelines/nightly.yml | 1 + .azure-pipelines/templates/stages/changelog-stage.yml | 4 ++-- tools/extract_changelog.py | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/nightly.yml b/.azure-pipelines/nightly.yml index 7ddefbb97..54dada338 100644 --- a/.azure-pipelines/nightly.yml +++ b/.azure-pipelines/nightly.yml @@ -15,4 +15,5 @@ variables: stages: - template: templates/stages/test-and-package-stage.yml + - template: templates/stages/changelog-stage.yml - template: templates/stages/nightly-deploy-stage.yml diff --git a/.azure-pipelines/templates/stages/changelog-stage.yml b/.azure-pipelines/templates/stages/changelog-stage.yml index 40109baa4..a4d7e569c 100644 --- a/.azure-pipelines/templates/stages/changelog-stage.yml +++ b/.azure-pipelines/templates/stages/changelog-stage.yml @@ -3,13 +3,13 @@ stages: jobs: - job: prepare pool: - vmImage: windows-2019 + vmImage: ubuntu-latest steps: # If we change the output filename from `release_notes.md`, it should also be changed in tools/create_github_release.py - bash: | set -e CERTBOT_VERSION="$(cd certbot/src && python -c "import certbot; print(certbot.__version__)" && cd ~-)" - "${BUILD_REPOSITORY_LOCALPATH}\tools\extract_changelog.py" "${CERTBOT_VERSION}" >> "${BUILD_ARTIFACTSTAGINGDIRECTORY}/release_notes.md" + "${BUILD_REPOSITORY_LOCALPATH}/tools/extract_changelog.py" "${CERTBOT_VERSION}" >> "${BUILD_ARTIFACTSTAGINGDIRECTORY}/release_notes.md" displayName: Prepare changelog - task: PublishPipelineArtifact@1 inputs: diff --git a/tools/extract_changelog.py b/tools/extract_changelog.py index bd718191a..e27ff7246 100755 --- a/tools/extract_changelog.py +++ b/tools/extract_changelog.py @@ -12,8 +12,10 @@ NEW_SECTION_PATTERN = re.compile(r'^##\s*[\d.]+\s*-\s*[\d-]+$') def main(): version = sys.argv[1] + if version.endswith('.dev0'): + version = version[:-5] - section_pattern = re.compile(r'^##\s*{0}\s*-\s*[\d-]+$' + section_pattern = re.compile(r'^##\s*{0}\s*-\s*.*$' .format(version.replace('.', '\\.'))) with open(os.path.join(CERTBOT_ROOT, 'certbot', 'CHANGELOG.md')) as file_h: