From 97347ec331dd8a47d1f1efeaf08339c00ebe6832 Mon Sep 17 00:00:00 2001 From: pulpbot Date: Sun, 19 Nov 2023 02:35:31 +0000 Subject: [PATCH] Update CI files [noissue] --- .github/template_gitref | 2 +- .github/workflows/changelog.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/pr_checks.yml | 2 +- .github/workflows/release.yml | 22 +--------------- .../scripts/create_release_from_tag.sh | 4 +-- .github/workflows/scripts/publish_docs.sh | 4 +-- .../scripts/push_branch_and_tag_to_github.sh | 25 ++++++++----------- .github/workflows/scripts/script.sh | 11 +++----- .github/workflows/update-labels.yml | 2 +- .github/workflows/update_ci.yml | 2 +- template_config.yml | 11 +------- 14 files changed, 28 insertions(+), 65 deletions(-) diff --git a/.github/template_gitref b/.github/template_gitref index 50128a8a72..b11f949e5a 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-259-ge0f38f0 +2021.08.26-265-gbdd41dd diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 7078427fd2..092eba4b5f 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -6,7 +6,7 @@ # For more info visit https://github.com/pulp/plugin_template --- -name: Pulpcore changelog update +name: Core changelog update on: push: branches: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7a9113340..3f7b982165 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ # For more info visit https://github.com/pulp/plugin_template --- -name: Pulpcore CI +name: Core CI on: {pull_request: {branches: ['*']}} concurrency: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a5482e9a58..9e5a410dbe 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -4,7 +4,7 @@ # './plugin-template --github pulpcore' to update this file. # # For more info visit https://github.com/pulp/plugin_template -name: "Pulpcore CodeQL" +name: "Core CodeQL" on: workflow_dispatch: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index acf0421804..cb4fc59faf 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: Pulpcore Nightly CI +name: Core Nightly CI on: schedule: # * is a special character in YAML so you have to quote this string diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index dc1ad3e0e9..6584e96901 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -6,7 +6,7 @@ # For more info visit https://github.com/pulp/plugin_template --- -name: Pulpcore PR static checks +name: Core PR static checks on: pull_request_target: types: [opened, synchronize, reopened] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 586c9c25bb..1e5366bf05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,17 +6,12 @@ # For more info visit https://github.com/pulp/plugin_template --- -name: Pulpcore Release Pipeline +name: Core Release Pipeline on: workflow_dispatch: inputs: release: description: "Release tag (e.g. 3.2.1)" - before_script: - description: | - 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 env: RELEASE_WORKFLOW: true @@ -134,10 +129,6 @@ jobs: GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} shell: bash - - name: Additional before_script - run: ${{ github.event.inputs.before_script }} - shell: bash - - name: Install Python client run: .github/workflows/scripts/install_python_client.sh shell: bash @@ -275,16 +266,5 @@ jobs: - name: Publish client to rubygems run: bash .github/workflows/scripts/publish_client_gem.sh - - name: Update GitHub - continue-on-error: true - run: | - set -euv - export COMMIT_MSG=$(git log --format=%B --no-merges -1) - export GH_ISSUES=$(echo $COMMIT_MSG | grep -o "GH Issues: .*" | awk '{print $3}') - pip install pygithub - - echo "GH Issues $GH_ISSUES" - python .ci/scripts/update_github.py - - name: Create release on GitHub run: bash .github/workflows/scripts/create_release_from_tag.sh ${{ github.event.inputs.release }} diff --git a/.github/workflows/scripts/create_release_from_tag.sh b/.github/workflows/scripts/create_release_from_tag.sh index 328454e0df..4de7777d7e 100755 --- a/.github/workflows/scripts/create_release_from_tag.sh +++ b/.github/workflows/scripts/create_release_from_tag.sh @@ -1,7 +1,7 @@ #!/bin/sh -set -e +set -eu -curl -s -X POST https://api.github.com/repos/$GITHUB_REPOSITORY/releases \ +curl -s -X "POST https://api.github.com/repos/$GITHUB_REPOSITORY/releases" \ -H "Authorization: token $RELEASE_TOKEN" \ -d @- << EOF { diff --git a/.github/workflows/scripts/publish_docs.sh b/.github/workflows/scripts/publish_docs.sh index 7ebc9d3806..5f1c959c4d 100755 --- a/.github/workflows/scripts/publish_docs.sh +++ b/.github/workflows/scripts/publish_docs.sh @@ -32,7 +32,7 @@ ssh-add ~/.ssh/pulp-infra python3 .github/workflows/scripts/docs-publisher.py --build-type $1 --branch $2 -if [[ "$GITHUB_WORKFLOW" == "Pulpcore changelog update" ]]; then +if [[ "$GITHUB_WORKFLOW" == "Core changelog update" ]]; then # Do not build bindings docs on changelog update exit fi @@ -45,7 +45,7 @@ cd ../bindings cat >> mkdocs.yml << DOCSYAML --- site_name: Pulpcore Client -site_description: Pulpcore bindings +site_description: Core bindings site_author: Pulp Team site_url: https://docs.pulpproject.org/pulpcore_client/ repo_name: pulp/pulpcore diff --git a/.github/workflows/scripts/push_branch_and_tag_to_github.sh b/.github/workflows/scripts/push_branch_and_tag_to_github.sh index 2f13c78d89..ad80d31880 100755 --- a/.github/workflows/scripts/push_branch_and_tag_to_github.sh +++ b/.github/workflows/scripts/push_branch_and_tag_to_github.sh @@ -1,21 +1,16 @@ #!/bin/sh -set -e -BRANCH_NAME=$(echo $GITHUB_REF | sed -rn 's/refs\/heads\/(.*)/\1/p') +# WARNING: DO NOT EDIT! +# +# This file was generated by plugin_template, and is managed by it. Please use +# './plugin-template --github pulpcore' to update this file. +# +# For more info visit https://github.com/pulp/plugin_template -ref_string=$(git show-ref --tags | grep refs/tags/$1) +set -eu -SHA=${ref_string:0:40} +BRANCH_NAME="$(echo "$GITHUB_REF" | sed -rn 's/refs\/heads\/(.*)/\1/p')" -remote_repo=https://pulpbot:${RELEASE_TOKEN}@github.com/${GITHUB_REPOSITORY}.git +remote_repo="https://pulpbot:${RELEASE_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" -git push "${remote_repo}" $BRANCH_NAME - -curl -s -X POST https://api.github.com/repos/$GITHUB_REPOSITORY/git/refs \ --H "Authorization: token $RELEASE_TOKEN" \ --d @- << EOF -{ - "ref": "refs/tags/$1", - "sha": "$SHA" -} -EOF +git push "${remote_repo}" "$BRANCH_NAME" "$1" diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 292cb2560c..d3b7d01f88 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -29,7 +29,7 @@ export PULP_SETTINGS=$PWD/.ci/ansible/settings/settings.py export PULP_URL="https://pulp" if [[ "$TEST" = "docs" ]]; then - if [[ "$GITHUB_WORKFLOW" == "Pulpcore CI" ]]; then + if [[ "$GITHUB_WORKFLOW" == "Core CI" ]]; then pip install towncrier==19.9.0 towncrier --yes --version 4.0.0.ci fi @@ -47,6 +47,7 @@ fi REPORTED_STATUS="$(pulp status)" if [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then + # TODO Move this to prerelease checks REPORTED_VERSION="$(echo $REPORTED_STATUS | jq --arg plugin core --arg legacy_plugin pulpcore -r '.versions[] | select(.component == $plugin or .component == $legacy_plugin) | .version')" response=$(curl --write-out %{http_code} --silent --output /dev/null https://pypi.org/project/pulpcore/$REPORTED_VERSION/) if [ "$response" == "200" ]; @@ -117,23 +118,19 @@ fi if [ -f $FUNC_TEST_SCRIPT ]; then source $FUNC_TEST_SCRIPT else - - if [[ "$GITHUB_WORKFLOW" == "Pulpcore Nightly CI/CD" ]] || [[ "${RELEASE_WORKFLOW:-false}" == "true" ]]; then + if [[ "$GITHUB_WORKFLOW" == "Core Nightly CI/CD" ]] + then cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m parallel -n 8 --nightly" cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulpcore.tests.functional -m 'not parallel' --nightly" cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8 --nightly" cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel' --nightly" - else cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m parallel -n 8" cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulpcore.tests.functional -m 'not parallel'" cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8" cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel'" - - fi - fi export PULP_FIXTURES_URL="http://pulp-fixtures:8080" pushd ../pulp-cli diff --git a/.github/workflows/update-labels.yml b/.github/workflows/update-labels.yml index 2984a2cb9b..20210c4962 100644 --- a/.github/workflows/update-labels.yml +++ b/.github/workflows/update-labels.yml @@ -7,7 +7,7 @@ --- -name: Pulpcore Update Labels +name: Core Update Labels on: push: branches: diff --git a/.github/workflows/update_ci.yml b/.github/workflows/update_ci.yml index 1a7ecbe2e2..d7190664d2 100644 --- a/.github/workflows/update_ci.yml +++ b/.github/workflows/update_ci.yml @@ -7,7 +7,7 @@ --- -name: Pulpcore CI Update +name: Core CI Update on: schedule: # * is a special character in YAML so you have to quote this string diff --git a/template_config.yml b/template_config.yml index 92db3de525..3b303d7b88 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,7 +1,7 @@ # 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-248-g4bfc3e1 +# generated with plugin_template@2021.08.26-265-gbdd41dd additional_repos: - branch: 1.11 @@ -42,15 +42,8 @@ lint_requirements: true noissue_marker: '[noissue]' parallel_test_workers: 8 plugin_app_label: core -plugin_camel: Pulpcore -plugin_camel_short: Pulpcore -plugin_caps: PULPCORE -plugin_caps_short: PULPCORE -plugin_dash: pulpcore -plugin_dash_short: pulpcore plugin_default_branch: main plugin_name: pulpcore -plugin_snake: pulpcore post_job_template: null pre_job_template: null publish_docs_to_pulpprojectdotorg: true @@ -74,7 +67,6 @@ pypi_username: pulp python_version: '3.8' release_email: pulp-infra@redhat.com release_user: pulpbot -run_pulpcore_tests_for_plugins: false single_commit_check: true stalebot: true stalebot_days_until_close: 30 @@ -89,6 +81,5 @@ test_lowerbounds: true test_performance: false test_reroute: true test_s3: true -update_github: true use_issue_template: true