Skip to content

fix(observability): guard against nil tag before sort - #283

Merged
TimeToBuildBob merged 1 commit into
masterfrom
fix/observability-nil-sort
Oct 11, 2026
Merged

TimeToBuildBob merged 1 commit into
masterfrom
fix/observability-nil-sort

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Owner

Summary

  • site.tags["observability"] returns nil when no posts carry the tag
  • | sort: "date" on nil throws Cannot sort a null object. in Liquid
  • Fix: nil-check before sort, fall back to "" | split: "" (empty array)

Impact

This was breaking the weekly gptme digest publish step (bob-weekly-gptme-digest.service) — the pre-commit Jekyll build failed, blocking the website PR from being created.

Test plan

  • Jekyll build passes with the nil guard in place (pre-commit passed locally)
  • Site builds without error when no posts are tagged observability

site.tags["observability"] returns nil when no posts carry the tag,
causing Liquid's sort filter to throw 'Cannot sort a null object.' and
breaking the pre-commit Jekyll build. Guard with a nil check and fall
back to an empty array.

Broke the weekly gptme digest publish step (bob-weekly-gptme-digest.service).

Git-Session-Id: 0e108269-aed7-406a-9942-c991b20ebdb0
@TimeToBuildBob

TimeToBuildBob commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner Author

🤖 AI code review

The PR modifies observability.pug to guard against a nil value for site.tags["observability"] before sorting. It assigns the raw tag array to obs_posts_raw, then conditionally sorts and reverses it if non-nil, otherwise assigns an empty array via "" | split: "". This prevents a Liquid 'Cannot sort a null object' error when no posts carry the observability tag.

Safe to merge — no P0/P1 findings

Confidence 5/5

✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads.

1 advisory finding (summary-only, not scored)

These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.

⚠️ P2 medium — observability.pug

This is a fix(...) PR but no test files are included in the diff. Erik's feedback: 'where is the repro & fixes they are supposed to catch' (gptme#3441), 'that measurement should come with a regression test' (gptme#3446). Add a test that would have caught this bug. (Advisory: Erik merged all such PRs but consistently requested tests.)

Add a test file that reproduces the bug before the fix and passes after it.

How this was verified: static preflight: fix-commit + touched-files scan (rule 7)

Files changed (1) — the diff as I read it
  • observability.pug — Adds a nil guard around the sort of site.tags["observability"] and falls back to an empty array when the tag is absent.

Reviewed d77d9dcc65ef · openrouter/deepseek/deepseek-v4-flash-0731 · llm engine · 4s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.

@TimeToBuildBob
TimeToBuildBob merged commit df5bbed into master Oct 11, 2026
1 check passed
@TimeToBuildBob
TimeToBuildBob deleted the fix/observability-nil-sort branch October 11, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant