Skip to content

Health Dashboard

Health Dashboard #66

# =============================================================================
# Health Dashboard — Daily plugin health check
# =============================================================================
# Runs every day at 06:00 UTC against the main branch.
# Tests and builds every plugin; creates GitHub issues for failures.
# =============================================================================
name: Health Dashboard
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
env:
NODE_VERSION: '20'
NEXT_TELEMETRY_DISABLED: 1
permissions:
contents: read
issues: write
jobs:
# ===========================================================================
# Plugin Health Matrix — Test & build every plugin
# ===========================================================================
plugin-health:
name: Health — ${{ matrix.plugin }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
plugin:
- capacity-planner
- community
- marketplace
- developer-api
- plugin-publisher
outputs:
result: ${{ steps.health.outputs.result }}
steps:
- name: Checkout main
uses: actions/checkout@v6
with:
ref: main
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build SDK
run: cd packages/plugin-sdk && npm run build
- name: Run health check
id: health
run: |
PLUGIN="${{ matrix.plugin }}"
STATUS="pass"
echo "::group::Testing ${PLUGIN}"
cd plugins/${PLUGIN}/frontend
# Run tests
if ! npm test --if-present 2>&1; then
echo "::warning::Tests failed for ${PLUGIN}"
STATUS="fail"
fi
# Build UMD bundle
if ! npm run build:umd --if-present 2>&1; then
echo "::warning::Build failed for ${PLUGIN}"
STATUS="fail"
fi
echo "::endgroup::"
echo "result=${STATUS}" >> $GITHUB_OUTPUT
echo "Plugin ${PLUGIN}: ${STATUS}"
# ===========================================================================
# Summary — Collect results and create issues for failures
# ===========================================================================
summary:
name: Health Summary
runs-on: ubuntu-latest
needs: plugin-health
if: always()
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: main
- name: Generate summary report
id: report
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "## Plugin Health Dashboard" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Run date:** $(date -u '+%Y-%m-%d %H:%M UTC')" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** main" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Plugin | Status |" >> $GITHUB_STEP_SUMMARY
echo "|--------|--------|" >> $GITHUB_STEP_SUMMARY
OVERALL="pass"
FAILED_PLUGINS=""
# Check the overall matrix result
MATRIX_RESULT="${{ needs.plugin-health.result }}"
for plugin in capacity-planner community marketplace developer-api plugin-publisher; do
if [[ "${MATRIX_RESULT}" == "success" ]]; then
echo "| ${plugin} | :white_check_mark: Pass |" >> $GITHUB_STEP_SUMMARY
else
# If the matrix failed, we can't distinguish per-plugin.
# Mark all as needing review; individual job logs have details.
echo "| ${plugin} | :warning: Review needed |" >> $GITHUB_STEP_SUMMARY
OVERALL="fail"
FAILED_PLUGINS="${FAILED_PLUGINS} ${plugin}"
fi
done
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${OVERALL}" == "pass" ]]; then
echo ":white_check_mark: **All plugins healthy**" >> $GITHUB_STEP_SUMMARY
else
echo ":x: **Some plugins need attention** — see individual job logs" >> $GITHUB_STEP_SUMMARY
fi
echo "failed_plugins=${FAILED_PLUGINS}" >> $GITHUB_OUTPUT
echo "overall=${OVERALL}" >> $GITHUB_OUTPUT
- name: Create issues for failures
if: steps.report.outputs.overall == 'fail'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FAILED="${{ steps.report.outputs.failed_plugins }}"
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
for plugin in ${FAILED}; do
TITLE="[Health] Plugin ${plugin} failing on main"
# Check if an open issue already exists to avoid duplicates
EXISTING=$(gh issue list --label "P0/critical" --label "plugin/${plugin}" --state open --json number --jq 'length')
if [[ "${EXISTING}" -gt 0 ]]; then
echo "Issue already exists for ${plugin} — skipping"
continue
fi
gh issue create \
--title "${TITLE}" \
--body "## Plugin Health Check Failure
**Plugin:** \`${plugin}\`
**Branch:** main
**Date:** $(date -u '+%Y-%m-%d %H:%M UTC')
**Workflow run:** ${RUN_URL}
The daily health check detected that plugin \`${plugin}\` is failing to build or test on the main branch.
### Action Required
- [ ] Review the [workflow run logs](${RUN_URL}) for details
- [ ] Fix the failing tests or build
- [ ] Verify the fix passes locally
- [ ] Close this issue once resolved" \
--label "P0/critical" \
--label "plugin/${plugin}" \
|| echo "::warning::Could not create issue for ${plugin} (label may not exist)"
done