Skip to content

refactor: centralize sourceUrl and id-dedup checks across case-studies/radar-reports validators - #1739

Merged
mrbobbytables merged 1 commit into
mainfrom
arch/case-studies-radar-validation-dedup
Oct 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
arch/case-studies-radar-validation-dedup

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Refactor

Extracts checkPublishableSourceUrl(errors, path, value) and checkDuplicateOrMissingId(errors, path, id, seen) into scripts/lib/validate-utils.mjs, and updates scripts/validate-case-studies.mjs and scripts/validate-radar-reports.mjs to call them instead of carrying byte-identical inline copies (5 jscpd-detected clone blocks between the two files). Follows the same centralize-after-drift convention validate-utils.mjs already documents for checkNonEmptyArray/checkParseableDate/etc. Each validator's own non-identical per-entry checks (organization/duplicate-url/projects/industries for case studies; summary/placeholder for radar reports) are untouched. Adds direct unit tests for both new helpers (both pass/fail branches) in tests/validate-utils.test.mjs; full existing test suite, lint, prettier, and coverage gates pass unchanged from baseline.

Fixes #1738


Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=architect backend=copilot model=claude-opus-4-6 copilot=1.0.88

Extract checkPublishableSourceUrl() and checkDuplicateOrMissingId() into
scripts/lib/validate-utils.mjs, following its existing
centralize-after-drift convention, and use them from
validate-case-studies.mjs and validate-radar-reports.mjs in place of
their byte-identical inline copies (jscpd-detected clones). Each file's
own non-identical per-entry checks are left untouched.

Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "architect" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endusers ready!

Name Link
🔨 Latest commit 60fdfe4
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6ad8654194e24c2e067d63bf
😎 Deploy Preview https://deploy-preview-1739--endusers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read both validators and the extracted helpers against the tree at 60fdfe4 — this is a faithful, behavior-preserving extraction. Looks correct to me.

What I checked:

  • checkPublishableSourceUrl() (scripts/lib/validate-utils.mjs:257-267): Boolean(value) && Boolean(publishableCncfUrl(value)) is equivalent to the removed !data.sourceUrl || !publishableCncfUrl(data.sourceUrl) guards, and the error message string is byte-identical to both inline copies it replaces.
  • checkDuplicateOrMissingId() (scripts/lib/validate-utils.mjs:285-296): preserves the subtle original semantics — the error path is the display fallback (entry.id ?? entry.slug ?? 'unknown', stringified at the call sites) while the dedup set records raw entry.id, including seen.add(id) running unconditionally, exactly as both originals did.
  • The per-file imports of publishableCncfUrl/CNCF_HOST_SUFFIXES that remain are still used by each validator's own per-entry url checks (scripts/validate-case-studies.mjs:66-70, scripts/validate-radar-reports.mjs:54-58), so nothing dangles.
  • New tests cover both pass and fail branches of each helper, including the duplicate-and-missing-id matrix.
  • All CI checks are green, and the file set is disjoint from #1741 and #1735 as the body claims.

No findings. A maintainer can take this one quickly.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@mrbobbytables

Copy link
Copy Markdown
Member

Maintainer authorization: @mrbobbytables explicitly approved releasing this hold and merging after required checks pass. Reviewed the extraction: sourceUrl validation and error text are preserved, raw entry IDs are still recorded in the dedup set even on failure, and validator-specific checks remain local. Required checks are green at 60fdfe4. Proceeding through the normal merge queue, without bypass.

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 4182815 Oct 21, 2026
14 checks passed
@mrbobbytables
mrbobbytables deleted the arch/case-studies-radar-validation-dedup branch October 26, 2026 01: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.

[architect] Duplicated sourceUrl/id-dedup validation harness in validate-case-studies.mjs and validate-radar-reports.mjs

1 participant