platform-eol-check.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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@v3
  26. - name: Prepare tools
  27. id: prepare
  28. run: |
  29. sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml
  30. - name: Read build matrix
  31. id: set-matrix
  32. run: |
  33. matrix="$(.github/scripts/gen-matrix-eol-check.py)"
  34. echo "Generated matrix: ${matrix}"
  35. echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
  36. eol-check:
  37. name: EOL Check
  38. runs-on: ubuntu-latest
  39. needs:
  40. - matrix
  41. strategy:
  42. matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
  43. fail-fast: false # We want to check everything, so don’t bail on the first failure.
  44. max-parallel: 2 # Cap of two jobs at a time to limit impact on other CI.
  45. steps:
  46. - name: Checkout
  47. id: checkout
  48. uses: actions/checkout@v3
  49. # Actually check the EOL date for the platform.
  50. - name: Check EOL Date
  51. id: check
  52. shell: sh {0}
  53. run: |
  54. d="$(.github/scripts/platform-impending-eol.py ${{ matrix.distro }} ${{ matrix.release }})"
  55. case $? in
  56. 0) echo "pending=false" >> "${GITHUB_OUTPUT}" ;;
  57. 1)
  58. echo "pending=true" >> "${GITHUB_OUTPUT}"
  59. echo "date=${d}" >> "${GITHUB_OUTPUT}"
  60. ;;
  61. 2)
  62. echo "pending=false" >> "${GITHUB_OUTPUT}"
  63. echo "::info::No EOL information found for ${{ matrix.distro }} ${{ matrix.release }}"
  64. ;;
  65. *)
  66. echo "::error::Failed to check EOL date for ${{ matrix.distro }} ${{ matrix.release }}"
  67. exit 1
  68. ;;
  69. esac
  70. # Figure out the issue title.
  71. # This is it’s own step so we only have to set it in one place.
  72. - name: Determine Issue Title
  73. id: title
  74. if: steps.check.outputs.pending == 'true'
  75. run: |
  76. echo "title=[Platform EOL]: ${{ matrix.full_name }} will be EOL soon." >> "${GITHUB_OUTPUT}"
  77. # Check if there is an existing issue in the repo for the platform EOL.
  78. # The actual command line to make the check is unfortunately complicated because
  79. # GitHub think that it’s sensible to exit with a status of 0 if there no results
  80. # for a search.
  81. - name: Check for Existing Issue
  82. id: existing
  83. if: steps.check.outputs.pending == 'true'
  84. env:
  85. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  86. run: |
  87. set -e
  88. count=$(gh issue list -R netdata/netdata -s all -S '${{ steps.title.outputs.title }} in:title' --json 'id' -q '. | length')
  89. if [ "${count}" -ge 1 ]; then
  90. echo 'exists=true' >> "${GITHUB_OUTPUT}"
  91. else
  92. echo 'exists=false' >> "${GITHUB_OUTPUT}"
  93. fi
  94. # If the platform is near EOL and there is no existing issue, create one.
  95. - name: Create EOL Issue
  96. id: create-issue
  97. if: steps.check.outputs.pending == 'true' && steps.existing.outputs.exists == 'false'
  98. uses: imjohnbo/issue-bot@v3
  99. with:
  100. assignees: Ferroin, tkatsoulas
  101. labels: area/packaging, needs triage
  102. title: ${{ steps.title.outputs.title }}
  103. body: |
  104. Based on information from https://endoflife.date/${{ matrix.distro }},
  105. upstream support for ${{ matrix.full_name }} will be ending
  106. on ${{ steps.check.outputs.date }}. A PR should be created
  107. to remove this platform from our platform support document,
  108. CI, and packaging code.
  109. - [ ]: Remove platform from `packaging/PLATFORM_SUPPORT.md`
  110. - [ ]: Remove platform from `.github/data/distros.yml`
  111. - [ ]: Remove platform package builder from helper-images repo (if applicable).
  112. - [ ]: Verify any other platform support code that needs to be cleaned up.