From 0bc2987cee2b228f03d7c9669be84a0237491ecf Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 18 Jul 2023 15:43:05 +0000 Subject: [PATCH] Use ansible-documentation repo for core porting guide As of https://github.com/ansible-community/community-topics/issues/240, the ansible documentation (including porting guides) are stored in a new repository. --- changelogs/fragments/540.yaml | 5 +++++ src/antsibull/changelog.py | 7 ++++--- src/antsibull/constants.py | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/540.yaml diff --git a/changelogs/fragments/540.yaml b/changelogs/fragments/540.yaml new file mode 100644 index 00000000..0632b376 --- /dev/null +++ b/changelogs/fragments/540.yaml @@ -0,0 +1,5 @@ +--- +bugfixes: + - Retrieve the ansible-core Porting Guide from the ansible-documentation + repo. These files are being removed from the ansible-core repo + (https://github.com/ansible-community/antsibull/pull/540). diff --git a/src/antsibull/changelog.py b/src/antsibull/changelog.py index b2820328..940a9c2e 100644 --- a/src/antsibull/changelog.py +++ b/src/antsibull/changelog.py @@ -33,6 +33,7 @@ from semantic_version import Version as SemVer from antsibull.collection_meta import CollectionsMetadata +from antsibull.constants import CORE_PORTING_GUIDE_BASE_URL class ChangelogData: @@ -320,9 +321,9 @@ async def download_changelog( self.changelog = ChangelogData.concatenate(changelogs) async def download_porting_guide(self, aio_session: aiohttp.client.ClientSession): - branch_url = "https://raw.githubusercontent.com/ansible/ansible/devel" - - query_url = f"{branch_url}/{get_porting_guide_filename(self.latest)}" + query_url = ( + f"{CORE_PORTING_GUIDE_BASE_URL}/{get_porting_guide_filename(self.latest)}" + ) async with aio_session.get(query_url) as response: self.porting_guide = await response.read() diff --git a/src/antsibull/constants.py b/src/antsibull/constants.py index 9ba36ca0..369d39f1 100644 --- a/src/antsibull/constants.py +++ b/src/antsibull/constants.py @@ -22,3 +22,7 @@ DOCSITE_COMMUNITY_URL = "https://docs.ansible.com/ansible/latest/community" COLLECTION_EXCLUDE_DIRS = ("docs", "tests") + +CORE_PORTING_GUIDE_BASE_URL = ( + "https://raw.githubusercontent.com/ansible/ansible-documentation/devel" +)