diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2023-03-21 07:10:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 07:10:32 -0400 |
commit | c0719b9f3a16091f4a48971bc16c0e63d0aab946 (patch) | |
tree | f8fdcfbbd5c17abd11c90f809975b3846a3e3fe5 /.github | |
parent | 5046e034212c008557dd014196b6f6204eda24b2 (diff) |
Assorted improvements for our platform EOL check code. (#14768)
* Fix typos in EOL check matrix generation.
* Allow specifying a different name for distro for EOL check.
If the `eol_check` property of a distro entry is a string, use that as
the product name when querying https://endoflife.date/api
* Add failure notifications for scheduled runs of EOL check workflow.
Diffstat (limited to '.github')
-rw-r--r-- | .github/data/distros.yml | 2 | ||||
-rwxr-xr-x | .github/scripts/gen-matrix-eol-check.py | 9 | ||||
-rw-r--r-- | .github/workflows/platform-eol-check.yml | 53 |
3 files changed, 56 insertions, 8 deletions
diff --git a/.github/data/distros.yml b/.github/data/distros.yml index 25613fc822..376d5df043 100644 --- a/.github/data/distros.yml +++ b/.github/data/distros.yml @@ -76,7 +76,7 @@ include: - distro: amazonlinux version: "2" - eol_check: false + eol_check: 'amazon-linux' packages: type: rpm repo_distro: amazonlinux/2 diff --git a/.github/scripts/gen-matrix-eol-check.py b/.github/scripts/gen-matrix-eol-check.py index dc740065cc..638527284f 100755 --- a/.github/scripts/gen-matrix-eol-check.py +++ b/.github/scripts/gen-matrix-eol-check.py @@ -13,10 +13,15 @@ with open('.github/data/distros.yml') as f: for item in data['include']: if 'eol_check' in item and item['eol_check']: + if isinstance(item['eol_check'], str): + distro = item['eol_check'] + else: + distro = item['distro'] + entries.append({ - 'distro': item['distro'], + 'distro': distro, 'release': item['version'], - 'full_name': f'{ item['distro'] } { item['version'] }' + 'full_name': f'{ item["distro"] } { item["version"] }' }) entries.sort(key=lambda k: (k['distro'], k['release'])) diff --git a/.github/workflows/platform-eol-check.yml b/.github/workflows/platform-eol-check.yml index 16f4fc2882..d1f4416cde 100644 --- a/.github/workflows/platform-eol-check.yml +++ b/.github/workflows/platform-eol-check.yml @@ -33,6 +33,26 @@ jobs: matrix="$(.github/scripts/gen-matrix-eol-check.py)" echo "Generated matrix: ${matrix}" echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}" + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Failed to generate build matrix for platform EOL checks:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Build matrix generation for scheduled platform EOL check has failed: + Checkout: ${{ steps.checkout.outcome }} + Prepare Tools: ${{ steps.prepare.outcome }} + Read Build Matrix: ${{ steps.set-matrix.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name == 'schedule' + && github.repository == 'netdata/netdata' + }} eol-check: name: EOL Check @@ -61,10 +81,10 @@ jobs: ;; 2) echo "pending=false" >> "${GITHUB_OUTPUT}" - echo "::info::No EOL information found for ${{ matrix.distro }} ${{ matrix.release }}" + echo "::info::No EOL information found for ${{ matrix.full_name }}" ;; *) - echo "::error::Failed to check EOL date for ${{ matrix.distro }} ${{ matrix.release }}" + echo "::error::Failed to check EOL date for ${{ matrix.full_name }}" exit 1 ;; esac @@ -76,9 +96,9 @@ jobs: run: | echo "title=[Platform EOL]: ${{ matrix.full_name }} will be EOL soon." >> "${GITHUB_OUTPUT}" # Check if there is an existing issue in the repo for the platform EOL. - # The actual command line to make the check is unfortunately complicated because - # GitHub think that it’s sensible to exit with a status of 0 if there no results - # for a search. + # The actual command line to make the check is unfortunately + # complicated because GitHub thinks that it’s sensible to exit + # with a status of 0 if there are no results for a search. - name: Check for Existing Issue id: existing if: steps.check.outputs.pending == 'true' @@ -108,3 +128,26 @@ jobs: - [ ] Remove platform from `.github/data/distros.yml` - [ ] Remove platform package builder from helper-images repo (if applicable). - [ ] Verify any other platform support code that needs to be cleaned up. + # Send a notification to Slack if a job failed. + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Platform EOL check failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: A scheduled check for the EOL status of ${{ matrix.full_name }} has failed. + Checkout: ${{ steps.checkout.outcome }} + Check EOL Status: ${{ steps.check.outcome }} + Generate Issue Title: ${{ steps.title.outcome }} + Check for Existing Issue: ${{ steps.existing.outcome }} + Create Issue: ${{ steps.create-issue.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name == 'schedule' + && github.repository == 'netdata/netdata' + }} |