diff --git a/.ci/scripts/tweet.py b/.ci/scripts/tweet.py deleted file mode 100755 index 641e192..0000000 --- a/.ci/scripts/tweet.py +++ /dev/null @@ -1,16 +0,0 @@ -import os -import sys -from tweepy import Client - -release_version = sys.argv[1] -if release_version.endswith(".0"): - client = Client( - consumer_key=os.getenv("TWITTER_API_KEY"), - consumer_secret=os.getenv("TWITTER_API_KEY_SECRET"), - access_token=os.getenv("TWITTER_ACCESS_TOKEN"), - access_token_secret=os.getenv("TWITTER_ACCESS_TOKEN_SECRET"), - ) - link = "https://docs.pulpproject.org/pulp_gem/changes.html" - msg = f"pulp_gem-{release_version} - Check out for more details: {link}" - release_msg = f"Hey! We've just released {msg}" - client.create_tweet(text=release_msg) diff --git a/.github/template_gitref b/.github/template_gitref index 4ff7980..bd7bf02 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-277-gb3d1884 +2021.08.26-279-ga7021ff-dirty diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a5d79d..55e849f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,7 @@ jobs: test: needs: build uses: "./.github/workflows/test.yml" + deprecations: defaults: run: @@ -60,18 +61,10 @@ jobs: if: github.base_ref == 'main' needs: test steps: - - name: Fail on deprecations - run: | - 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: "Download Deprecations" + uses: actions/upload-artifact@v3 + with: + name: "deprecations" - 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 - - + cat deprecations-*.txt | sort -u diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9306066..6becf3f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,13 +30,13 @@ jobs: language: [ 'python' ] steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/kanban.yml b/.github/workflows/kanban.yml index 1e99b73..3c154c8 100644 --- a/.github/workflows/kanban.yml +++ b/.github/workflows/kanban.yml @@ -58,7 +58,7 @@ jobs: runs-on: ubuntu-latest name: Find issues linked to a PR outputs: - linked-issues: ${{ steps.linked-issues.outputs.issues }} + linked-issues: ${{ steps.linked-issues.outputs.issues }} steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index be839a8..2db66c6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,10 @@ jobs: - name: Install requirements run: pip3 install -r lint_requirements.txt + - name: Lint workflow files + run: | + yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows + # run black separately from flake8 to get a diff - name: Run black run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 23597e3..bc85f36 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -76,12 +76,6 @@ jobs: fetch-depth: 1 path: "pulp_gem" - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - repository: "pulp/pulp-openapi-generator" - path: "pulp-openapi-generator" - - uses: actions/download-artifact@v3 with: name: "plugin_package" @@ -91,11 +85,16 @@ jobs: with: python-version: "3.8" + - name: Install python dependencies + run: | + echo ::group::PYDEPS + pip install requests + echo ::endgroup:: + - name: Set environment variables run: | echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV - - name: Download built docs uses: actions/download-artifact@v3 with: @@ -117,7 +116,6 @@ jobs: run: | tar -xvf docs.tar -C ./docs .github/workflows/scripts/publish_docs.sh nightly ${GITHUB_REF##*/} - - name: Logs if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce0ba40..a8730e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -268,9 +268,9 @@ jobs: env: TAG_NAME: ${{ inputs.release }} with: - const { TAG_NAME } = process.env; - script: | + const { TAG_NAME } = process.env; + await github.rest.repos.createRelease({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/scripts/create_release_from_tag.sh b/.github/workflows/scripts/create_release_from_tag.sh deleted file mode 100755 index 4de7777..0000000 --- a/.github/workflows/scripts/create_release_from_tag.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -eu - -curl -s -X "POST https://api.github.com/repos/$GITHUB_REPOSITORY/releases" \ --H "Authorization: token $RELEASE_TOKEN" \ --d @- << EOF -{ - "tag_name": "$1", - "name": "$1" -} -EOF diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5eb5e4..dbd9373 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,11 +26,6 @@ jobs: - 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@v4 @@ -113,9 +108,17 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - - name: Extract Deprecations from Logs - id: deprecations - run: echo deprecations-${{ matrix.env.TEST }}=$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0) >> $GITHUB_OUTPUT + - name: "Extract Deprecations from Logs" + run: | + docker logs pulp 2>&1 | grep -i pulpcore.deprecation | tee deprecations-${{ matrix.env.TEST }}.txt + + - name: "Upload Deprecations" + uses: actions/upload-artifact@v3 + with: + name: "deprecations" + path: "pulp_gem/deprecations-${{ matrix.env.TEST }}.txt" + if-no-files-found: "error" + retention-days: 5 - name: Upload python client packages if: ${{ env.TEST == 'pulp' }} uses: actions/upload-artifact@v3 diff --git a/.github/workflows/update-labels.yml b/.github/workflows/update-labels.yml index 8c5233b..95596d9 100644 --- a/.github/workflows/update-labels.yml +++ b/.github/workflows/update-labels.yml @@ -7,13 +7,13 @@ --- -name: Gem Update Labels +name: "Gem Update Labels" on: push: branches: - - main + - "main" paths: - - 'template_config.yml' + - "template_config.yml" jobs: update_backport_labels: @@ -31,8 +31,8 @@ jobs: echo ::group::PYDEPS pip install requests pyyaml echo ::endgroup:: - - uses: actions/checkout@v3 - - name: Update labels + - uses: "actions/checkout@v3" + - name: "Update labels" run: | python3 .github/workflows/scripts/update_backport_labels.py env: diff --git a/.github/workflows/update_ci.yml b/.github/workflows/update_ci.yml index 9b0e109..f521c81 100644 --- a/.github/workflows/update_ci.yml +++ b/.github/workflows/update_ci.yml @@ -13,7 +13,6 @@ on: # * is a special character in YAML so you have to quote this string # runs at 2:30 UTC every Sunday - cron: '30 2 * * 0' - workflow_dispatch: jobs: diff --git a/lint_requirements.txt b/lint_requirements.txt index 20e80ce..94dbbc8 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -10,4 +10,4 @@ black check-manifest flake8 flake8-black - +yamllint diff --git a/pulp_gem/app/serializers.py b/pulp_gem/app/serializers.py index 7507626..2354287 100644 --- a/pulp_gem/app/serializers.py +++ b/pulp_gem/app/serializers.py @@ -127,6 +127,11 @@ def deferred_validate(self, data): return data def retrieve(self, validated_data): + # --- JUST AN EXPERIMENTE --- + from logging import getLogger + + getLogger("pulpcore.deprecation").warn("THIS IS JUST A TRACING TEST.") + # --------------------------- return GemContent.objects.filter( _pulp_domain=get_domain_pk(), checksum=validated_data["checksum"] ).first() diff --git a/template_config.yml b/template_config.yml index 0372c5a..ac3a6b3 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,8 +1,6 @@ # 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-277-gb3d1884 - additional_repos: [] api_root: /pulp/ black: true