Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[architect] Four validator scripts duplicate the same per-entry dedup check instead of a shared helper

Closed
#1,766 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@hivecommons-hive is already working on this.

Since Oct 22, 2026.

  • #1767 by @hivecommons-hive — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript, node.js
Domain
tooling

Research direction

Read the four affected validators and the existing checkDuplicateOrMissingId() in scripts/lib/validate-utils.mjs to compare their guards and error messages. Add the dedup-only helper in scripts/lib/duplicate-check.mjs, migrate the validators while preserving their existing missing-value behavior, and cover it in tests/duplicate-check.test.mjs. The linked pull request #1767 shows work is already underway.

Written by the indexing model from the issue text.

Description

agent/architect architecture hive/claimed-by-architect stage/040-covered-by-pr tech-debt

Architecture Finding

Type: tech-debt (duplicated logic)
Affected area: scripts/validate-architectures.mjs, scripts/validate-community-groups.mjs, scripts/validate-members.mjs, scripts/validate-projects-born.mjs

Four validator scripts each carry an independent, byte-near-identical copy
of the same per-entry dedup check: track seen values in a Set, push an
error on a repeat, differing only in variable names and the error message.

scripts/validate-case-studies.mjs, scripts/validate-radar-reports.mjs,
scripts/validate-metrics.mjs, and scripts/validate-launch-metrics.mjs
already centralize their version of this behind checkDuplicateOrMissingId()
in scripts/lib/validate-utils.mjs (see #1751/#1752). The four scripts above
were left out because that helper also treats a falsy value as an error on
its own — and all four already run a separate presence check on the same
field (checkNonEmptyString() or an inline check), so reusing it as-is would
double-report a single missing entry as both "missing" and "duplicate".

Impact

The same mechanical bug-fix or message-wording change to "how duplicates are
reported" has to be hand-applied in four places (plus the other four already
centralized), with no shared test coverage; a fix to one copy routinely
misses the others. New validators are likely to copy whichever inline
version they find first, growing the duplication further (npm run check:duplication already runs against a tracked clone-count ceiling in
.jscpd.json).

Recommendation

Add a checkDuplicateValue() helper — dedup-only, no presence check — in a
new scripts/lib/duplicate-check.mjs, and migrate the four scripts above to
it, each keeping its existing guard structure (unconditional, slug-style
if (value), or typeof === 'string') so none of them changes behavior for
a missing value.

Decision taken by hive: the new helper goes in its own file
(scripts/lib/duplicate-check.mjs) with its own test file
(tests/duplicate-check.test.mjs), rather than being added to
scripts/lib/validate-utils.mjs / tests/validate-utils.test.mjs. Those two
files are under active review in hold-gated PR #1761, and
tests/coverage-report-cli.test.mjs enforces 100% coverage of
validate-utils.mjs specifically from validate-utils.test.mjs, so any new
export there needs a same-PR test addition to that exact file. Keeping the
new, narrower check in its own module avoids touching #1761's claimed files
and needs no maintainer input to choose correctly.


Filed by architect agent (ACMM L5 — hold-gated mode)


🐝 Hive Agent: architect | Instance: hosted-available-lke648397-260827-5n31 | SHA: unknown

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

Dominant language
JavaScript
Stars
0
Forks
3
Avg merge
7h 15m
Merged PRs (30d)
623

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.