feat(scheduling): migrate CR and failover calls to options-based pipeline selection #315
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check Alerts using Promtool | |
| on: | |
| pull_request: | |
| paths: | |
| - 'helm/bundles/*/templates/alerts.yaml' | |
| - 'helm/bundles/*/values.yaml' | |
| - 'helm/bundles/*/Chart.yaml' | |
| - 'helm/library/**' | |
| - '.github/workflows/check-alerts.yaml' | |
| jobs: | |
| lint: | |
| # Pinned to ubuntu-24.04 so the pre-installed helm and yq versions are | |
| # stable. helm and yq come from the base runner image (no install step | |
| # needed); promtool is installed by the peimanja action below. | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Get changed bundles | |
| id: changed_bundles | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| dir_names: "true" | |
| dir_names_max_depth: "3" | |
| files: | | |
| helm/bundles/** | |
| - name: Get changed library files | |
| id: changed_library | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| files: helm/library/** | |
| - name: Render bundles to rule files | |
| env: | |
| CHANGED_BUNDLES: ${{ steps.changed_bundles.outputs.all_changed_files }} | |
| LIBRARY_CHANGED: ${{ steps.changed_library.outputs.any_changed }} | |
| run: | | |
| set -euo pipefail | |
| mkdir -p rendered | |
| # When library charts change (or nothing bundle-specific was detected, | |
| # e.g. only the workflow file changed) all bundles are affected. | |
| if [[ "$LIBRARY_CHANGED" == "true" || -z "$CHANGED_BUNDLES" ]]; then | |
| bundles=$(find helm/bundles -maxdepth 1 -mindepth 1 -type d | sort) | |
| else | |
| bundles="$CHANGED_BUNDLES" | |
| fi | |
| for bundle in $bundles; do | |
| name=$(basename "$bundle") | |
| helm/replace-oci-refs.sh "$bundle" > "$bundle/Chart.yaml.tmp" && mv "$bundle/Chart.yaml.tmp" "$bundle/Chart.yaml" | |
| helm dep update "$bundle" | |
| if [[ "$name" == "cortex-nova" ]]; then | |
| # nova has KVM-gated rules; render both flavours. | |
| helm template "$name" "$bundle" | yq 'select(.kind == "PrometheusRule") | .spec' > "rendered/${name}-default.yaml" | |
| helm template "$name" "$bundle" --set kvm.enabled=true | yq 'select(.kind == "PrometheusRule") | .spec' > "rendered/${name}-kvm.yaml" | |
| else | |
| helm template "$name" "$bundle" | yq 'select(.kind == "PrometheusRule") | .spec' > "rendered/${name}.yaml" | |
| fi | |
| done | |
| ls -la rendered/ | |
| - name: Check rules with promtool | |
| uses: peimanja/promtool-github-actions@741be6fd6b8ee6a1d777ea020076b70c6233b3a1 # v0.0.2 | |
| with: | |
| promtool_actions_subcommand: 'rules' | |
| promtool_actions_files: 'rendered/*.yaml' | |
| promtool_actions_version: 'latest' | |
| promtool_actions_comment: 'false' |