master
yml 154 lines 6.3 KB
Raw
1 ---
2 # Auto-generate issues for EOL of platforms that are approaching their EOL date.
3 # Uses https://endoflife.date and their new API to check for EOL dates.
4 #
5 # Issues are created when the EOL date is within the next 30 days.
6 name: Check Platform EOL
7 on: # Run weekly and whenever manually triggered
8 schedule:
9 - cron: '0 3 * * 1'
10 workflow_dispatch: null
11 concurrency: # Simple single-instance concurrency.
12 group: eol-check-${{ github.repository }}
13 cancel-in-progress: true
14 jobs:
15 # Prepare the build matrix.
16 # This uses output from .github/scripts/gen-matrix-eol-check.py
17 matrix:
18 name: Prepare Build Matrix
19 runs-on: ubuntu-latest
20 outputs:
21 matrix: ${{ steps.set-matrix.outputs.matrix }}
22 steps:
23 - name: Checkout
24 id: checkout
25 uses: actions/checkout@v6
26 - name: Prepare tools
27 id: prepare
28 run: |
29 sudo apt-get update || true
30 sudo apt-get install -y python3-ruamel.yaml
31 - name: Read build matrix
32 id: set-matrix
33 run: |
34 matrix="$(.github/scripts/gen-matrix-eol-check.py)"
35 echo "Generated matrix: ${matrix}"
36 echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
37 - name: Failure Notification
38 uses: rtCamp/action-slack-notify@v2
39 env:
40 SLACK_COLOR: 'danger'
41 SLACK_FOOTER: ''
42 SLACK_ICON_EMOJI: ':github-actions:'
43 SLACK_TITLE: 'Failed to generate build matrix for platform EOL checks:'
44 SLACK_USERNAME: 'GitHub Actions'
45 SLACK_MESSAGE: |-
46 ${{ github.repository }}: Build matrix generation for scheduled platform EOL check has failed:
47 Checkout: ${{ steps.checkout.outcome }}
48 Prepare Tools: ${{ steps.prepare.outcome }}
49 Read Build Matrix: ${{ steps.set-matrix.outcome }}
50 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
51 if: >-
52 ${{
53 failure()
54 && github.event_name == 'schedule'
55 && github.repository == 'netdata/netdata'
56 }}
57
58 eol-check:
59 name: EOL Check
60 runs-on: ubuntu-latest
61 needs:
62 - matrix
63 strategy:
64 matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
65 fail-fast: false # We want to check everything, so don’t bail on the first failure.
66 max-parallel: 2 # Cap of two jobs at a time to limit impact on other CI.
67 steps:
68 - name: Checkout
69 id: checkout
70 uses: actions/checkout@v6
71 # Actually check the EOL date for the platform.
72 - name: Check EOL Date
73 id: check
74 shell: sh {0}
75 run: |
76 d="$(.github/scripts/platform-impending-eol.py ${{ matrix.distro }} ${{ matrix.release }} ${{ matrix.lts }})"
77 case $? in
78 0) echo "pending=false" >> "${GITHUB_OUTPUT}" ;;
79 1)
80 echo "pending=true" >> "${GITHUB_OUTPUT}"
81 echo "date=${d}" >> "${GITHUB_OUTPUT}"
82 ;;
83 2)
84 echo "pending=false" >> "${GITHUB_OUTPUT}"
85 echo "::info::No EOL information found for ${{ matrix.full_name }}"
86 ;;
87 *)
88 echo "::error::Failed to check EOL date for ${{ matrix.full_name }}"
89 exit 1
90 ;;
91 esac
92 # Figure out the issue title.
93 # This is it’s own step so we only have to set it in one place.
94 - name: Determine Issue Title
95 id: title
96 if: steps.check.outputs.pending == 'true'
97 run: |
98 echo "title=[Platform EOL]: ${{ matrix.full_name }} will be EOL soon." >> "${GITHUB_OUTPUT}"
99 # Check if there is an existing issue in the repo for the platform EOL.
100 # The actual command line to make the check is unfortunately
101 # complicated because GitHub thinks that it’s sensible to exit
102 # with a status of 0 if there are no results for a search.
103 - name: Check for Existing Issue
104 id: existing
105 if: steps.check.outputs.pending == 'true'
106 env:
107 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108 run: |
109 set -e
110 count=$(gh issue list -R netdata/netdata -s all -S '${{ steps.title.outputs.title }} in:title' --json 'id' -q '. | length')
111 if [ "${count}" -ge 1 ]; then
112 echo 'exists=true' >> "${GITHUB_OUTPUT}"
113 else
114 echo 'exists=false' >> "${GITHUB_OUTPUT}"
115 fi
116 # If the platform is near EOL and there is no existing issue, create one.
117 - name: Create EOL Issue
118 id: create-issue
119 if: steps.check.outputs.pending == 'true' && steps.existing.outputs.exists == 'false'
120 uses: imjohnbo/issue-bot@v3
121 with:
122 assignees: Ferroin
123 labels: area/packaging, needs triage
124 title: ${{ steps.title.outputs.title }}
125 body: |
126 Based on information from https://endoflife.date/${{ matrix.distro }}, upstream support for ${{ matrix.full_name }} will be ending on ${{ steps.check.outputs.date }}. A PR should be created to remove this platform from our platform support document, CI, and packaging code.
127
128 - [ ] Remove platform from `packaging/PLATFORM_SUPPORT.md`
129 - [ ] Remove platform from `.github/data/distros.yml`
130 - [ ] Remove platform package builder from helper-images repo (if applicable).
131 - [ ] Verify any other platform support code that needs to be cleaned up.
132 # Send a notification to Slack if a job failed.
133 - name: Failure Notification
134 uses: rtCamp/action-slack-notify@v2
135 env:
136 SLACK_COLOR: 'danger'
137 SLACK_FOOTER: ''
138 SLACK_ICON_EMOJI: ':github-actions:'
139 SLACK_TITLE: 'Platform EOL check failed:'
140 SLACK_USERNAME: 'GitHub Actions'
141 SLACK_MESSAGE: |-
142 ${{ github.repository }}: A scheduled check for the EOL status of ${{ matrix.full_name }} has failed.
143 Checkout: ${{ steps.checkout.outcome }}
144 Check EOL Status: ${{ steps.check.outcome }}
145 Generate Issue Title: ${{ steps.title.outcome }}
146 Check for Existing Issue: ${{ steps.existing.outcome }}
147 Create Issue: ${{ steps.create-issue.outcome }}
148 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
149 if: >-
150 ${{
151 failure()
152 && github.event_name == 'schedule'
153 && github.repository == 'netdata/netdata'
154 }}