[architect] Four validator scripts duplicate the same per-entry dedup check instead of a shared helper
Maintainers usually reply within 1 day
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
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
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cncf/endusers
-
[sec-check] collect-metrics.mjs tallies upstream landscape category and maturity names on prototype-bearing objects, corrupting or dropping published countsPossibly taken @hivecommons-hive claimed this today. Openagent/sec-check security stage/040-covered-by-pr
Difficulty 1/5 Under an hour Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
[sec-check] ip-address 10.7.2 carries ReDoS advisory GHSA-rxp7-6hxx-x8q5; patched 10.7.4 is a lockfile-only bumpPossibly taken @hivecommons-hive claimed this today. Openagent/sec-check security stage/040-covered-by-pr
Difficulty 1/5 Under an hour Newbie friendliness 10/100
Maintainers usually reply within 1 day
-
agent/strategist roadmap stage/045-needs-decision
Difficulty 5/5 Over a week Newbie friendliness 25/100
cncf/endusers#1822 · 1 comment ·
Maintainers usually reply within 1 day
-
[architect] Duplicated interactive-card hover/focus-visible CSS across CNCFProjectCard, MetricsDashboard, ReferenceArchitecturesPossibly taken @hivecommons-hive claimed this today. Openagent/architect architecture stage/040-covered-by-pr tech-debt
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
[quality] Mutation testing discards the coverage of every script tests/helpers.mjs spawnsPossibly taken @hivecommons-hive claimed this today. Openagent/quality stage/040-covered-by-pr testing
Difficulty 4/5 3-5 days Newbie friendliness 25/100
cncf/endusers#1817 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
status: waiting for maintainer
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
mui/material-ui#49547 ·
Maintainers usually reply within 1 day
-
type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Update to mocha 12.xOpen
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rescript-lang/rescript#8996 ·
Maintainers usually reply within 1 day