mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 23:33:29 +00:00
chore(release): v1.4.44 — REG-11 dashboard summary fix (iOS Home tile sparkline + value)
iOS-operator-blocking hotfix for REG-11 — Home dashboard tile renders neither chart nor latest value for BP / Puls / Körperfett when the most recent reading is older than 7 days. Root cause was in `/api/dashboard/summary` SQL gates; `latestIn7d` + `sparkBuckets` both required `measured_at >= sevenDaysAgo`, which returned empty for sparse accounts, leaving the iOS tile with `latestValue: null` + `sparkline: []` to render from. Detail-screen (`/api/measurements/series?kind=…`) escaped because of its broader window. Server-side changes: - `latestIn7d` → `latestEver` (drops 7-day filter; DISTINCT ON returns latest reading EVER per type, bounded at N_metrics rows). - `sparkBuckets` rewritten via ROW_NUMBER() OVER (PARTITION BY type ORDER BY bucket_start DESC) so the trailing N daily buckets per type render regardless of age, bounded at SPARK_DAYS × N_metrics. - BP + Pulse metrics.push gated on `latest || allTimeCount > 0` like BodyFat already is — accounts with zero readings ever no longer get empty placeholder tiles. - 4 new regression tests in summary/__tests__/route.test.ts cover sparse accounts, zero-data accounts, within-7d guards. Other develop work bundled in this release: - W4-QoL — copy nits. - W5-WORKOUTS — user source priority threaded through write-time picker + batch route. - W7-WITHINGS-RELIABILITY — response classifier + sync hardening. - W8-OPS — ops phase docs. - B11 — NEXT_PUBLIC_APP_VERSION build-arg routing so /api/version cannot drift from CI tag. - env-check workflow — manifest / example lockstep enforcement. Resolves PR #194 (squash-merge produced via local -X theirs strategy because GitHub's UI couldn't auto-resolve develop's post-v1.4.42 contiguous work against the v1.4.42 squash on main; resulting tree is byte-identical to develop's HEAD).
This commit is contained in:
1 parent
9b6e237f5f
commit
324d4bb411
61 files changed
+3322
-248
No files matched your search
@@ -194,6 +194,15 @@ jobs:
|
||||
file: ./Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
# v1.4.43 B11 — thread the tag ref into the build as
|
||||
# NEXT_PUBLIC_APP_VERSION. The Dockerfile picks it up as an
|
||||
# ARG/ENV and /api/version reads it at runtime. The build-arg
|
||||
# becomes part of the BuildKit layer cache key, so a release
|
||||
# tag bump invalidates every downstream layer that depends on
|
||||
# it (`pnpm build`) and the prior release's version string
|
||||
# can never survive a cache hit into the new image.
|
||||
build-args: |
|
||||
NEXT_PUBLIC_APP_VERSION=${{ github.ref_name }}
|
||||
outputs: |
|
||||
type=image,name=${{ env.IMAGE_REF }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
|
||||
cache-from: |
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
name: Env-manifest <-> example lockstep
|
||||
|
||||
# v1.4.43 B5 -- enforce that `.env.production.example` stays in lockstep
|
||||
# with `scripts/env-manifest.json`. A contributor adding a new required
|
||||
# variable to the manifest must also add a placeholder to the example
|
||||
# file in the same PR, otherwise the workflow fails with a grep-friendly
|
||||
# list of missing required vars. Optional vars are reported but do not
|
||||
# fail the build -- they exist for operator discovery, not deploy
|
||||
# blocking.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
env-check:
|
||||
name: pnpm check-env against .env.production.example
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Assert example file exists
|
||||
run: |
|
||||
if [ ! -f .env.production.example ]; then
|
||||
echo "::error::.env.production.example is missing -- contributors must keep this file in lockstep with scripts/env-manifest.json. See docs/ops/env-check.md."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The check-env script exits non-zero when at least one required
|
||||
# variable from the manifest is missing/empty in the example file.
|
||||
# We additionally grep the rendered output for `[MISSING-REQUIRED]`
|
||||
# rows and surface them as GitHub Actions error annotations so the
|
||||
# PR reviewer can see the missing var names without expanding the
|
||||
# log.
|
||||
- name: pnpm check-env --file .env.production.example
|
||||
id: check
|
||||
run: |
|
||||
set +e
|
||||
OUT=$(pnpm --silent check-env --file .env.production.example)
|
||||
EC=$?
|
||||
echo "$OUT"
|
||||
if [ $EC -ne 0 ]; then
|
||||
echo ""
|
||||
echo "::group::Missing required variables"
|
||||
echo "$OUT" | grep -E '^\s*\[MISSING-REQUIRED\]' | while IFS= read -r line; do
|
||||
name=$(echo "$line" | sed -E 's/.*\[MISSING-REQUIRED\] ([A-Z0-9_]+).*/\1/')
|
||||
echo "::error file=.env.production.example::Required env var $name missing from .env.production.example -- add a placeholder so the file stays in lockstep with scripts/env-manifest.json."
|
||||
done
|
||||
echo "::endgroup::"
|
||||
echo ""
|
||||
echo "::error::pnpm check-env reported missing required variables in .env.production.example. Either add a placeholder for each missing var, or downgrade the manifest entry to required:false if the variable is genuinely optional. See docs/ops/env-check.md."
|
||||
exit $EC
|
||||
fi
|
||||
Reference in new issue
Block a user