Skip to content

feat(core): flag published docs linking only to unpublished content#137

Merged
i-afaqrashid merged 1 commit into
mainfrom
feat/unpublished-relationship-detection
May 29, 2026
Merged

feat(core): flag published docs linking only to unpublished content#137
i-afaqrashid merged 1 commit into
mainfrom
feat/unpublished-relationship-detection

Conversation

@i-afaqrashid
Copy link
Copy Markdown
Owner

What

Makes relationship checks status-aware. When a published document's relationship rule is satisfied by count, but every matched related record is a draft, the live page links to nothing live at runtime. cms-lab now emits CMS-RELATIONSHIP-UNPUBLISHED (warning) naming an example draft target.

  • Silent when at least one matched target is published (the link works).
  • CMS-RELATIONSHIP-MISSING still fires when there are no matches at all, so the existing count behavior is unchanged (additive).

Why

"Unpublished linked documents" is one of the original cms-lab failure modes and was top of the feedback wishlist ("unpublished relational content"). It is a classic editorial bug: the related content exists in the CMS so the rule looks satisfied, but it was never published, so the published page is broken at runtime. This is the status-aware direction from #71.

How verified

  • New scan tests: only-draft targets -> CMS-RELATIONSHIP-UNPUBLISHED; one published target -> silent; no targets -> CMS-RELATIONSHIP-MISSING (not UNPUBLISHED).
  • pnpm verify green (206 tests).

Refs #71, improvements relationship work.

Relationship checks are now status-aware. When a published document's
relationship rule is satisfied by count but every matched related record
is a draft, the live page links to nothing live at runtime. Emit
CMS-RELATIONSHIP-UNPUBLISHED (warning) naming an example draft target.

Stays silent when at least one matched target is published, and still
reports CMS-RELATIONSHIP-MISSING when there are no matches at all, so the
existing count behavior is unchanged.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cms-lab-site Ready Ready Preview, Comment May 29, 2026 8:49am

@i-afaqrashid i-afaqrashid merged commit d5d46c0 into main May 29, 2026
12 checks passed
@i-afaqrashid i-afaqrashid deleted the feat/unpublished-relationship-detection branch May 29, 2026 08:50
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