Skip to content

Commit

Permalink
stash qg state on run
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <[email protected]>
  • Loading branch information
wagoodman committed Oct 26, 2023
1 parent 3e92103 commit e12e167
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
41 changes: 41 additions & 0 deletions .github/actions/quality-gate/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,48 @@ runs:
working-directory: tests/quality
run: poetry run make capture provider=${{ inputs.provider }}


- name: Validate provider results
shell: bash
working-directory: tests/quality
run: poetry run make validate

- name: Archive the provider state (${{ inputs.provider }})
if: ${{ failure() }}
shell: bash
run: tar -czvf qg-capture-state-${{ inputs.provider }}.tar.gz -C tests/quality --exclude tools --exclude labels .yardstick.yaml .yardstick

- name: Upload the provider state archive (${{ inputs.provider }})
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: qg-capture-state-${{ inputs.provider }}
path: qg-capture-state-${{ inputs.provider }}.tar.gz

- name: Show instructions to debug
if: ${{ failure() }}
shell: bash
run: |
ARCHIVE_NAME=qg-capture-state-${{ inputs.provider }}.zip
WORKFLOW_RUN_LINK=https://github.com/anchore/vunnel/actions/runs/${{ github.run_id }}
cat << EOF >> $GITHUB_STEP_SUMMARY
## Troubleshooting ${{ inputs.provider }} failed run
Download the archive from CI for the failed provider: $WORKFLOW_RUN_LINK
Specifically the artifact: $ARCHIVE_NAME
Then run the following commands to debug:
```bash
# copy the archive to the tests/quality directory
cd tests/quality
tar -xzvf $ARCHIVE_NAME
```
Now you can debug the provider with yardstick:
```bash
poetry shell
yardstick result list
yardstick label explore
```
EOF
17 changes: 9 additions & 8 deletions .github/workflows/nightly-quality-gate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ jobs:
fi
echo "🟢 Quality gate passed!"
- uses: 8398a7/action-slack@fbd6aa58ba854a740e11a35d0df80cb5d12101d8 #v3.15.1
if: ${{ failure() }}
with:
status: ${{ job.status }}
fields: repo,workflow,action,eventName
text: "Vunnel nightly quality gate has failed: https://github.com/anchore/vunnel/actions/workflows/nightly-quality-gate.yaml"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }}
# TODO: put me back in the ring, boss!
# - uses: 8398a7/action-slack@fbd6aa58ba854a740e11a35d0df80cb5d12101d8 #v3.15.1
# if: ${{ failure() }}
# with:
# status: ${{ job.status }}
# fields: repo,workflow,action,eventName
# text: "Vunnel nightly quality gate has failed: https://github.com/anchore/vunnel/actions/workflows/nightly-quality-gate.yaml"
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.grype
.grype-db
*.tar.gz
*.zip

/bin
/data/
Expand Down

0 comments on commit e12e167

Please sign in to comment.