Skip to content

[Automated] Draft docs (kagent): helm/metrics: omit reader RBAC for HTTP metrics #550

[Automated] Draft docs (kagent): helm/metrics: omit reader RBAC for HTTP metrics

[Automated] Draft docs (kagent): helm/metrics: omit reader RBAC for HTTP metrics #550

Workflow file for this run

# Hugo + Hextra docs-framework harness, run against kagent's Hugo docs site.
#
# kagent-dev/website is a mixed repo: a Next.js marketing worker at the root and
# a Hugo docs site under docs-site/ that consumes docs-theme-extras. Only the
# docs site is in scope here — every build/config path below is under docs-site/.
#
# One Hugo build feeds two Playwright projects (defined in docs-theme-extras'
# playwright.config.ts):
# --project=static layout / theme-behavior specs (render the theme)
# --project=content scanners that depend on the consumer's real content
# (markdown-leaks walks the built HTML for rendering
# leaks; curl-quotes lints source markdown)
# The `content` scanners are the reason this workflow's path filter includes
# CONTENT paths (docs-site/content/**), not just layout paths: a content PR must
# still run the leak scan, since that's the kind of PR that introduces content
# rendering breaks. docs-site/content is GENERATED from the MDX source by
# `make gen-docs`, and is committed, so a regenerated-content PR touches it and
# triggers here. Both projects share one build, so running the (fast, mostly
# fixture-bound) layout specs on a content PR too costs almost nothing.
#
# The harness lives in solo-io/docs-theme-extras and is checked out at the
# version pinned in docs-site/go.mod. Layouts and tests stay in lockstep —
# bumping the module pin is one PR that updates both.
#
# NOTE: this workflow assumes docs-site/go.mod pins a RELEASED docs-theme-extras
# version with no local `replace` directive. A local `replace` (absolute path)
# used for dev will fail the Hugo build here — remove it and bump the pin first.
#
# Marked continue-on-error while allowlists and fixture-aware specs settle.
# Promote to a required check once it stays green for a sustained run.
name: Framework tests
on:
pull_request:
paths:
# Content — so the `content` scanners run on content-only PRs.
- 'docs-site/content/**'
# Layout / build inputs.
- 'docs-site/layouts/**'
- 'docs-site/static/**'
- 'docs-site/assets/**'
- 'docs-site/go.mod'
- 'docs-site/go.sum'
- 'docs-site/hugo.yaml'
- 'docs-site/.docs-test.toml'
- '.github/workflows/framework-tests.yml'
workflow_dispatch:
jobs:
framework-test:
name: Static + content checks
runs-on: ubuntu-latest
continue-on-error: true
# Bounds a hung `Install chromium` / apt-get step (observed stuck 30+ min
# with no failure — GitHub's default job timeout is 6 hours) so the run
# fails fast instead of sitting until that default kicks in.
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 'stable'
cache: false
- uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3
with:
hugo-version: '0.160.1'
extended: true
- name: Resolve docs-theme-extras ref from docs-site/go.mod
id: theme-sha
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Pull the version field for the module's `require` line. exit-on-first
# match takes `require` (which precedes any `replace`) so a dev-only
# replace line doesn't shadow it. Handles tags, prereleases, and Go
# pseudo-versions.
version=$(awk -v pkg="github.com/solo-io/docs-theme-extras" '
/^replace/ { next }
{ for (i=1; i<=NF; i++) if ($i == pkg) { print $(i+1); exit } }
' docs-site/go.mod)
if [ -z "$version" ]; then
echo "Could not extract docs-theme-extras version from docs-site/go.mod" >&2
exit 1
fi
# Pseudo-version shape: ends with .<14-digit timestamp>-<12-hex short SHA>.
if echo "$version" | grep -qE -- '\.[0-9]{14}-[0-9a-f]{12}$'; then
short=$(echo "$version" | grep -oE '[0-9a-f]{12}$')
ref=$(gh api "repos/solo-io/docs-theme-extras/commits/${short}" --jq .sha)
if [ -z "$ref" ]; then
echo "Could not resolve full SHA for short=${short}" >&2
exit 1
fi
else
ref="$version"
fi
echo "ref=$ref" >> "$GITHUB_OUTPUT"
- name: Check out docs-theme-extras at module pin
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: solo-io/docs-theme-extras
ref: ${{ steps.theme-sha.outputs.ref }}
path: docs-theme-extras
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'docs-theme-extras/package-lock.json'
- name: Build docs-site with Hugo
working-directory: docs-site
run: |
# docs-site's CSS pipeline shells out to tooling in its own
# devDependencies, so install them first so Hugo finds the binaries.
npm ci
# Capture the build log so hugo-warnings.spec can scan it for ERROR /
# WARN lines; surface it and fail if the build itself fails.
hugo --config hugo.yaml --gc --minify > .build.log 2>&1 || { cat .build.log; exit 1; }
- name: Install harness dependencies
working-directory: docs-theme-extras
run: npm ci
# ubuntu-latest resolves apt's default mirror to a region-specific
# azure.archive.ubuntu.com endpoint that has repeatedly gone unreachable
# outright (apt-get update stalls on endless "Ign:" retries instead of
# failing) — same root cause as the timeout guard above. Point apt at
# the direct global mirror before Playwright's installer shells out to
# apt-get, instead of just waiting longer. Use https: plain http to
# archive.ubuntu.com has also stalled ~30s per index file before apt
# falls back to https, which alone used up the 15-minute job budget
# (kagent-dev/website#568). The short timeout makes any remaining dead
# endpoint fail over in seconds rather than half a minute.
- name: Work around flaky azure.archive.ubuntu.com apt mirror
run: |
sudo sed -i -E 's|http://(azure\.)?archive\.ubuntu\.com|https://archive.ubuntu.com|g' \
/etc/apt/sources.list \
/etc/apt/sources.list.d/*.sources \
/etc/apt/apt-mirrors.txt 2>/dev/null || true
printf 'Acquire::http::Timeout "10";\nAcquire::https::Timeout "10";\n' \
| sudo tee /etc/apt/apt.conf.d/99-ci-timeout >/dev/null
- name: Install Playwright browsers
working-directory: docs-theme-extras
run: npx playwright install --with-deps chromium
- name: Run static + content specs
working-directory: docs-theme-extras
env:
DOCS_TEST_CONFIG: ${{ github.workspace }}/docs-site/.docs-test.toml
run: |
# One invocation runs both projects against the single build above.
# pipefail required: bare `run:` steps run as `bash -e {0}` without
# pipefail here, so `tee`'s exit (0) would mask a failing test suite and
# the step would go green. The `if: always()` summary/upload steps below
# already assume this step can fail.
set -o pipefail
npx playwright test --project=static --project=content --reporter=list,html 2>&1 | tee playwright-output.txt
- name: Append summary to PR check
if: always()
working-directory: docs-theme-extras
run: |
{
echo "## Framework tests (informational)"
echo ""
echo '```'
tail -25 playwright-output.txt 2>/dev/null || echo "No test output captured."
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: framework-test-report
path: docs-theme-extras/playwright-report
retention-days: 7