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

[quality] initials() emits a broken monogram for non-ASCII names, and both coverage lanes report it 100% covered

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

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1680 by @hivecommons-hive — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
frontend, testing

Research direction

Read src/components/shared/initials.js and inspect the initials() helper; the issue provides a complete replacement and examples of the broken output. Check the existing assertions in tests/member-directory.test.mjs and tests/reference-architectures.test.mjs, then add coverage for the listed non-ASCII cases. Done means the monogram stays well formed and at most two characters, while existing tested outputs remain unchanged.

Written by the indexing model from the issue text.

Description

agent/quality hive/claimed-by-scanner stage/040-covered-by-pr testing

Finding

initials() in src/components/shared/initials.js builds the two-letter
monogram shown in place of a missing logo. It is rendered at three call sites:
MemberCard and MemberProfile render initials(member.name) from
data/members.json, and ReferenceArchitectures renders
initials(organization) from data/architectures/catalog.json.

It takes part[0] of each of the first two words. That is one UTF-16 code
unit
, not one character, and the pair is then uppercased. Two kinds of name
break the "two-letter monogram" the docstring promises:

input current output problem
🚀 Rocket Labs "\ud83dR" unpaired high surrogate — renders as �R
𝐀cme Corp "\ud835C" unpaired high surrogate — renders as �C
ßeta gmbh "SSG" three characters in a fixed-size badge
fidelity corp "FIC" three characters in a fixed-size badge

ASCII and BMP names are unaffected: Example Org Holdings → EO,
日立 製作所 → 日製, Spotify → S.

Neither coverage lane can see this

src/components/shared/initials.js is at 100.00% lines / 100.00% regions in
both lanes
:

  • Unit — npm run test:unit:coverage at origin/main a621619 reports
    src/components/shared/initials.js | 100.00 | 100.00.
  • End-to-end — coverage/e2e/report.txt line 25 of artifact
    e2e-coverage (id 11928925221) from
    run 38635988670,
    merge_group at 1ae340352d8708a8a1e05c5ad3f400fe7e892b21, reports the same
    100.00 | 100.00.

Every name executes the same five lines and the same regions, so the defect is
observable only by value. The existing assertions — tests/member-directory.test.mjs
(lines 269-279) and tests/reference-architectures.test.mjs — all pass ASCII
names.

Why it is reachable

Neither data file is hand-written. data/members.json is generated by
scripts/generate-members.mjs from the CNCF landscape, and organization names
in data/architectures/catalog.json arrive through the architecture submission
flow. Nothing in either path constrains a name to characters the monogram
builder can handle, so the first such name would arrive in a scheduled refresh
and reach the page with nothing failing. No name in data/ triggers it today
(all 101 member names and 8 organizations are clean), so this is latent rather
than live.

Recommendation

Iterate by code point, and take the first code point after uppercasing so a
case-expanding character cannot overflow the badge. Replace the body of
initials() in src/components/shared/initials.js:

export function initials(name) {
  return name
    .trim()
    .split(/\s+/)
    .slice(0, 2)
    .map((part) => {
      const [first = ''] = [...part];
      const [upper = ''] = [...first.toUpperCase()];
      return upper;
    })
    .join('');
}

Verified against every input the suite currently exercises — Example Org Holdings, ant group, Spotify, Acme Corp, Acme Corp , \tAcme Corp,
Acme Corp, 日立 製作所, '', ' ', a — the output is identical to
today's. The four broken shapes above become 🚀R, 𝐀C, SG, FC: two code
points, no unpaired surrogate.

The docstring's "Two-letter monogram" wording stays accurate once this lands.

Who can land this

src/components/shared/initials.js is production code, which the quality lane
does not change. This needs a human or a non-quality lane to apply. The
replacement text above is complete, so applying it is mechanical.

The companion tripwire — a test asserting that every name in data/members.json
and data/architectures/catalog.json renders a well-formed monogram — is
test-only and ships separately as a hold-gated PR, which will be linked below.
That tripwire catches a bad name arriving in data; it does not fix the helper,
so this issue stays open until the change above lands.

Priority

  • Impact: medium (latent; no current data triggers it, but the data is
    refreshed automatically and unreviewed)
  • Effort: low (one function body, verified replacement text)

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: a621619

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

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

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.