diff --git a/.ci/ansible/Containerfile.j2 b/.ci/ansible/Containerfile.j2 index d61722b..482ee27 100644 --- a/.ci/ansible/Containerfile.j2 +++ b/.ci/ansible/Containerfile.j2 @@ -2,32 +2,51 @@ FROM {{ ci_base | default("ghcr.io/pulp/pulp-ci-centos:" + pulp_container_tag) } # Add source directories to container {% for item in plugins %} -{% if item.source.startswith("./") %} -ADD {{ item.source }} {{ item.source }} +{% if item.source.startswith("./") or item.ci_requirements | default(false) %} +ADD ./{{ item.name }} ./{{ item.name }} {% endif %} {% endfor %} # Install python packages # Hacking botocore (https://github.com/boto/botocore/pull/1990) -RUN pip3 install \ -{%- if stream_test | default(false) -%} -{{ " " }}django-storages[sftp] -{%- endif -%} +RUN pip3 install {%- if s3_test | default(false) -%} {{ " " }}django-storages[boto3] git+https://github.com/fabricio-aguiar/botocore.git@fix-100-continue {%- endif -%} {%- if azure_test | default(false) -%} {{ " " }}django-storages[azure]>=1.12.2 {%- endif -%} +{%- if gcp_test | default(false) -%} +{{ " " }}django-storages[google]>=1.13.2 +{%- endif -%} {%- for item in plugins -%} {%- if item.name == "pulp-certguard" -%} {{ " " }}python-dateutil rhsm {%- endif -%} -{{ " " }}"{{ item.source }}" +{{ " " }}{{ item.source }} +{%- if item.ci_requirements | default(false) -%} +{{ " " }}-r ./{{ item.name }}/ci_requirements.txt +{%- endif -%} {%- endfor %} -RUN mkdir -p /etc/nginx/pulp/ +{% if pulp_env is defined and pulp_env %} +{% for key, value in pulp_env.items() %} +ENV {{ key | upper }}={{ value }} +{% endfor %} +{% endif %} + +{% if pulp_scenario_env is defined and pulp_scenario_env %} +{% for key, value in pulp_scenario_env.items() %} +ENV {{ key | upper }}={{ value }} +{% endfor %} +{% endif %} + +USER pulp:pulp +RUN PULP_STATIC_ROOT=/var/lib/operator/static/ PULP_CONTENT_ORIGIN=localhost \ + /usr/local/bin/pulpcore-manager collectstatic --clear --noinput --link +USER root:root + {% for item in plugins %} RUN export plugin_path="$(pip3 show {{ item.name }} | sed -n -e 's/Location: //p')/{{ item.name }}" && \ ln $plugin_path/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true diff --git a/.ci/ansible/settings.py.j2 b/.ci/ansible/settings.py.j2 index 16d3a3a..024df4e 100644 --- a/.ci/ansible/settings.py.j2 +++ b/.ci/ansible/settings.py.j2 @@ -8,7 +8,7 @@ TOKEN_SIGNATURE_ALGORITHM = "ES256" CACHE_ENABLED = True REDIS_HOST = "localhost" REDIS_PORT = 6379 -TELEMETRY = False +ANALYTICS = False {% if api_root is defined %} API_ROOT = {{ api_root | repr }} @@ -26,18 +26,6 @@ API_ROOT = {{ api_root | repr }} {% endfor %} {% endif %} -{% if stream_test | default(false) -%} -REDIRECT_TO_OBJECT_STORAGE = False -DEFAULT_FILE_STORAGE = "pulpcore.app.models.storage.PulpSFTPStorage" -MEDIA_ROOT = "" -SFTP_STORAGE_HOST = "ci-sftp" -SFTP_STORAGE_ROOT = "/storage/" -SFTP_STORAGE_PARAMS = { - "username": "foo", - "key_filename": "/keys/id_ed25519", -} -{%- endif %} - {% if s3_test | default(false) %} DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" MEDIA_ROOT = "" @@ -63,3 +51,10 @@ AZURE_OVERWRITE_FILES = True AZURE_URL_EXPIRATION_SECS = 120 AZURE_CONNECTION_STRING = 'DefaultEndpointsProtocol={{ pulp_scheme }};AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint={{ pulp_scheme }}://ci-azurite:10000/devstoreaccount1;' {% endif %} + +{% if gcp_test | default(false) %} +DEFAULT_FILE_STORAGE = "storages.backends.gcloud.GoogleCloudStorage" +MEDIA_ROOT = "" +GS_BUCKET_NAME = "gcppulp" +GS_CUSTOM_ENDPOINT = "http://ci-gcp:4443" +{% endif %} diff --git a/.ci/ansible/start_container.yaml b/.ci/ansible/start_container.yaml index a05edc0..b19a205 100644 --- a/.ci/ansible/start_container.yaml +++ b/.ci/ansible/start_container.yaml @@ -15,14 +15,6 @@ - ssh - ~/.config/pulp_smash - - name: Generate an OpenSSH keypair - community.crypto.openssh_keypair: - path: ssh/id_ed25519 - type: ed25519 - owner: 700 # pulp in the container - become: true - when: stream_test | default(false) - - name: "Generate Pulp Settings" template: src: settings.py.j2 diff --git a/.ci/assets/release_requirements.txt b/.ci/assets/release_requirements.txt index d1dfa7c..c064e94 100644 --- a/.ci/assets/release_requirements.txt +++ b/.ci/assets/release_requirements.txt @@ -1,4 +1,3 @@ bump2version gitpython -python-redmine towncrier diff --git a/.ci/scripts/calc_deps_lowerbounds.py b/.ci/scripts/calc_deps_lowerbounds.py new file mode 100755 index 0000000..af9b182 --- /dev/null +++ b/.ci/scripts/calc_deps_lowerbounds.py @@ -0,0 +1,34 @@ +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulp_cookbook' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template + +from packaging.requirements import Requirement + + +def main(): + """Calculate the lower bound of dependencies where possible.""" + with open("requirements.txt") as req_file: + for line in req_file: + try: + requirement = Requirement(line) + except ValueError: + print(line.strip()) + else: + for spec in requirement.specifier: + if spec.operator == ">=": + if requirement.name == "pulpcore": + operator = "~=" + else: + operator = "==" + min_version = str(spec)[2:] + print(f"{requirement.name}{operator}{min_version}") + break + else: + print(line.strip()) + + +if __name__ == "__main__": + main() diff --git a/.ci/scripts/check_gettext.sh b/.ci/scripts/check_gettext.sh index 6225f24..7f0ea7b 100755 --- a/.ci/scripts/check_gettext.sh +++ b/.ci/scripts/check_gettext.sh @@ -12,7 +12,6 @@ cd "$(dirname "$(realpath -e "$0")")"/../.. set -uv -# check for imports not from pulpcore.plugin. exclude tests MATCHES=$(grep -n -r --include \*.py "_(f") if [ $? -ne 1 ]; then diff --git a/.ci/scripts/check_release.py b/.ci/scripts/check_release.py new file mode 100755 index 0000000..0681bcf --- /dev/null +++ b/.ci/scripts/check_release.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python + +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulp_cookbook' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template + +import argparse +import re +import os +import yaml +from tempfile import TemporaryDirectory +from packaging.version import Version +from git import Repo + +UPSTREAM_REMOTE = "https://github.com/pulp/pulp_cookbook.git" +DEFAULT_BRANCH = "main" +RELEASE_BRANCH_REGEX = r"^([0-9]+)\.([0-9]+)$" +Y_CHANGELOG_EXTS = [".feature", ".removal", ".deprecation"] +Z_CHANGELOG_EXTS = [".bugfix", ".doc", ".misc"] + + +def main(): + """Check which branches need a release.""" + parser = argparse.ArgumentParser() + parser.add_argument( + "--branches", + default="supported", + help="A comma separated list of branches to check for releases. Can also use keyword: " + "'supported'. Defaults to 'supported', see `ci_update_branches` in " + "`plugin_template.yml`.", + ) + opts = parser.parse_args() + + with TemporaryDirectory() as d: + # Clone from upstream to ensure we have updated branches & main + repo = Repo.clone_from(UPSTREAM_REMOTE, d, filter="blob:none") + heads = [h.split("/")[-1] for h in repo.git.ls_remote("--heads").split("\n")] + available_branches = [h for h in heads if re.search(RELEASE_BRANCH_REGEX, h)] + available_branches.sort(key=lambda ver: Version(ver)) + available_branches.append(DEFAULT_BRANCH) + + branches = opts.branches + if branches == "supported": + with open(f"{d}/template_config.yml", mode="r") as f: + tc = yaml.safe_load(f) + branches = tc["ci_update_branches"] + branches.append(DEFAULT_BRANCH) + else: + branches = branches.split(",") + + if diff := set(branches) - set(available_branches): + print(f"Supplied branches contains non-existent branches! {diff}") + exit(1) + + print(f"Checking for releases on branches: {branches}") + + releases = [] + for branch in branches: + if branch != DEFAULT_BRANCH: + # Check if a Z release is needed + changes = repo.git.ls_tree("-r", "--name-only", f"origin/{branch}", "CHANGES/") + z_release = False + for change in changes.split("\n"): + # Check each changelog file to make sure everything checks out + _, ext = os.path.splitext(change) + if ext in Y_CHANGELOG_EXTS: + print( + f"Warning: A non-backported changelog ({change}) is present in the " + f"{branch} release branch!" + ) + elif ext in Z_CHANGELOG_EXTS: + z_release = True + if z_release: + # Blobless clone does not have file contents for Z branches, + # check commit message for last Z bump + git_branch = f"origin/{branch}" + next_version = repo.git.log( + "--oneline", "--grep=Bump to", "-n 1", git_branch, "--", ".bumpversion.cfg" + ).split("to")[-1] + next_version = Version(next_version) + print( + f"A Z-release is needed for {branch}, " + f"New Version: {next_version.base_version}" + ) + releases.append(next_version) + else: + # Check if a Y release is needed + changes = repo.git.ls_tree("-r", "--name-only", DEFAULT_BRANCH, "CHANGES/") + for change in changes.split("\n"): + _, ext = os.path.splitext(change) + if ext in Y_CHANGELOG_EXTS: + # We don't put Y release bumps in the commit message, check file instead + # The 'current_version' is always the next version to release + next_version = repo.git.grep( + "current_version", DEFAULT_BRANCH, "--", ".bumpversion.cfg" + ).split("=")[-1] + next_version = Version(next_version) + print( + f"A new Y-release is needed! New Version: {next_version.base_version}" + ) + releases.append(next_version) + break + + if len(releases) == 0: + print("No new releases to perform.") + + +if __name__ == "__main__": + main() diff --git a/.ci/scripts/check_requirements.py b/.ci/scripts/check_requirements.py new file mode 100755 index 0000000..16a1f1e --- /dev/null +++ b/.ci/scripts/check_requirements.py @@ -0,0 +1,66 @@ +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulp_cookbook' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template + +import warnings +from pkg_resources import Requirement + + +CHECK_MATRIX = [ + ("requirements.txt", True, True, True), + ("dev_requirements.txt", False, True, False), + ("ci_requirements.txt", False, True, True), + ("doc_requirements.txt", False, True, False), + ("lint_requirements.txt", False, True, True), + ("unittest_requirements.txt", False, True, True), + ("functest_requirements.txt", False, True, True), + ("clitest_requirements.txt", False, True, True), +] + +errors = [] + +for filename, check_upperbound, check_prereleases, check_r in CHECK_MATRIX: + try: + with open(filename, "r") as fd: + for nr, line in enumerate(fd.readlines()): + line = line.strip() + if not line or line.startswith("#"): + continue + try: + req = Requirement.parse(line) + except ValueError: + if line.startswith("git+"): + # The single exception... + if "pulp-smash" not in line: + errors.append(f"{filename}:{nr}: Invalid source requirement: {line}") + elif line.startswith("-r "): + if check_r: + errors.append(f"{filename}:{nr}: Invalid deferred requirement: {line}") + else: + errors.append(f"{filename}:{nr}: Unreadable requirement {line}") + else: + if check_prereleases and req.specifier.prereleases: + # Do not even think about begging for more exceptions! + if ( + not req.name.startswith("opentelemetry") + and req.name != "pulp-cookbook-client" + ): + errors.append(f"{filename}:{nr}: Prerelease versions found in {line}.") + ops = [op for op, ver in req.specs] + spec = str(req.specs) + if "~=" in ops: + warnings.warn(f"{filename}:{nr}: Please avoid using ~= on {req.name}!") + elif "<" not in ops and "<=" not in ops and "==" not in ops: + if check_upperbound: + errors.append(f"{filename}:{nr}: Upper bound missing in {line}.") + except FileNotFoundError: + # skip this test for plugins that don't use this requirements.txt + pass + +if errors: + print("Dependency issues found:") + print("\n".join(errors)) + exit(1) diff --git a/.ci/scripts/collect_changes.py b/.ci/scripts/collect_changes.py new file mode 100755 index 0000000..db8d468 --- /dev/null +++ b/.ci/scripts/collect_changes.py @@ -0,0 +1,101 @@ +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulp_cookbook' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template + +import itertools +import os +import re + +import toml +from git import GitCommandError, Repo +from pkg_resources import parse_version + +# Read Towncrier settings +tc_settings = toml.load("pyproject.toml")["tool"]["towncrier"] + +CHANGELOG_FILE = tc_settings.get("filename", "NEWS.rst") +START_STRING = tc_settings.get( + "start_string", + "\n" + if CHANGELOG_FILE.endswith(".md") + else ".. towncrier release notes start\n", +) +TITLE_FORMAT = tc_settings.get("title_format", "{name} {version} ({project_date})") + + +NAME_REGEX = r".*" +VERSION_REGEX = r"([0-9]+\.[0-9]+\.[0-9][0-9ab]*)" +DATE_REGEX = r"[0-9]{4}-[0-9]{2}-[0-9]{2}" +TITLE_REGEX = ( + "(" + + re.escape( + TITLE_FORMAT.format(name="NAME_REGEX", version="VERSION_REGEX", project_date="DATE_REGEX") + ) + .replace("NAME_REGEX", NAME_REGEX) + .replace("VERSION_REGEX", VERSION_REGEX) + .replace("DATE_REGEX", DATE_REGEX) + + ")" +) + + +def get_changelog(repo, branch): + return repo.git.show(f"{branch}:{CHANGELOG_FILE}") + "\n" + + +def _tokenize_changes(splits): + assert len(splits) % 3 == 0 + for i in range(len(splits) // 3): + title = splits[3 * i] + version = parse_version(splits[3 * i + 1]) + yield [version, title + splits[3 * i + 2]] + + +def split_changelog(changelog): + preamble, rest = changelog.split(START_STRING, maxsplit=1) + split_rest = re.split(TITLE_REGEX, rest) + return preamble + START_STRING + split_rest[0], list(_tokenize_changes(split_rest[1:])) + + +def main(): + repo = Repo(os.getcwd()) + remote = repo.remotes[0] + branches = [ref for ref in remote.refs if re.match(r"^([0-9]+)\.([0-9]+)$", ref.remote_head)] + branches.sort(key=lambda ref: parse_version(ref.remote_head), reverse=True) + branches = [ref.name for ref in branches] + + with open(CHANGELOG_FILE, "r") as f: + main_changelog = f.read() + preamble, main_changes = split_changelog(main_changelog) + old_length = len(main_changes) + + for branch in branches: + print(f"Looking at branch {branch}") + try: + changelog = get_changelog(repo, branch) + except GitCommandError: + print("No changelog found on this branch.") + continue + dummy, changes = split_changelog(changelog) + new_changes = sorted(main_changes + changes, key=lambda x: x[0], reverse=True) + # Now remove duplicates (retain the first one) + main_changes = [new_changes[0]] + for left, right in itertools.pairwise(new_changes): + if left[0] != right[0]: + main_changes.append(right) + + new_length = len(main_changes) + if old_length < new_length: + print(f"{new_length - old_length} new versions have been added.") + with open(CHANGELOG_FILE, "w") as fp: + fp.write(preamble) + for change in main_changes: + fp.write(change[1]) + + repo.git.commit("-m", "Update Changelog", "-m" "[noissue]", CHANGELOG_FILE) + + +if __name__ == "__main__": + main() diff --git a/.flake8 b/.flake8 index 6e80207..4459c7b 100644 --- a/.flake8 +++ b/.flake8 @@ -6,6 +6,8 @@ # For more info visit https://github.com/pulp/plugin_template [flake8] exclude = ./docs/*,*/migrations/* +per-file-ignores = */__init__.py: F401 + ignore = E203,W503,Q000,Q003,D100,D104,D106,D200,D205,D400,D401,D402 max-line-length = 100 diff --git a/.github/template_gitref b/.github/template_gitref index e184d58..e076431 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-179-g8af2847 +2021.08.26-248-g4bfc3e1 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 104dfd7..6014ed1 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -24,13 +24,11 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit - fetch-depth: 0 + fetch-depth: 1 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a557ed1..8c01497 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,46 +8,54 @@ --- name: Cookbook CI on: {pull_request: {branches: ['*']}} -jobs: +concurrency: + group: ${{ github.ref_name }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + ready-to-ship: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: "3.8" + + - name: Verify requirements files + run: python .ci/scripts/check_requirements.py single_commit: + runs-on: ubuntu-latest name: Assert single commit if: github.base_ref == 'main' steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 30 - - name: Checkout main - run: git fetch origin main - - name: create local main branch - run: git branch main origin/main - - name: Commit Count Check - run: test `git log --oneline --no-merges HEAD ^main | wc -l ` = 1 - runs-on: ubuntu-latest + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Checkout main + run: git fetch origin main + - name: create local main branch + run: git branch main origin/main + - name: Commit Count Check + run: test `git log --oneline --no-merges HEAD ^main | wc -l ` = 1 lint: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit - fetch-depth: 0 - - - uses: actions/setup-python@v3 + fetch-depth: 1 + - uses: actions/setup-python@v4 with: python-version: "3.8" - - # lint_requirements contains tools needed for flake8, etc. + # lint_requirements contains tools needed for flake8, etc. - name: Install requirements run: pip3 install -r lint_requirements.txt - - # run black separately from flake8 to get a diff - name: Run black run: | @@ -71,9 +79,6 @@ jobs: - name: Check for gettext problems run: sh .ci/scripts/check_gettext.sh - - name: Verify upper bound requirements - run: python .ci/scripts/upper_bound.py - test: runs-on: ubuntu-latest # run only after lint finishes @@ -86,19 +91,19 @@ jobs: - TEST: docs - TEST: azure - TEST: s3 + - TEST: lowerbounds outputs: deprecations-pulp: ${{ steps.deprecations.outputs.deprecations-pulp }} deprecations-azure: ${{ steps.deprecations.outputs.deprecations-azure }} deprecations-s3: ${{ steps.deprecations.outputs.deprecations-s3 }} + deprecations-lowerbounds: ${{ steps.deprecations.outputs.deprecations-lowerbounds }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit - fetch-depth: 0 + fetch-depth: 1 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" @@ -114,7 +119,6 @@ jobs: echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV - name: Before Install - run: .github/workflows/scripts/before_install.sh shell: bash env: @@ -128,7 +132,6 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - name: Install - run: .github/workflows/scripts/install.sh shell: bash env: @@ -141,13 +144,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - - name: Install Python client - - run: .github/workflows/scripts/install_python_client.sh - shell: bash - - name: Before Script - run: .github/workflows/scripts/before_script.sh shell: bash env: @@ -168,7 +165,6 @@ jobs: SECRETS_CONTEXT: ${{ toJson(secrets) }} - name: Script - run: .github/workflows/scripts/script.sh shell: bash env: @@ -183,7 +179,7 @@ jobs: - name: Extract Deprecations from Logs id: deprecations - run: echo "::set-output name=deprecations-${{ matrix.env.TEST }}::$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0)" + run: echo deprecations-${{ matrix.env.TEST }}=$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0) >> $GITHUB_OUTPUT - name: Logs if: always() @@ -198,7 +194,7 @@ jobs: docker exec pulp bash -c "pip3 list && pip3 install pipdeptree && pipdeptree" deprecations: runs-on: ubuntu-latest - if: always() + if: github.base_ref == 'main' needs: test steps: - name: Fail on deprecations @@ -206,11 +202,13 @@ jobs: test -z "${{ needs.test.outputs.deprecations-pulp }}" test -z "${{ needs.test.outputs.deprecations-azure }}" test -z "${{ needs.test.outputs.deprecations-s3 }}" + test -z "${{ needs.test.outputs.deprecations-lowerbounds }}" - name: Print deprecations if: failure() run: | echo "${{ needs.test.outputs.deprecations-pulp }}" | base64 -d echo "${{ needs.test.outputs.deprecations-azure }}" | base64 -d echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d + echo "${{ needs.test.outputs.deprecations-lowerbounds }}" | base64 -d diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index dda14de..bb24faa 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -4,13 +4,17 @@ # './plugin-template --github pulp_cookbook' to update this file. # # For more info visit https://github.com/pulp/plugin_template -name: "CodeQL" +name: "Cookbook CodeQL" on: workflow_dispatch: schedule: - cron: '37 1 * * 6' +concurrency: + group: ${{ github.ref_name }}-${{ github.workflow }} + cancel-in-progress: true + jobs: analyze: name: Analyze diff --git a/.github/workflows/create-branch.yml b/.github/workflows/create-branch.yml index 52c9369..3c2d08b 100644 --- a/.github/workflows/create-branch.yml +++ b/.github/workflows/create-branch.yml @@ -9,10 +9,6 @@ name: Create New Release Branch on: workflow_dispatch: - inputs: - name: - description: "Branch name (e.g. 3.14)" - required: true env: RELEASE_WORKFLOW: true @@ -25,50 +21,59 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit fetch-depth: 0 + path: pulp_cookbook - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" - name: Install python dependencies run: | echo ::group::PYDEPS - pip install bump2version + pip install bump2version jinja2 pyyaml echo ::endgroup:: - name: Setting secrets - + working-directory: pulp_cookbook run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" env: SECRETS_CONTEXT: ${{ toJson(secrets) }} - - name: Verify that branch name matches current version string on main branch + - name: Determine new branch name + working-directory: pulp_cookbook run: | - X_Y_VERSION=$(grep version setup.py | sed -rn 's/version="(.*)\.0((a[0-9]+)|(b[0-9]+))?\.dev",/\1/p' | awk '{$1=$1};1') - if [[ "$X_Y_VERSION" != "${{ github.event.inputs.name }}" ]] + # Just to be sure... + git checkout main + NEW_BRANCH="$(bump2version --dry-run --list release | sed -Ene 's/^new_version=([[:digit:]]+\.[[:digit:]]+)\..*$/\1/p')" + if [ -z "$NEW_BRANCH" ] then - echo "Branch name doesn't match the current version string $X_Y_VERSION." + echo Could not determine the new branch name. exit 1 fi + echo "NEW_BRANCH=${NEW_BRANCH}" >> "$GITHUB_ENV" - - name: Create ${{ github.event.inputs.name }} release branch + - name: Create release branch + working-directory: pulp_cookbook run: | - git checkout -b ${{ github.event.inputs.name }} - git push origin ${{ github.event.inputs.name }} + git branch "${NEW_BRANCH}" - name: Bump version on main branch + working-directory: pulp_cookbook run: | - git checkout main bump2version --no-commit minor - - name: Make a PR with version bump + - name: Remove entries from CHANGES directory + working-directory: pulp_cookbook + run: | + find CHANGES -type f -regex ".*\.\(bugfix\|doc\|feature\|misc\|deprecation\|removal\)" -exec git rm {} + + + - name: Make a PR with version bump and without CHANGES/* uses: peter-evans/create-pull-request@v4 with: + path: pulp_cookbook token: ${{ secrets.RELEASE_TOKEN }} committer: pulpbot author: pulpbot @@ -80,3 +85,8 @@ jobs: Bump minor version [noissue] delete-branch: true + + - name: Push release branch + working-directory: pulp_cookbook + run: | + git push origin "${NEW_BRANCH}" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 58aec21..bef2381 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -6,7 +6,7 @@ # For more info visit https://github.com/pulp/plugin_template --- -name: Cookbook Nightly CI/CD +name: Cookbook Nightly CI on: schedule: # * is a special character in YAML so you have to quote this string @@ -14,6 +14,10 @@ on: - cron: '00 3 * * *' workflow_dispatch: +concurrency: + group: ${{ github.ref_name }}-${{ github.workflow }} + cancel-in-progress: true + jobs: test: runs-on: ubuntu-latest @@ -26,16 +30,16 @@ jobs: - TEST: docs - TEST: azure - TEST: s3 + - TEST: generate-bindings + - TEST: lowerbounds steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit - fetch-depth: 0 + fetch-depth: 1 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" @@ -51,7 +55,6 @@ jobs: echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV - name: Before Install - run: .github/workflows/scripts/before_install.sh shell: bash env: @@ -70,7 +73,6 @@ jobs: ruby-version: "2.6" - name: Install - run: .github/workflows/scripts/install.sh shell: bash env: @@ -84,7 +86,6 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - name: Before Script - run: .github/workflows/scripts/before_script.sh shell: bash env: @@ -99,13 +100,11 @@ jobs: REDIS_DISABLED: ${{ contains('', matrix.env.TEST) }} - name: Setting secrets - run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" env: SECRETS_CONTEXT: ${{ toJson(secrets) }} - name: Install Python client - run: .github/workflows/scripts/install_python_client.sh shell: bash @@ -115,7 +114,6 @@ jobs: shell: bash - name: Script - run: .github/workflows/scripts/script.sh shell: bash env: @@ -170,20 +168,18 @@ jobs: changelog: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit fetch-depth: 0 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.11" - name: Install python dependencies run: | echo ::group::PYDEPS - pip install gitpython requests packaging + pip install gitpython toml echo ::endgroup:: - name: Configure Git with pulpbot name and email @@ -191,23 +187,16 @@ jobs: git config --global user.name 'pulpbot' git config --global user.email 'pulp-infra@redhat.com' - - name: Changelog history - run: python .ci/scripts/changelog.py + - name: Collect changes from all branches + run: python .ci/scripts/collect_changes.py - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.RELEASE_TOKEN }} - committer: pulpbot - author: pulpbot title: 'Update Changelog' - body: '[noissue]' + body: '' branch: 'changelog/update' - base: main - commit-message: | - Update Changelog - - [noissue] delete-branch: true publish: @@ -218,18 +207,15 @@ jobs: TEST: publish steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit - fetch-depth: 0 + fetch-depth: 1 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" - uses: ruby/setup-ruby@v1 - with: ruby-version: "2.6" @@ -251,7 +237,6 @@ jobs: echo ::endgroup:: - name: Before Install - run: .github/workflows/scripts/before_install.sh shell: bash env: @@ -265,7 +250,6 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - name: Install - run: .github/workflows/scripts/install.sh shell: bash env: @@ -279,17 +263,14 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - name: Install Python client - run: .github/workflows/scripts/install_python_client.sh shell: bash - name: Install Ruby client - run: .github/workflows/scripts/install_ruby_client.sh shell: bash - name: Before Script - run: .github/workflows/scripts/before_script.sh shell: bash env: @@ -304,38 +285,11 @@ jobs: REDIS_DISABLED: ${{ contains('', matrix.env.TEST) }} - name: Setting secrets - run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" env: SECRETS_CONTEXT: ${{ toJson(secrets) }} - - name: Download Ruby client - uses: actions/download-artifact@v3 - with: - name: ruby-client.tar - - - name: Untar Ruby client packages - run: tar -xvf ruby-client.tar - - - name: Publish client to rubygems - run: bash .github/workflows/scripts/publish_client_gem.sh - - - - - name: Download Python client - uses: actions/download-artifact@v3 - with: - name: python-client.tar - - - name: Untar python client packages - run: tar -xvf python-client.tar - - - name: Publish client to pypi - run: bash .github/workflows/scripts/publish_client_pypi.sh - - - - name: Download built docs uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54fa26e..e927ef4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ # For more info visit https://github.com/pulp/plugin_template --- -name: Release Pipeline +name: Cookbook Release Pipeline on: workflow_dispatch: inputs: @@ -15,7 +15,7 @@ on: required: true before_script: description: | - Bash code to run before script.sh is executed. This should only be used when re-running + Bash code to run before bindings and docs are built. This should only be used when re-running a workflow to correct some aspect of the docs. e.g.: git checkout origin/3.14 CHANGES.rst required: false @@ -30,20 +30,18 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit fetch-depth: 0 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" - name: Install python dependencies run: | echo ::group::PYDEPS - pip install bandersnatch bump2version gitpython python-redmine towncrier==19.9.0 wheel + pip install packaging~=21.3 bump2version gitpython towncrier==19.9.0 wheel requests echo ::endgroup:: - name: Configure Git with pulpbot name and email @@ -52,58 +50,45 @@ jobs: git config --global user.email 'pulp-infra@redhat.com' - name: Setting secrets - run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" env: SECRETS_CONTEXT: ${{ toJson(secrets) }} - - name: Verify upper bound requirements - run: python .ci/scripts/upper_bound.py - - name: Create the release commit, tag it, create a post-release commit, and build plugin package run: python .github/workflows/scripts/release.py ${{ github.event.inputs.release }} - name: 'Tar files' - run: tar -cvf pulp_cookbook.tar $GITHUB_WORKSPACE + run: tar -cvf pulp_cookbook.tar . - name: 'Upload Artifact' uses: actions/upload-artifact@v3 with: name: pulp_cookbook.tar path: pulp_cookbook.tar - test: - needs: build-artifacts - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - env: - - TEST: pulp - - TEST: docs - - TEST: azure - - TEST: s3 - - TEST: generate-bindings + build-bindings-docs: + needs: build-artifacts + runs-on: ubuntu-latest + # Install scripts expect TEST to be set, 'docs' is most appropriate even though we don't run tests + env: + TEST: docs steps: - uses: actions/download-artifact@v3 with: name: pulp_cookbook.tar - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" - uses: ruby/setup-ruby@v1 - with: ruby-version: "2.6" - name: Untar repository run: | - shopt -s dotglob tar -xf pulp_cookbook.tar - mv home/runner/work/pulp_cookbook/pulp_cookbook/* ./ # update to the branch's latest ci files rather than the ones from the release tag. this is # helpful when there was a problem with the ci files during the release which needs to be @@ -120,12 +105,9 @@ jobs: echo ::endgroup:: echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/.ci/assets/httpie/" >> $GITHUB_ENV - - name: Set environment variables - run: | - echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV - + # Building the bindings and docs requires accessing the OpenAPI specs endpoint, so we need to + # setup the Pulp instance. - name: Before Install - run: .github/workflows/scripts/before_install.sh shell: bash env: @@ -153,77 +135,41 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} shell: bash - - name: Before Script - - run: .github/workflows/scripts/before_script.sh + - name: Additional before_script + run: ${{ github.event.inputs.before_script }} shell: bash - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - GITHUB_PULL_REQUEST: ${{ github.event.number }} - GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} - GITHUB_BRANCH: ${{ github.head_ref }} - GITHUB_REPO_SLUG: ${{ github.repository }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - REDIS_DISABLED: ${{ contains('', matrix.env.TEST) }} - - - name: Setting secrets - - run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" - env: - SECRETS_CONTEXT: ${{ toJson(secrets) }} - name: Install Python client - run: .github/workflows/scripts/install_python_client.sh shell: bash - - name: Install Ruby client - if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }} run: .github/workflows/scripts/install_ruby_client.sh shell: bash - - name: Additional before_script - run: ${{ github.event.inputs.before_script }} - shell: bash - - - name: Script - if: ${{ env.TEST != 'generate-bindings' }} - run: .github/workflows/scripts/script.sh - shell: bash - env: - PY_COLORS: '1' - ANSIBLE_FORCE_COLOR: '1' - GITHUB_PULL_REQUEST: ${{ github.event.number }} - GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} - GITHUB_BRANCH: ${{ github.head_ref }} - GITHUB_REPO_SLUG: ${{ github.repository }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - - name: Upload python client packages - if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }} uses: actions/upload-artifact@v3 with: name: python-client.tar path: python-client.tar - name: Upload python client docs - if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }} uses: actions/upload-artifact@v3 with: name: python-client-docs.tar path: python-client-docs.tar - - name: Upload ruby client packages - if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }} uses: actions/upload-artifact@v3 with: name: ruby-client.tar path: ruby-client.tar + - name: Build docs + run: | + export DJANGO_SETTINGS_MODULE=pulpcore.app.settings + export PULP_SETTINGS=$PWD/.ci/ansible/settings/settings.py + make -C docs/ PULP_URL="https://pulp" diagrams html + tar -cvf docs/docs.tar docs/_build + - name: Upload built docs - if: ${{ env.TEST == 'docs' }} uses: actions/upload-artifact@v3 with: name: docs.tar @@ -244,7 +190,7 @@ jobs: publish: runs-on: ubuntu-latest - needs: test + needs: build-bindings-docs env: TEST: publish @@ -255,12 +201,11 @@ jobs: with: name: pulp_cookbook.tar - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" - uses: ruby/setup-ruby@v1 - with: ruby-version: "2.6" @@ -271,9 +216,7 @@ jobs: - name: Untar repository run: | - shopt -s dotglob tar -xf pulp_cookbook.tar - mv home/runner/work/pulp_cookbook/pulp_cookbook/* ./ # update to the branch's latest ci files rather than the ones from the release tag. this is # helpful when there was a problem with the ci files during the release which needs to be @@ -284,7 +227,6 @@ jobs: git checkout "origin/${GITHUB_REF##*/}" -- .github - name: Setting secrets - run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT" env: SECRETS_CONTEXT: ${{ toJson(secrets) }} @@ -292,7 +234,7 @@ jobs: - name: Install python dependencies run: | echo ::group::PYDEPS - pip install gitpython python-redmine requests packaging tweepy + pip install gitpython requests packaging~=21.3 tweepy echo ::endgroup:: - name: Push branch and tag to GitHub @@ -309,7 +251,7 @@ jobs: - name: Publish docs to pulpproject.org run: | - tar -xvf docs.tar -C ./docs + tar -xvf docs.tar .github/workflows/scripts/publish_docs.sh tag ${{ github.event.inputs.release }} - name: Deploy plugin to pypi run: bash .github/workflows/scripts/publish_plugin_pypi.sh ${{ github.event.inputs.release }} @@ -334,8 +276,6 @@ jobs: - name: Publish client to rubygems run: bash .github/workflows/scripts/publish_client_gem.sh - - - name: Update GitHub continue-on-error: true run: | @@ -353,25 +293,3 @@ jobs: - name: Create release on GitHub run: bash .github/workflows/scripts/create_release_from_tag.sh ${{ github.event.inputs.release }} - - - name: Cleanup repository before making changelog PR - run: rm -rf .lock generation pulp_cookbook_client* *-client.tar pulp_cookbook.tar todo web *docs.tar - - - name: Stage changelog for main branch - run: python .github/workflows/scripts/stage-changelog-for-default-branch.py ${{ github.event.inputs.release }} - - - name: Create Pull Request for Changelog - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.RELEASE_TOKEN }} - committer: pulpbot - author: pulpbot - branch: changelog/${{ github.event.inputs.release }} - base: main - title: 'Cherry pick ${{ github.event.inputs.release }} changelog' - body: '[noissue]' - commit-message: | - ${{ github.event.inputs.release }} changelog - - [noissue] - delete-branch: true diff --git a/.github/workflows/scripts/before_install.sh b/.github/workflows/scripts/before_install.sh index 136d38a..20c9457 100755 --- a/.github/workflows/scripts/before_install.sh +++ b/.github/workflows/scripts/before_install.sh @@ -30,11 +30,8 @@ fi COMMIT_MSG=$(git log --format=%B --no-merges -1) export COMMIT_MSG -if [[ "$TEST" == "plugin-from-pypi" ]]; then - COMPONENT_VERSION=$(http https://pypi.org/pypi/pulp-cookbook/json | jq -r '.info.version') -else - COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py) -fi +COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py) + mkdir .ci/ansible/vars || true echo "---" > .ci/ansible/vars/main.yaml echo "legacy_component_name: pulp_cookbook" >> .ci/ansible/vars/main.yaml @@ -48,62 +45,20 @@ if [ -f $PRE_BEFORE_INSTALL ]; then source $PRE_BEFORE_INSTALL fi -if [[ -n $(echo -e $COMMIT_MSG | grep -P "Required PR:.*" | grep -v "https") ]]; then - echo "Invalid Required PR link detected in commit message. Please use the full https url." +if [[ -n $(echo -e $COMMIT_MSG | grep -P "Required PR:.*") ]]; then + echo "The Required PR mechanism has been removed. Consider adding a scm requirement to requirements.txt." exit 1 fi if [ "$GITHUB_EVENT_NAME" = "pull_request" ] || [ "${BRANCH_BUILD}" = "1" -a "${BRANCH}" != "main" ] then - export PULPCORE_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore\/pull\/(\d+)' | awk -F'/' '{print $7}') - export PULP_SMASH_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-smash\/pull\/(\d+)' | awk -F'/' '{print $7}') - export PULP_OPENAPI_GENERATOR_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-openapi-generator\/pull\/(\d+)' | awk -F'/' '{print $7}') - export PULP_CLI_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-cli\/pull\/(\d+)' | awk -F'/' '{print $7}') echo $COMMIT_MSG | sed -n -e 's/.*CI Base Image:\s*\([-_/[:alnum:]]*:[-_[:alnum:]]*\).*/ci_base: "\1"/p' >> .ci/ansible/vars/main.yaml -else - export PULPCORE_PR_NUMBER= - export PULP_SMASH_PR_NUMBER= - export PULP_OPENAPI_GENERATOR_PR_NUMBER= - export PULP_CLI_PR_NUMBER= - export CI_BASE_IMAGE= fi cd .. - -git clone --depth=1 https://github.com/pulp/pulp-smash.git - -if [ -n "$PULP_SMASH_PR_NUMBER" ]; then - cd pulp-smash - git fetch --depth=1 origin pull/$PULP_SMASH_PR_NUMBER/head:$PULP_SMASH_PR_NUMBER - git checkout $PULP_SMASH_PR_NUMBER - cd .. -fi - -pip install --upgrade --force-reinstall ./pulp-smash - - git clone --depth=1 https://github.com/pulp/pulp-openapi-generator.git -if [ -n "$PULP_OPENAPI_GENERATOR_PR_NUMBER" ]; then - cd pulp-openapi-generator - git fetch origin pull/$PULP_OPENAPI_GENERATOR_PR_NUMBER/head:$PULP_OPENAPI_GENERATOR_PR_NUMBER - git checkout $PULP_OPENAPI_GENERATOR_PR_NUMBER - cd .. -fi - - - -git clone --depth=1 https://github.com/pulp/pulpcore.git --branch main - -cd pulpcore - -if [ -n "$PULPCORE_PR_NUMBER" ]; then - git fetch --depth=1 origin pull/$PULPCORE_PR_NUMBER/head:$PULPCORE_PR_NUMBER - git checkout $PULPCORE_PR_NUMBER -fi -cd .. - # Intall requirements for ansible playbooks pip install docker netaddr boto3 ansible @@ -120,6 +75,11 @@ fi cd pulp_cookbook +if [[ "$TEST" = "lowerbounds" ]]; then + python3 .ci/scripts/calc_deps_lowerbounds.py > lowerbounds_requirements.txt + mv lowerbounds_requirements.txt requirements.txt +fi + if [ -f $POST_BEFORE_INSTALL ]; then source $POST_BEFORE_INSTALL fi diff --git a/.github/workflows/scripts/before_script.sh b/.github/workflows/scripts/before_script.sh index 3e2828f..2bc0143 100755 --- a/.github/workflows/scripts/before_script.sh +++ b/.github/workflows/scripts/before_script.sh @@ -29,14 +29,17 @@ tail -v -n +1 .ci/ansible/vars/main.yaml echo "PULP CONFIG:" tail -v -n +1 .ci/ansible/settings/settings.* ~/.config/pulp_smash/settings.json +echo "Containerfile:" +tail -v -n +1 .ci/ansible/Containerfile + # Needed for some functional tests cmd_prefix bash -c "echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/nopasswd" cmd_prefix bash -c "usermod -a -G wheel pulp" -SCENARIOS=("pulp" "performance" "azure" "s3" "stream" "plugin-from-pypi" "generate-bindings") +SCENARIOS=("pulp" "performance" "azure" "gcp" "s3" "generate-bindings" "lowerbounds") if [[ " ${SCENARIOS[*]} " =~ " ${TEST} " ]]; then # Many functional tests require these - cmd_prefix dnf install -yq lsof which dnf-plugins-core + cmd_prefix dnf install -yq lsof which fi if [[ "${REDIS_DISABLED:-false}" == true ]]; then @@ -47,3 +50,7 @@ fi if [[ -f $POST_BEFORE_SCRIPT ]]; then source $POST_BEFORE_SCRIPT fi + +# Lots of plugins try to use this path, and throw warnings if they cannot access it. +cmd_prefix mkdir /.pytest_cache +cmd_prefix chown pulp:pulp /.pytest_cache diff --git a/.github/workflows/scripts/install.sh b/.github/workflows/scripts/install.sh index 2f0a328..4b0902a 100755 --- a/.github/workflows/scripts/install.sh +++ b/.github/workflows/scripts/install.sh @@ -17,56 +17,41 @@ source .github/workflows/scripts/utils.sh export PULP_API_ROOT="/pulp/" -if [[ "$TEST" = "docs" || "$TEST" = "publish" ]]; then - pip install -r ../pulpcore/doc_requirements.txt - pip install -r doc_requirements.txt +PIP_REQUIREMENTS=("pulp-cli") +if [[ "$TEST" = "docs" || "$TEST" = "publish" ]] +then + PIP_REQUIREMENTS+=("-r" "doc_requirements.txt") fi +pip install ${PIP_REQUIREMENTS[*]} + + + cd .ci/ansible/ -TAG=ci_build -PULPCORE=./pulpcore -if [[ "$TEST" == "plugin-from-pypi" ]]; then - PLUGIN_NAME=pulp_cookbook -elif [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then +if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then PLUGIN_NAME=./pulp_cookbook/dist/pulp_cookbook-$PLUGIN_VERSION-py3-none-any.whl else PLUGIN_NAME=./pulp_cookbook fi -if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then - # Install the plugin only and use published PyPI packages for the rest - # Quoting ${TAG} ensures Ansible casts the tag as a string. - cat >> vars/main.yaml << VARSYAML +cat >> vars/main.yaml << VARSYAML image: name: pulp - tag: "${TAG}" + tag: "ci_build" plugins: - - name: pulpcore - source: pulpcore - name: pulp_cookbook - source: "${PLUGIN_NAME}" - - name: pulp-smash - source: ./pulp-smash + source: "${PLUGIN_NAME}" VARSYAML -else +if [[ -f ../../ci_requirements.txt ]]; then cat >> vars/main.yaml << VARSYAML -image: - name: pulp - tag: "${TAG}" -plugins: - - name: pulp_cookbook - source: "${PLUGIN_NAME}" - - name: pulpcore - source: "${PULPCORE}" - - name: pulp-smash - source: ./pulp-smash + ci_requirements: true VARSYAML fi cat >> vars/main.yaml << VARSYAML services: - name: pulp - image: "pulp:${TAG}" + image: "pulp:ci_build" volumes: - ./settings:/etc/pulp - ./ssh:/keys/ @@ -74,13 +59,15 @@ services: - ../../../pulp-openapi-generator:/root/pulp-openapi-generator env: PULP_WORKERS: "4" + PULP_HTTPS: "true" VARSYAML cat >> vars/main.yaml << VARSYAML +pulp_env: {} pulp_settings: null pulp_scheme: https -pulp_container_tag: https +pulp_container_tag: "latest" VARSYAML @@ -98,6 +85,7 @@ if [ "$TEST" = "s3" ]; then minio_access_key: "'$MINIO_ACCESS_KEY'"\ minio_secret_key: "'$MINIO_SECRET_KEY'"\ pulp_scenario_settings: null\ +pulp_scenario_env: {}\ ' vars/main.yaml export PULP_API_ROOT="/rerouted/djnd/" fi @@ -117,6 +105,7 @@ if [ "$TEST" = "azure" ]; then command: "azurite-blob --blobHost 0.0.0.0 --cert /etc/pulp/azcert.pem --key /etc/pulp/azkey.pem"' vars/main.yaml sed -i -e '$a azure_test: true\ pulp_scenario_settings: null\ +pulp_scenario_env: {}\ ' vars/main.yaml fi @@ -126,6 +115,9 @@ if [ "${PULP_API_ROOT:-}" ]; then sed -i -e '$a api_root: "'"$PULP_API_ROOT"'"' vars/main.yaml fi +pulp config create --base-url https://pulp --api-root "$PULP_API_ROOT" + + ansible-playbook build_container.yaml ansible-playbook start_container.yaml @@ -133,7 +125,8 @@ ansible-playbook start_container.yaml # files will likely be modified on the host by post/pre scripts. chmod 777 ~/.config/pulp_smash/ chmod 666 ~/.config/pulp_smash/settings.json -sudo chown -R 700:700 ~runner/.config + +sudo chown -R 700:700 ~/.config echo ::group::SSL # Copy pulp CA sudo docker cp pulp:/etc/pulp/certs/pulp_webserver.crt /usr/local/share/ca-certificates/pulp_webserver.crt diff --git a/.github/workflows/scripts/publish_docs.sh b/.github/workflows/scripts/publish_docs.sh index cd9bad7..a1d8db0 100755 --- a/.github/workflows/scripts/publish_docs.sh +++ b/.github/workflows/scripts/publish_docs.sh @@ -17,8 +17,8 @@ touch ~/.ssh/pulp-infra chmod 600 ~/.ssh/pulp-infra echo "$PULP_DOCS_KEY" > ~/.ssh/pulp-infra -echo "docs.pulpproject.org,8.43.85.236 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGXG+8vjSQvnAkq33i0XWgpSrbco3rRqNZr0SfVeiqFI7RN/VznwXMioDDhc+hQtgVhd6TYBOrV07IMcKj+FAzg=" >> /home/runner/.ssh/known_hosts -chmod 644 /home/runner/.ssh/known_hosts +echo "docs.pulpproject.org,8.43.85.236 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGXG+8vjSQvnAkq33i0XWgpSrbco3rRqNZr0SfVeiqFI7RN/VznwXMioDDhc+hQtgVhd6TYBOrV07IMcKj+FAzg=" >> ~/.ssh/known_hosts +chmod 644 ~/.ssh/known_hosts pip3 install packaging diff --git a/.github/workflows/scripts/release.py b/.github/workflows/scripts/release.py index 5fee545..8e03e88 100755 --- a/.github/workflows/scripts/release.py +++ b/.github/workflows/scripts/release.py @@ -6,53 +6,35 @@ # For more info visit https://github.com/pulp/plugin_template import argparse -import asyncio import re import os -import shutil import textwrap - -from bandersnatch.mirror import BandersnatchMirror -from bandersnatch.master import Master -from bandersnatch.configuration import BandersnatchConfig +import requests from git import Repo - -from packaging.requirements import Requirement from pathlib import Path -async def get_package_from_pypi(package_name, plugin_path): +def get_package_from_pypi(version, plugin_path): """ Download a package from PyPI. - :param name: name of the package to download from PyPI - :return: String path to the package + :param version: version of the package to download from PyPI + :return: True/False if download was successful """ - config = BandersnatchConfig().config - config["mirror"]["master"] = "https://pypi.org" - config["mirror"]["workers"] = "1" - config["mirror"]["directory"] = plugin_path - if not config.has_section("plugins"): - config.add_section("plugins") - config["plugins"]["enabled"] = "blocklist_release\n" - if not config.has_section("allowlist"): - config.add_section("allowlist") - config["plugins"]["enabled"] += "allowlist_release\nallowlist_project\n" - config["allowlist"]["packages"] = "\n".join([package_name]) os.makedirs(os.path.join(plugin_path, "dist"), exist_ok=True) - async with Master("https://pypi.org/") as master: - mirror = BandersnatchMirror(homedir=plugin_path, master=master) - name = Requirement(package_name).name - result = await mirror.synchronize([name]) - package_found = False - - for package in result[name]: - current_path = os.path.join(plugin_path, package) - destination_path = os.path.join(plugin_path, "dist", os.path.basename(package)) - shutil.move(current_path, destination_path) - package_found = True - return package_found + r = requests.get(f"https://pypi.org/pypi/pulp-cookbook/{version}/json") + if r.status_code == 200: + metadata = r.json() + for url_data in metadata["urls"]: + filename = url_data["filename"] + r2 = requests.get(url_data["url"]) + if r2.status_code != 200: + raise RuntimeError(f"Failed to download released artifact {filename}") + with open(os.path.join(plugin_path, "dist", filename), "wb") as f: + f.write(r2.content) + return True + return False def create_release_commits(repo, release_version, plugin_path): @@ -74,14 +56,12 @@ def create_release_commits(repo, release_version, plugin_path): # Second commit: release version os.system("bump2version release --allow-dirty") - git.add(f"{plugin_path}/{plugin_name}/*") + git.add(f"{plugin_path}/pulp_cookbook/*") git.add(f"{plugin_path}/docs/conf.py") git.add(f"{plugin_path}/setup.py") git.add(f"{plugin_path}/requirements.txt") git.add(f"{plugin_path}/.bumpversion.cfg") - git.commit("-m", f"Release {release_version}\nGH Issues: {issues}\n\n[noissue]") - sha = repo.head.object.hexsha short_sha = git.rev_parse(sha, short=7) @@ -95,13 +75,12 @@ def create_release_commits(repo, release_version, plugin_path): if not new_dev_version: raise RuntimeError("Could not detect new dev version ... aborting.") - git.add(f"{plugin_path}/{plugin_name}/*") + git.add(f"{plugin_path}/pulp_cookbook/*") git.add(f"{plugin_path}/docs/conf.py") git.add(f"{plugin_path}/setup.py") git.add(f"{plugin_path}/requirements.txt") git.add(f"{plugin_path}/.bumpversion.cfg") git.commit("-m", f"Bump to {new_dev_version}\n\n[noissue]") - print(f"Release commit == {short_sha}") print(f"All changes were committed on branch: release_{release_version}") return sha @@ -122,8 +101,8 @@ def create_tag_and_build_package(repo, desired_tag, commit_sha, plugin_path): tag = existing_tag else: raise RuntimeError( - "The '{desired_tag}' tag already exists, but the commit sha does not match " - "'{commit_sha}'." + f"The '{desired_tag}' tag already exists, but the commit sha does not match " + f"'{commit_sha}'." ) # Create a tag if one does not exist @@ -135,76 +114,76 @@ def create_tag_and_build_package(repo, desired_tag, commit_sha, plugin_path): repo.head.reset(index=True, working_tree=True) # Check if Package is available on PyPI - loop = asyncio.get_event_loop() # noqa - # fmt: off - package_found = asyncio.run( - get_package_from_pypi("pulp-cookbook=={tag.name}", plugin_path) - ) # noqa - # fmt: on - if not package_found: + if not get_package_from_pypi(tag.name, plugin_path): os.system("python3 setup.py sdist bdist_wheel --python-tag py3") -helper = textwrap.dedent( - """\ - Start the release process. +def main(): + helper = textwrap.dedent( + """\ + Start the release process. - Example: - setup.py on plugin before script: - version="2.0.0.dev" + Example: + setup.py on plugin before script: + version="2.0.0.dev" - $ python .ci/scripts/release.py + $ python .ci/scripts/release.py - setup.py on plugin after script: - version="2.0.1.dev" + setup.py on plugin after script: + version="2.0.1.dev" - """ -) -parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=helper) - -parser.add_argument( - "release_version", - type=str, - help="The version string for the release.", -) - -args = parser.parse_args() - -release_version_arg = args.release_version - -release_path = os.path.dirname(os.path.abspath(__file__)) -plugin_path = release_path.split("/.github")[0] - -plugin_name = "pulp_cookbook" -version = None -with open(f"{plugin_path}/setup.py") as fp: - for line in fp.readlines(): - if "version=" in line: - version = re.split("\"|'", line)[1] - if not version: - raise RuntimeError("Could not detect existing version ... aborting.") -release_version = version.replace(".dev", "") - -print(f"\n\nRepo path: {plugin_path}") -repo = Repo(plugin_path) - -release_commit = None -if release_version != release_version_arg: - # Look for a commit with the requested release version - for commit in repo.iter_commits(): - if f"Release {release_version_arg}\n" in commit.message: - release_commit = commit - release_version = release_version_arg - break + """ + ) + parser = argparse.ArgumentParser( + formatter_class=argparse.RawTextHelpFormatter, description=helper + ) + + parser.add_argument( + "release_version", + type=str, + help="The version string for the release.", + ) + + args = parser.parse_args() + + release_version_arg = args.release_version + + release_path = os.path.dirname(os.path.abspath(__file__)) + plugin_path = release_path.split("/.github")[0] + + version = None + with open(f"{plugin_path}/setup.py") as fp: + for line in fp.readlines(): + if "version=" in line: + version = re.split("\"|'", line)[1] + if not version: + raise RuntimeError("Could not detect existing version ... aborting.") + release_version = version.replace(".dev", "") + + print(f"\n\nRepo path: {plugin_path}") + repo = Repo(plugin_path) + + release_commit = None + if release_version != release_version_arg: + # Look for a commit with the requested release version + for commit in repo.iter_commits(): + if f"Release {release_version_arg}\n" in commit.message: + release_commit = commit + release_version = release_version_arg + break + if not release_commit: + raise RuntimeError( + f"The release version {release_version_arg} does not match the .dev version at " + "HEAD. A release commit for such version does not exist." + ) + if not release_commit: - raise RuntimeError( - f"The release version {release_version_arg} does not match the .dev version at HEAD. " - "A release commit for such version does not exist." - ) - -if not release_commit: - release_commit_sha = create_release_commits(repo, release_version, plugin_path) -else: - release_commit_sha = release_commit.hexsha -create_tag_and_build_package(repo, release_version, release_commit_sha, plugin_path) + release_commit_sha = create_release_commits(repo, release_version, plugin_path) + else: + release_commit_sha = release_commit.hexsha + create_tag_and_build_package(repo, release_version, release_commit_sha, plugin_path) + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 5d879c2..7d79d5a 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -8,12 +8,12 @@ # # For more info visit https://github.com/pulp/plugin_template +set -mveuo pipefail + # make sure this script runs at the repo root cd "$(dirname "$(realpath -e "$0")")"/../../.. REPO_ROOT="$PWD" -set -mveuo pipefail - source .github/workflows/scripts/utils.sh export POST_SCRIPT=$PWD/.github/workflows/scripts/post_script.sh @@ -44,10 +44,10 @@ if [[ "$TEST" = "docs" ]]; then exit fi +REPORTED_STATUS="$(pulp status)" + if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then - STATUS_ENDPOINT="${PULP_URL}${PULP_API_ROOT}api/v3/status/" - echo $STATUS_ENDPOINT - REPORTED_VERSION=$(http $STATUS_ENDPOINT | jq --arg plugin cookbook --arg legacy_plugin pulp_cookbook -r '.versions[] | select(.component == $plugin or .component == $legacy_plugin) | .version') + REPORTED_VERSION="$(echo $REPORTED_STATUS | jq --arg plugin cookbook --arg legacy_plugin pulp_cookbook -r '.versions[] | select(.component == $plugin or .component == $legacy_plugin) | .version')" response=$(curl --write-out %{http_code} --silent --output /dev/null https://pypi.org/project/pulp-cookbook/$REPORTED_VERSION/) if [ "$response" == "200" ]; then @@ -56,38 +56,50 @@ if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then fi fi -if [[ "$TEST" == "plugin-from-pypi" ]]; then - COMPONENT_VERSION=$(http https://pypi.org/pypi/pulp-cookbook/json | jq -r '.info.version') - git checkout ${COMPONENT_VERSION} -- pulp_cookbook/tests/ -fi - echo "machine pulp login admin password password " | cmd_user_stdin_prefix bash -c "cat >> ~pulp/.netrc" -cmd_user_stdin_prefix bash -c "chmod og-rw ~pulp/.netrc" - -cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt" -cat functest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/functest_requirements.txt" -cmd_prefix pip3 install -r /tmp/unittest_requirements.txt -cmd_prefix pip3 install -r /tmp/functest_requirements.txt -cmd_prefix pip3 install --upgrade ../pulp-smash +# Some commands like ansible-galaxy specifically require 600 +cmd_user_stdin_prefix bash -c "chmod 600 ~pulp/.netrc" cd ../pulp-openapi-generator -./generate.sh pulp_cookbook python -cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_cookbook-client -sudo rm -rf ./pulp_cookbook-client -./generate.sh pulpcore python -cmd_prefix pip3 install /root/pulp-openapi-generator/pulpcore-client -sudo rm -rf ./pulpcore-client +if [ "$(echo "$REPORTED_STATUS" | jq -r '.versions[0].package')" = "null" ] +then + # We are on an old version of pulpcore without package in the status report + for app_label in $(echo "$REPORTED_STATUS" | jq -r '.versions[].component') + do + if [ "$app_label" = "core" ] + then + item=pulpcore + else + item="pulp_${app_label}" + fi + ./generate.sh "${item}" python + cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client" + sudo rm -rf "./${item}-client" + done +else + for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[].package|sub("-"; "_")') + do + ./generate.sh "${item}" python + cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client" + sudo rm -rf "./${item}-client" + done +fi + cd $REPO_ROOT +cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt" +cat functest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/functest_requirements.txt" +cmd_prefix pip3 install -r /tmp/unittest_requirements.txt -r /tmp/functest_requirements.txt + CERTIFI=$(cmd_prefix python3 -c 'import certifi; print(certifi.where())') cmd_prefix bash -c "cat /etc/pulp/certs/pulp_webserver.crt | tee -a "$CERTIFI" > /dev/null" # check for any uncommitted migrations echo "Checking for uncommitted migrations..." -cmd_user_prefix bash -c "django-admin makemigrations --check --dry-run" +cmd_user_prefix bash -c "django-admin makemigrations cookbook --check --dry-run" # Run unit tests. cmd_user_prefix bash -c "PULP_DATABASES__default__USER=postgres pytest -v -r sx --color=yes -p no:pulpcore --pyargs pulp_cookbook.tests.unit" diff --git a/.github/workflows/scripts/update_backport_labels.py b/.github/workflows/scripts/update_backport_labels.py new file mode 100755 index 0000000..3a8ee89 --- /dev/null +++ b/.github/workflows/scripts/update_backport_labels.py @@ -0,0 +1,55 @@ +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulp_cookbook' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template + +import requests +import yaml +import random +import os + + +def random_color(): + """Generates a random 24-bit number in hex""" + color = random.randrange(0, 2**24) + return format(color, "06x") + + +session = requests.Session() +token = os.getenv("GITHUB_TOKEN") + +headers = { + "Authorization": f"token {token}", + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", +} +session.headers.update(headers) + +# get all labels from the repository's current state +response = session.get("https://api.github.com/repos/pulp/pulp_cookbook/labels", headers=headers) +assert response.status_code == 200 +old_labels = set([x["name"] for x in response.json() if x["name"].startswith("backport-")]) + +# get ci_update_branches from template_config.yml +with open("./template_config.yml", "r") as f: + plugin_template = yaml.safe_load(f) +new_labels = set(["backport-" + x for x in plugin_template["ci_update_branches"]]) + +# delete old labels that are not in new labels +for label in old_labels.difference(new_labels): + response = session.delete( + f"https://api.github.com/repos/pulp/pulp_cookbook/labels/{label}", headers=headers + ) + assert response.status_code == 204 + +# create new labels that are not in old labels +for label in new_labels.difference(old_labels): + color = random_color() + response = session.post( + "https://api.github.com/repos/pulp/pulp_cookbook/labels", + headers=headers, + json={"name": label, "color": color}, + ) + assert response.status_code == 201 diff --git a/.github/workflows/update-labels.yml b/.github/workflows/update-labels.yml new file mode 100644 index 0000000..219d98a --- /dev/null +++ b/.github/workflows/update-labels.yml @@ -0,0 +1,39 @@ +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulp_cookbook' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template + + +--- +name: Cookbook Update Labels +on: + push: + branches: + - main + paths: + - 'template_config.yml' + +jobs: + update_backport_labels: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Configure Git with pulpbot name and email + run: | + git config --global user.name 'pulpbot' + git config --global user.email 'pulp-infra@redhat.com' + - name: Install python dependencies + run: | + echo ::group::PYDEPS + pip install requests pyyaml + echo ::endgroup:: + - uses: actions/checkout@v3 + - name: Update labels + run: | + python3 .github/workflows/scripts/update_backport_labels.py + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} diff --git a/.github/workflows/update_ci.yml b/.github/workflows/update_ci.yml index c452695..1038020 100644 --- a/.github/workflows/update_ci.yml +++ b/.github/workflows/update_ci.yml @@ -7,7 +7,7 @@ --- -name: CI Update +name: Cookbook CI Update on: schedule: # * is a special character in YAML so you have to quote this string @@ -15,11 +15,6 @@ on: - cron: '30 2 * * 0' workflow_dispatch: - inputs: - all_branches: - description: "Run on all branches" - default: 'no' - required: false jobs: update: @@ -31,11 +26,11 @@ jobs: steps: - uses: actions/checkout@v3 with: - # by default, it uses a depth of 1 - # this fetches all history so that we can read each commit + repository: pulp/plugin_template + path: plugin_template fetch-depth: 0 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: "3.8" @@ -49,24 +44,28 @@ jobs: run: | git config --global user.name 'pulpbot' git config --global user.email 'pulp-infra@redhat.com' - - - name: Set short_ref - id: vars - run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} + - uses: actions/checkout@v3 + with: + path: pulp_cookbook + ref: 'main' + fetch-depth: 0 - name: Run update + working-directory: pulp_cookbook run: | - .github/workflows/scripts/update_ci.sh + ../plugin_template/scripts/update_ci.sh - name: Create Pull Request for CI files uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.RELEASE_TOKEN }} + path: pulp_cookbook committer: pulpbot author: pulpbot - title: 'Update CI files from ${{ steps.vars.outputs.short_ref }} branch' + title: 'Update CI files for branch main' body: '[noissue]' - branch: 'create-pull-request/${{ steps.vars.outputs.short_ref }}/patch' + branch: 'update-ci/main' + base: 'main' commit-message: | Update CI files diff --git a/lint_requirements.txt b/lint_requirements.txt index 2ed6227..d1908ac 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -1,3 +1,10 @@ +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulp_cookbook' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template + # python packages handy for developers, but not required by pulp black check-manifest diff --git a/template_config.yml b/template_config.yml index 0506e8e..d30f757 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,37 +1,36 @@ # This config represents the latest values used when running the plugin-template. Any settings that # were not present before running plugin-template have been added with their default values. -# generated with plugin_template@2021.08.26-179-g8af2847 +# generated with plugin_template@2021.08.26-248-g4bfc3e1 additional_repos: [] -aiohttp_fixtures_origin: 172.18.0.1 api_root: /pulp/ black: true check_commit_message: false check_gettext: true check_manifest: true -check_openapi_schema: true check_stray_pulpcore_imports: true -cherry_pick_automation: false ci_env: {} ci_trigger: '{pull_request: {branches: [''*'']}}' ci_update_branches: [] +ci_update_docs: false +ci_update_release_behavior: null +cli_package: pulp-cli +cli_repo: https://github.com/pulp/pulp-cli.git core_import_allowed: [] -coverage: false deploy_client_to_pypi: true deploy_client_to_rubygems: true -deploy_daily_client_to_pypi: true -deploy_daily_client_to_rubygems: true deploy_to_pypi: true disabled_redis_runners: [] +doc_requirements_from_pulpcore: false docker_fixtures: false docs_test: true +extra_docs_requirements: [] flake8: true flake8_ignore: [] github_org: pulp issue_tracker: github kanban: true -keep_ci_update_for_latest_branches: 5 lint_requirements: true noissue_marker: '[noissue]' parallel_test_workers: 8 @@ -48,41 +47,36 @@ plugin_snake: pulp_cookbook post_job_template: null pre_job_template: null publish_docs_to_pulpprojectdotorg: true +pulp_env: {} +pulp_env_azure: {} +pulp_env_gcp: {} +pulp_env_s3: {} pulp_scheme: https pulp_settings: null pulp_settings_azure: null +pulp_settings_gcp: null pulp_settings_s3: null -pulp_settings_s6: null -pulp_settings_stream: null -pulpcore_branch: main -pulpcore_pip_version_specifier: null -pulpcore_revision: null pulpprojectdotorg_key_id: null pydocstyle: true pypi_username: pulp python_version: '3.8' -redmine_project: null release_email: pulp-infra@redhat.com release_user: pulpbot run_pulpcore_tests_for_plugins: true single_commit_check: true -stable_branch: null stalebot: true stalebot_days_until_close: 30 stalebot_days_until_stale: 90 stalebot_limit_to_pulls: true sync_ci: true -tasking_allow_async_unsafe: true test_azure: true -test_bindings: false test_cli: false test_deprecations: true +test_gcp: false +test_lowerbounds: true test_performance: false -test_released_plugin_with_next_pulpcore_release: false test_reroute: true test_s3: true -test_stream: false update_github: true -upgrade_range: [] use_issue_template: true