Skip to content

Commit

Permalink
Fix Deprecation Reporting
Browse files Browse the repository at this point in the history
This will not rely on job outputs, but instead use a workflow artifact.

[noissue]
  • Loading branch information
mdellweg committed Nov 28, 2023
1 parent c0a4b8f commit 7ab816b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 40 deletions.
39 changes: 13 additions & 26 deletions templates/github/.github/workflows/ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
27 changes: 13 additions & 14 deletions templates/github/.github/workflows/test.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7ab816b

Please sign in to comment.