diff --git a/.github/template_gitref b/.github/template_gitref index 9122ea225..d98f4b245 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-339-gf0d923e +2021.08.26-342-g13e7dc5 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b24b539f..20d633ba8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,13 @@ jobs: run: | python3 setup.py sdist bdist_wheel --python-tag py3 twine check dist/* + - name: "Install built packages" + run: | + pip install dist/pulp_rpm-*-py3-none-any.whl + - name: "Generate api specs" + run: | + pulpcore-manager openapi --file "api.json" + pulpcore-manager openapi --bindings --component "rpm" --file "rpm-api.json" - name: "Upload Package whl" uses: "actions/upload-artifact@v4" with: @@ -43,3 +50,13 @@ jobs: if-no-files-found: "error" retention-days: 5 overwrite: true + - name: "Upload API specs" + uses: "actions/upload-artifact@v4" + with: + name: "api_spec" + path: | + pulp_rpm/api.json + pulp_rpm/rpm-api.json + if-no-files-found: "error" + retention-days: 5 + overwrite: true diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 31a0760a3..3de32229a 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -54,64 +54,38 @@ cmd_prefix bash -c "chmod 600 ~pulp/.netrc" # Generate and install binding pushd ../pulp-openapi-generator -if pulp debug has-plugin --name "core" --specifier ">=3.44.0.dev" -then - # Use app_label to generate api.json and package to produce the proper package name. +# Use app_label to generate api.json and package to produce the proper package name. - if [ "$(jq -r '.domain_enabled' <<<"$REPORTED_STATUS")" = "true" ] - then - # Workaround: Domains are not supported by the published bindings. - # Generate new bindings for all packages. - for item in $(jq -r '.versions[] | tojson' <<<"$REPORTED_STATUS") - do - echo $item - COMPONENT="$(jq -r '.component' <<<"$item")" - VERSION="$(jq -r '.version' <<<"$item")" - MODULE="$(jq -r '.module' <<<"$item")" - PACKAGE="${MODULE%%.*}" - curl --fail-with-body -k -o api.json "${PULP_URL}${PULP_API_ROOT}api/v3/docs/api.json?bindings&component=$COMPONENT" - USE_LOCAL_API_JSON=1 ./generate.sh "${PACKAGE}" python "${VERSION}" - cmd_prefix pip3 install "/root/pulp-openapi-generator/${PACKAGE}-client" - sudo rm -rf "./${PACKAGE}-client" - done - else - # Sadly: Different pulpcore-versions aren't either... - for item in $(jq -r '.versions[]| select(.component!="rpm")| tojson' <<<"$REPORTED_STATUS") - do - echo $item - COMPONENT="$(jq -r '.component' <<<"$item")" - VERSION="$(jq -r '.version' <<<"$item")" - MODULE="$(jq -r '.module' <<<"$item")" - PACKAGE="${MODULE%%.*}" - curl --fail-with-body -k -o api.json "${PULP_URL}${PULP_API_ROOT}api/v3/docs/api.json?bindings&component=$COMPONENT" - USE_LOCAL_API_JSON=1 ./generate.sh "${PACKAGE}" python "${VERSION}" - cmd_prefix pip3 install "/root/pulp-openapi-generator/${PACKAGE}-client" - sudo rm -rf "./${PACKAGE}-client" - done - fi +if [ "$(jq -r '.domain_enabled' <<<"$REPORTED_STATUS")" = "true" ] +then + # Workaround: Domains are not supported by the published bindings. + # Generate new bindings for all packages. + for item in $(jq -r '.versions[] | tojson' <<<"$REPORTED_STATUS") + do + echo $item + COMPONENT="$(jq -r '.component' <<<"$item")" + VERSION="$(jq -r '.version' <<<"$item")" + MODULE="$(jq -r '.module' <<<"$item")" + PACKAGE="${MODULE%%.*}" + cmd_prefix pulpcore-manager openapi --bindings --component "${COMPONENT}" > api.json + ./gen-client.sh api.json "${COMPONENT}" python "${PACKAGE}" + cmd_prefix pip3 install "/root/pulp-openapi-generator/${PACKAGE}-client" + sudo rm -rf "./${PACKAGE}-client" + done else - # Infer the client name from the package name by replacing "-" with "_". - # Use the component to infer the package name on older versions of pulpcore. - - if [ "$(echo "$REPORTED_STATUS" | jq -r '.domain_enabled')" = "true" ] - then - # Workaround: Domains are not supported by the published bindings. - # Generate new bindings for all packages. - for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[]|(.package // ("pulp_" + .component)|sub("pulp_core"; "pulpcore"))|sub("-"; "_")') - do - ./generate.sh "${item}" python - cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client" - sudo rm -rf "./${item}-client" - done - else - # Sadly: Different pulpcore-versions aren't either... - for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[]|select(.component!="rpm")|(.package // ("pulp_" + .component)|sub("pulp_core"; "pulpcore"))|sub("-"; "_")') - do - ./generate.sh "${item}" python - cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client" - sudo rm -rf "./${item}-client" - done - fi + # Sadly: Different pulpcore-versions aren't either... + for item in $(jq -r '.versions[]| select(.component!="rpm")| tojson' <<<"$REPORTED_STATUS") + do + echo $item + COMPONENT="$(jq -r '.component' <<<"$item")" + VERSION="$(jq -r '.version' <<<"$item")" + MODULE="$(jq -r '.module' <<<"$item")" + PACKAGE="${MODULE%%.*}" + cmd_prefix pulpcore-manager openapi --bindings --component "${COMPONENT}" > api.json + ./gen-client.sh api.json "${COMPONENT}" python "${PACKAGE}" + cmd_prefix pip3 install "/root/pulp-openapi-generator/${PACKAGE}-client" + sudo rm -rf "./${PACKAGE}-client" + done fi popd diff --git a/pulp_rpm/tests/functional/api/test_sync.py b/pulp_rpm/tests/functional/api/test_sync.py index 400231b7f..99a357be4 100644 --- a/pulp_rpm/tests/functional/api/test_sync.py +++ b/pulp_rpm/tests/functional/api/test_sync.py @@ -20,7 +20,6 @@ from pulp_rpm.tests.functional.constants import ( AMAZON_MIRROR, - CENTOS7_OPSTOOLS_URL, PULP_TYPE_ADVISORY, PULP_TYPE_MODULEMD, PULP_TYPE_PACKAGE, @@ -741,13 +740,15 @@ def test_sha_checksum(init_and_sync): init_and_sync(url=RPM_SHA_FIXTURE_URL) +@pytest.mark.skip("TODO: Need a new test fixture") @pytest.mark.parallel def test_one_nevra_two_locations_and_checksums(init_and_sync): """Sync a repository known to have one nevra, in two locations, with different content. While 'odd', this is a real-world occurrence. """ - init_and_sync(url=CENTOS7_OPSTOOLS_URL, policy="on_demand") + # init_and_sync(url=CENTOS7_OPSTOOLS_URL, policy="on_demand") + pass @pytest.mark.parallel diff --git a/pulp_rpm/tests/functional/constants.py b/pulp_rpm/tests/functional/constants.py index efa74400c..7281f183a 100644 --- a/pulp_rpm/tests/functional/constants.py +++ b/pulp_rpm/tests/functional/constants.py @@ -604,13 +604,11 @@ RPM_ONLY_METADATA_REPO_URL = urljoin(PULP_FIXTURES_BASE_URL, "rpm-unsigned-meta-only") AMAZON_MIRROR = "http://amazonlinux.us-east-1.amazonaws.com/2/core/latest/x86_64/mirror.list" -CENTOS7_URL = "http://mirror.centos.org/centos-7/7/os/x86_64/" -CENTOS7_OPSTOOLS_URL = "http://mirror.centos.org/centos/7/opstools/x86_64/" CENTOS8_STREAM_BASEOS_URL = "http://vault.centos.org/centos/8-stream/BaseOS/x86_64/os/" CENTOS8_STREAM_APPSTREAM_URL = "http://vault.centos.org/centos/8-stream/AppStream/x86_64/os/" CENTOS9_STREAM_BASEOS_URL = "http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/" CENTOS9_STREAM_APPSTREAM_URL = "http://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/" -EPEL7_URL = "https://dl.fedoraproject.org/pub/epel/7/x86_64/" +EPEL8_URL = "https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/" EPEL8_MIRRORLIST_URL = "https://mirrors.fedoraproject.org/mirrorlist?repo=epel-8&arch=x86_64" F36_KICKSTART_URL = "https://dl.fedoraproject.org/pub/fedora/linux/releases/36/Server/x86_64/os/" RHEL6_KICKSTART_CDN_URL = "https://cdn.redhat.com/content/dist/rhel/server/6/6.10/x86_64/kickstart/" diff --git a/pulp_rpm/tests/performance/test_publish.py b/pulp_rpm/tests/performance/test_publish.py index 88cb9f433..f6518083b 100644 --- a/pulp_rpm/tests/performance/test_publish.py +++ b/pulp_rpm/tests/performance/test_publish.py @@ -25,10 +25,8 @@ RPM_PUBLICATION_PATH, RPM_REMOTE_PATH, RPM_REPO_PATH, - CENTOS7_URL, CENTOS8_STREAM_APPSTREAM_URL, CENTOS8_STREAM_BASEOS_URL, - EPEL7_URL, ) from pulp_rpm.tests.functional.utils import gen_rpm_remote from pulp_rpm.tests.functional.utils import set_up_module as setUpModule # noqa:F401 @@ -150,13 +148,9 @@ def rpm_publish(self, url=RPM_KICKSTART_FIXTURE_URL, policy="on_demand"): ) return publish_task["created_resources"][0] - def test_epel7(self): - """Publish EPEL 7.""" - self.rpm_publish(url=EPEL7_URL) - - def test_centos7(self): - """Publish CentOS 7.""" - self.rpm_publish(url=CENTOS7_URL) + def test_epel8(self): + """Publish EPEL 8.""" + self.rpm_publish(url=EPEL8_URL) def test_centos_8stream_baseos(self): """Publish CentOS 8 BaseOS.""" @@ -195,7 +189,3 @@ def test_centos_8stream_baseos(self): def test_centos8_appstream(self): """Publish CentOS 8 AppStream.""" self.rpm_publish(url=CENTOS8_STREAM_APPSTREAM_URL) - - def test_centos8_baseos(self): - """Publish CentOS 8 BaseOS.""" - self.rpm_publish(url=CENTOS8_STREAM_BASEOS_URL) diff --git a/pulp_rpm/tests/performance/test_pulp_to_pulp.py b/pulp_rpm/tests/performance/test_pulp_to_pulp.py index 6b283bcc8..0847a62f7 100644 --- a/pulp_rpm/tests/performance/test_pulp_to_pulp.py +++ b/pulp_rpm/tests/performance/test_pulp_to_pulp.py @@ -11,7 +11,6 @@ ) from pulp_rpm.tests.functional.constants import ( - CENTOS7_URL, CENTOS8_STREAM_BASEOS_URL, CENTOS8_STREAM_APPSTREAM_URL, ) @@ -128,10 +127,6 @@ def do_test(self, url, policy="on_demand"): added2 = get_added_content_summary(repo2.to_dict()) self.assertDictEqual(added, added2) - def test_centos7_on_demand(self): - """Sync CentOS 7.""" - self.do_test(url=CENTOS7_URL) - def test_centos8_baseos_on_demand(self): """Sync CentOS 8 BaseOS.""" self.do_test(url=CENTOS8_STREAM_BASEOS_URL) diff --git a/pulp_rpm/tests/performance/test_sync.py b/pulp_rpm/tests/performance/test_sync.py index aa2b8b460..ce0bf910d 100644 --- a/pulp_rpm/tests/performance/test_sync.py +++ b/pulp_rpm/tests/performance/test_sync.py @@ -22,7 +22,6 @@ RPM_KICKSTART_FIXTURE_URL, RPM_REMOTE_PATH, RPM_REPO_PATH, - CENTOS7_URL, CENTOS8_STREAM_APPSTREAM_URL, CENTOS8_STREAM_BASEOS_URL, EPEL8_MIRRORLIST_URL, @@ -143,14 +142,10 @@ def rpm_sync( # Check that nothing has changed since the last sync. self.assertEqual(latest_version_href, repo["latest_version_href"]) - def test_centos7_on_demand(self): - """Sync CentOS 7.""" - self.rpm_sync(url=CENTOS7_URL) - @unittest.skip("Skip to avoid failing due to running out of disk space") - def test_centos7_immediate(self): - """Sync CentOS 7 with the immediate policy.""" - self.rpm_sync(url=CENTOS7_URL, policy="immediate") + def test_centos8_baseos_immediate(self): + """Sync CentOS 8 Stream with the immediate policy.""" + self.rpm_sync(url=CENTOS8_STREAM_BASEOS_URL, policy="immediate") def test_centos8_baseos_on_demand(self): """Sync CentOS 8 BaseOS."""