From 7ab816b2685b4393756798d69379b4382830484c Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Tue, 28 Nov 2023 12:46:04 +0100 Subject: [PATCH] Fix Deprecation Reporting This will not rely on job outputs, but instead use a workflow artifact. [noissue] --- templates/github/.github/workflows/ci.yml.j2 | 39 +++++++------------ .../github/.github/workflows/test.yml.j2 | 27 +++++++------ 2 files changed, 26 insertions(+), 40 deletions(-) diff --git a/templates/github/.github/workflows/ci.yml.j2 b/templates/github/.github/workflows/ci.yml.j2 index 9f47a832..8b2ce2c0 100644 --- a/templates/github/.github/workflows/ci.yml.j2 +++ b/templates/github/.github/workflows/ci.yml.j2 @@ -56,38 +56,25 @@ jobs: {%- if test_deprecations %} deprecations: - defaults: - run: - working-directory: "." runs-on: "ubuntu-latest" if: github.base_ref == '{{ plugin_default_branch }}' needs: "test" steps: - - name: Fail on deprecations + - name: "Create working directory" run: | - test -z "{{ "${{ needs.test.outputs.deprecations-pulp }}" }}" - {%- if test_azure %} - test -z "{{ "${{ needs.test.outputs.deprecations-azure }}" }}" - {%- endif %} - {%- if test_s3 %} - test -z "{{ "${{ needs.test.outputs.deprecations-s3 }}" }}" - {%- endif %} - {%- if test_lowerbounds %} - test -z "{{ "${{ needs.test.outputs.deprecations-lowerbounds }}" }}" - {%- endif %} - - name: Print deprecations - if: failure() + mkdir -p "{{ plugin_name }}" + with: + working-directory: "." + - name: "Download Deprecations" + uses: actions/download-artifact@v3 + with: + name: "deprecations" + path: "{{ plugin_name }}" + - name: "Print deprecations" run: | - echo "{{ "${{ needs.test.outputs.deprecations-pulp }}" }}" | base64 -d - {%- if test_azure %} - echo "{{ "${{ needs.test.outputs.deprecations-azure }}" }}" | base64 -d - {%- endif %} - {%- if test_s3 %} - echo "{{ "${{ needs.test.outputs.deprecations-s3 }}" }}" | base64 -d - {%- endif %} - {%- if test_lowerbounds %} - echo "{{ "${{ needs.test.outputs.deprecations-lowerbounds }}" }}" | base64 -d - {%- endif %} + cat deprecations-*.txt | sort -u + ! cat deprecations-*.txt | grep '[^[:space:]]' + {%- endif %} {%- if post_job_template %} diff --git a/templates/github/.github/workflows/test.yml.j2 b/templates/github/.github/workflows/test.yml.j2 index 7978672d..1022fba3 100644 --- a/templates/github/.github/workflows/test.yml.j2 +++ b/templates/github/.github/workflows/test.yml.j2 @@ -40,17 +40,6 @@ jobs: {%- if test_lowerbounds %} - TEST: lowerbounds {%- endif %} - outputs: - deprecations-pulp: {{ "${{ steps.deprecations.outputs.deprecations-pulp }}" }} - {%- if test_azure %} - deprecations-azure: {{ "${{ steps.deprecations.outputs.deprecations-azure }}" }} - {%- endif %} - {%- if test_s3 %} - deprecations-s3: {{ "${{ steps.deprecations.outputs.deprecations-s3 }}" }} - {%- endif %} - {%- if test_lowerbounds %} - deprecations-lowerbounds: {{ "${{ steps.deprecations.outputs.deprecations-lowerbounds }}" }} - {%- endif %} steps: {{ checkout(path=plugin_name) | indent(6) }} @@ -85,10 +74,20 @@ jobs: {%- endif %} {{ run_script(name="Script", file="script.sh") | indent(6) }} + {%- if test_deprecations %} - - 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: "{{ plugin_name }}/deprecations-{{ '${{ matrix.env.TEST }}' }}.txt" + if-no-files-found: "error" + retention-days: 5 + {%- endif %} {%- for plugin in plugins %} - name: Upload python client packages