From 07970b4538aa7afeb9935743edc8fe8dd073a2c5 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Tue, 16 Apr 2024 14:56:39 -0300 Subject: [PATCH] Add unified docs-ci Related to: https://github.com/pulp/pulp-docs/issues/31 [noissue] --- .ci/scripts/check_release.py | 34 +++++------------------------ .github/template_gitref | 2 +- .github/workflows/scripts/script.sh | 2 ++ CHANGES/+new-docs-ci.misc | 1 + doc_requirements.txt | 2 ++ template_config.yml | 2 +- 6 files changed, 12 insertions(+), 31 deletions(-) create mode 100644 CHANGES/+new-docs-ci.misc diff --git a/.ci/scripts/check_release.py b/.ci/scripts/check_release.py index a2d8176af2..8722686c55 100755 --- a/.ci/scripts/check_release.py +++ b/.ci/scripts/check_release.py @@ -82,35 +82,11 @@ def main(): f"{last_tag}", f"origin/{branch}", "--name-only", "--", "requirements.txt" ) if z_changelog or req_txt_diff: - # Blobless clone does not have file contents for Z branches, - # check commit message for last Z bump - git_branch = f"origin/{branch}" - next_version = None - bump_commit = repo.git.log( - "--oneline", - "--grep=Bump version", - "-n 1", - git_branch, - "--", - ".bumpversion.cfg", - ) - if bump_commit: - next_version = bump_commit.split("→ ")[-1] - # If not found - try old-commit-msg - if not next_version: - bump_commit = repo.git.log( - "--oneline", - "--grep=Bump to", - "-n 1", - git_branch, - "--", - ".bumpversion.cfg", - ) - next_version = bump_commit.split("to ")[-1] if bump_commit else None - - # You could, theoretically, be next_vers==None here - but that's always - # been true for this script. - next_version = Version(next_version) + curr_version = Version(last_tag) + assert curr_version.base_version.startswith( + branch + ), "Current-version has to belong to the current branch!" + next_version = Version(f"{branch}.{curr_version.micro + 1}") reason = "CHANGES" if z_changelog else "requirements.txt" print( f"A Z-release is needed for {branch}, " diff --git a/.github/template_gitref b/.github/template_gitref index 9ec4e6fe63..418b21cd48 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-326-ge5addc7 +2021.08.26-327-g6a0d984 diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 043eb0d84d..8534ebf4b1 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -31,6 +31,8 @@ if [[ "$TEST" = "docs" ]]; then if [[ "$GITHUB_WORKFLOW" == "Core CI" ]]; then towncrier build --yes --version 4.0.0.ci fi + # Unified Docs Build + pulp-docs build # Legacy Docs Build cd docs make PULP_URL="$PULP_URL" diagrams html diff --git a/CHANGES/+new-docs-ci.misc b/CHANGES/+new-docs-ci.misc new file mode 100644 index 0000000000..91a1571859 --- /dev/null +++ b/CHANGES/+new-docs-ci.misc @@ -0,0 +1 @@ +Added the Unified Docs CI build-check on PRs. diff --git a/doc_requirements.txt b/doc_requirements.txt index d7fcb90c07..d634a03fb6 100644 --- a/doc_requirements.txt +++ b/doc_requirements.txt @@ -16,3 +16,5 @@ sphinxcontrib-openapi mistune<4.0.0 Jinja2<3.2 # Extra requirements +# Unified docs +pulp-docs @ git+https://github.com/pulp/pulp-docs@main diff --git a/template_config.yml b/template_config.yml index 67779fd9f8..dc5bfb2ce3 100644 --- a/template_config.yml +++ b/template_config.yml @@ -109,5 +109,5 @@ test_reroute: true test_s3: true use_issue_template: true use_legacy_docs: true -use_unified_docs: false +use_unified_docs: true