ci(feat): convert inline JSON slack messages to templates#25675
ci(feat): convert inline JSON slack messages to templates#25675joshmarinacci wants to merge 4 commits into
Conversation
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
Signed-off-by: Josh Marinacci <joshua@marinacci.org>
add a unit test for the templates Signed-off-by: Josh Marinacci <joshua@marinacci.org>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #25675 +/- ##
=========================================
Coverage 75.07% 75.07%
Complexity 11537 11537
=========================================
Files 2585 2585
Lines 101367 101367
Branches 11219 11220 +1
=========================================
Hits 76102 76102
Misses 21356 21356
Partials 3909 3909 🚀 New features to boost your workflow:
|
andrewb1269
left a comment
There was a problem hiding this comment.
I think we should also move the new test functionality (new shell script and new workflow file) to a new issue instead of putting it under this existing issue. It's out of scope of the original issue.
| @@ -0,0 +1,40 @@ | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
| name: "ZXC: Test Gomplate Templates" | |||
There was a problem hiding this comment.
Title should be changed to align with our workflow naming standards.
For the workflow name I suggest:
890: [CALL] Test Gomplate Temps
For the workflow filename I suggest:
890-call-test-gomplate-templates.yaml
| jobs: | ||
| test-gomplate-templates: | ||
| name: Validate Gomplate Templates | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Need to use the self-hosted runner, not the Github-hosted runner.
| - name: Harden Runner | ||
| uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Install gomplate | ||
| run: | | ||
| curl -sSfL "https://github.com/hairyhenderson/gomplate/releases/download/v5.0.0/gomplate_linux-amd64" \ | ||
| -o /tmp/gomplate | ||
| curl -sSfL "https://github.com/hairyhenderson/gomplate/releases/download/v5.0.0/checksums-v5.0.0_sha256.txt" \ | ||
| -o /tmp/gomplate_checksums.txt | ||
| echo "$(grep 'bin/gomplate_linux-amd64$' /tmp/gomplate_checksums.txt | awk '{print $1}') /tmp/gomplate" | sha256sum -c - | ||
| sudo install -m 755 /tmp/gomplate /usr/local/bin/gomplate |
There was a problem hiding this comment.
I suggest replacing the setup steps with the initialize github job action:
- name: Prepare Runner
uses: PandasWhoCode/initialize-github-job@3be139d343b1a60e1fcfc70f602ee804bbe3495d # v1.1.1
with:
checkout: "true"
checkout-token: "${{ secrets.GITHUB_TOKEN }}"
setup-gomplate: "true"
| pull_request: | ||
| paths: | ||
| - ".github/workflows/templates/**" | ||
| - ".github/workflows/support/tests/test-gomplate-templates.sh" |
There was a problem hiding this comment.
Remove this and trigger it through the "Full CI Check" that we use to validate if testing passed or not. This will turn the file into a workflow-call trigger type, not a FLOW trigger type.
Description:
Converts most usages of creating slack messages with inline JSON to proper gomplate templates. Also adds a unit test for template required variables.
Related issue(s):
Fixes ##25514
Notes for reviewer:
Checklist