Post-Release Soak Monitor #114
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: Post-Release Soak Monitor | |
| # v7.4.10: Repurposed from PR #158 watcher (PR is now closed). | |
| # Daily snapshot of post-release health for the latest published version: | |
| # 1. Open GitHub issues tagged `bun-route` or matching the latest version | |
| # 2. Most recent npm download count for `loki-mode` | |
| # 3. Docker Hub pulls in the last 24h | |
| # 4. Latest GitHub release reactions | |
| # Writes a job summary to the workflow run; uploads JSON artifact for trend | |
| # analysis. Does NOT post to any PR (PR #158 was a one-shot soak target). | |
| on: | |
| schedule: | |
| - cron: '0 9 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: read | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: false | |
| jobs: | |
| soak-monitor: | |
| name: daily soak heartbeat | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Resolve latest version | |
| id: ver | |
| run: | | |
| VERSION=$(cat VERSION | tr -d '\n') | |
| echo "current=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Gather GitHub signals | |
| id: gh | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -uo pipefail | |
| mkdir -p /tmp/soak | |
| # Open issues tagged `bun-route` (post-migration regression label) | |
| OPEN_ISSUES=$(gh issue list --repo "${{ github.repository }}" \ | |
| --label bun-route --state open --json number,title,createdAt 2>/dev/null \ | |
| || echo "[]") | |
| echo "$OPEN_ISSUES" > /tmp/soak/open-issues.json | |
| ISSUE_COUNT=$(echo "$OPEN_ISSUES" | python3 -c "import sys, json; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "?") | |
| echo "open_issues=$ISSUE_COUNT" >> "$GITHUB_OUTPUT" | |
| # Last 5 release reaction totals | |
| RELEASES=$(gh release list --repo "${{ github.repository }}" --limit 5 --json tagName,createdAt 2>/dev/null || echo "[]") | |
| echo "$RELEASES" > /tmp/soak/recent-releases.json | |
| REL_COUNT=$(echo "$RELEASES" | python3 -c "import sys, json; print(len(json.load(sys.stdin)))" 2>/dev/null || echo "0") | |
| echo "recent_releases=$REL_COUNT" >> "$GITHUB_OUTPUT" | |
| - name: Gather npm signals | |
| id: npm | |
| run: | | |
| set -uo pipefail | |
| # npm last-day downloads | |
| DAY=$(curl -fsS "https://api.npmjs.org/downloads/point/last-day/loki-mode" 2>/dev/null \ | |
| | python3 -c "import sys, json; print(json.load(sys.stdin).get('downloads', '?'))" 2>/dev/null || echo "?") | |
| WEEK=$(curl -fsS "https://api.npmjs.org/downloads/point/last-week/loki-mode" 2>/dev/null \ | |
| | python3 -c "import sys, json; print(json.load(sys.stdin).get('downloads', '?'))" 2>/dev/null || echo "?") | |
| echo "last_day=$DAY" >> "$GITHUB_OUTPUT" | |
| echo "last_week=$WEEK" >> "$GITHUB_OUTPUT" | |
| # Confirm latest version on npm | |
| LATEST=$(curl -fsS "https://registry.npmjs.org/loki-mode/latest" 2>/dev/null \ | |
| | python3 -c "import sys, json; print(json.load(sys.stdin).get('version', '?'))" 2>/dev/null || echo "?") | |
| echo "npm_latest=$LATEST" >> "$GITHUB_OUTPUT" | |
| - name: Gather Docker Hub signals | |
| id: docker | |
| run: | | |
| set -uo pipefail | |
| REPO=$(curl -fsS "https://hub.docker.com/v2/repositories/asklokesh/loki-mode/" 2>/dev/null || echo "{}") | |
| PULLS=$(echo "$REPO" | python3 -c "import sys, json; print(json.load(sys.stdin).get('pull_count', '?'))" 2>/dev/null || echo "?") | |
| STARS=$(echo "$REPO" | python3 -c "import sys, json; print(json.load(sys.stdin).get('star_count', '?'))" 2>/dev/null || echo "?") | |
| echo "pulls_total=$PULLS" >> "$GITHUB_OUTPUT" | |
| echo "stars=$STARS" >> "$GITHUB_OUTPUT" | |
| - name: Build snapshot JSON | |
| run: | | |
| cat > /tmp/soak/snapshot.json <<JSON | |
| { | |
| "captured_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)", | |
| "repo_version": "${{ steps.ver.outputs.current }}", | |
| "npm_latest": "${{ steps.npm.outputs.npm_latest }}", | |
| "npm_last_day_downloads": "${{ steps.npm.outputs.last_day }}", | |
| "npm_last_week_downloads": "${{ steps.npm.outputs.last_week }}", | |
| "docker_pulls_total": "${{ steps.docker.outputs.pulls_total }}", | |
| "docker_stars": "${{ steps.docker.outputs.stars }}", | |
| "open_bun_route_issues": "${{ steps.gh.outputs.open_issues }}", | |
| "recent_releases_count": "${{ steps.gh.outputs.recent_releases }}" | |
| } | |
| JSON | |
| cat /tmp/soak/snapshot.json | |
| - name: Write job summary | |
| run: | | |
| { | |
| echo "## Post-Release Soak Snapshot" | |
| echo "" | |
| echo "Captured: $(date -u +%Y-%m-%dT%H:%M:%SZ)" | |
| echo "" | |
| echo "| Signal | Value |" | |
| echo "|---|---|" | |
| echo "| Repo VERSION | ${{ steps.ver.outputs.current }} |" | |
| echo "| npm latest | ${{ steps.npm.outputs.npm_latest }} |" | |
| echo "| npm downloads (last day) | ${{ steps.npm.outputs.last_day }} |" | |
| echo "| npm downloads (last week) | ${{ steps.npm.outputs.last_week }} |" | |
| echo "| Docker pulls (total) | ${{ steps.docker.outputs.pulls_total }} |" | |
| echo "| Docker stars | ${{ steps.docker.outputs.stars }} |" | |
| echo "| Open \`bun-route\` issues | ${{ steps.gh.outputs.open_issues }} |" | |
| echo "| Recent releases | ${{ steps.gh.outputs.recent_releases }} |" | |
| echo "" | |
| echo "Snapshot JSON attached as artifact \`soak-snapshot\`." | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload snapshot artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: soak-snapshot-${{ github.run_id }} | |
| path: /tmp/soak/ | |
| if-no-files-found: warn | |
| retention-days: 90 |