fix(crossplane-observability): derive the provider job label from the PodMonitor the chart ships #52
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: crossplane-observability validate | |
| permissions: | |
| contents: read | |
| # Validates the crossplane-observability chart. Path-filtered so it only runs when that | |
| # chart changes and does not interfere with the repo-wide chart-publish pipeline. | |
| on: | |
| pull_request: | |
| paths: | |
| - "crossplane-observability/**" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "crossplane-observability/**" | |
| workflow_dispatch: | |
| schedule: | |
| # Weekly drift check — re-scrape a live Crossplane and reconcile the allowlist. | |
| - cron: "0 6 * * 1" | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # Static gate — deterministic, no cluster. Runs on every PR. | |
| # helm lint/template · promtool check+test · metric allowlist gate · dashboard JSON | |
| # --------------------------------------------------------------------------- | |
| static: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: azure/setup-helm@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install pyyaml | |
| - name: Install promtool | |
| run: | | |
| VER=2.54.1 | |
| curl -sSL "https://github.com/prometheus/prometheus/releases/download/v${VER}/prometheus-${VER}.linux-amd64.tar.gz" \ | |
| | tar xz --strip-components=1 -C /usr/local/bin "prometheus-${VER}.linux-amd64/promtool" | |
| - name: Install kubeconform | |
| run: | | |
| curl -sSL https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz \ | |
| | tar xz -C /usr/local/bin kubeconform | |
| - name: Validate | |
| run: ./tests/validate.sh | |
| working-directory: crossplane-observability | |
| # --------------------------------------------------------------------------- | |
| # Integration capture — re-run the pinned ephemeral capture and fail if the committed | |
| # fixtures / captured allowlist drift from reality. This is the layer that catches "a | |
| # metric got renamed / never existed", and it is how a versions.env bump is regenerated. | |
| # Heavier than the static gate, so it runs on demand and weekly, not on every PR. | |
| # --------------------------------------------------------------------------- | |
| integration-capture: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install pyyaml | |
| - uses: helm/kind-action@v1 | |
| with: | |
| install_only: true | |
| - name: Capture from the pinned stack | |
| working-directory: crossplane-observability | |
| run: ./tests/integration.sh | |
| - name: Fail if the captured metric name set drifted | |
| working-directory: crossplane-observability | |
| run: | | |
| # Diff only the DERIVED allowlist (deterministic: sorted, de-duplicated metric | |
| # names, no timestamps). The raw tests/fixtures/*.txt dumps are intentionally NOT | |
| # byte-diffed — they carry live counter/gauge values and non-deterministic series | |
| # ordering, so they churn on every scrape even when the metric SET is unchanged. | |
| # A renamed/added/removed metric shows up here; that is the signal this job exists for. | |
| if ! git diff --quiet -- tests/metrics-allowlist.captured.txt; then | |
| echo "::error::The pinned stack emits a different metric name set than" | |
| echo "::error::tests/metrics-allowlist.captured.txt records. Review and, if intended," | |
| echo "::error::commit the regenerated allowlist (and refreshed tests/fixtures/*)." | |
| git diff -- tests/metrics-allowlist.captured.txt | |
| exit 1 | |
| fi | |
| echo "captured metric name set matches the live pinned capture." |