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

[scanner] import-architectures.mjs silently drops a symlinked top-level architecture directory from the upstream clone

Closed Beginner friendly
#1,267 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1290 by @mrbobbytables — merged

Assessment

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

Research direction

Start at the top-level enumeration in scripts/import-architectures.mjs (around lines 92-94), where readdirSync results are filtered with isDirectory(), and compare it with the symlink guard in walkFiles() (around lines 206-220). Add a check for isSymbolicLink() that emits a console.warn or fails, following that pattern. Done when a symlinked architecture directory is reported rather than silently dropped, and a new test beside the symlink tests near lines 703 and 739 of tests/import-architectures.test.mjs passes.

Written by the indexing model from the issue text.

Description

agent/scanner bug hive/hosted-available-lke648397-260827-5n31

Finding

scripts/import-architectures.mjs:92-94 lists the upstream cncf/architecture clone with:

readdirSync(source, { withFileTypes: true })
  .filter((entry) => entry.isDirectory())
  .map((entry) => importArchitecture(entry.name, commit))

Dirent.isDirectory() is false for a symbolic link, so a symlinked top-level directory under content/en/architectures is dropped from the import silently — no warning, no error, no record.

This is inconsistent with the guards the same file and repo already apply to upstream symlinks:

  • walkFiles() (scripts/import-architectures.mjs:206-220) refuses symlinked entries with a loud console.warn('Skipping symlink ...') (#533)
  • isRealDirectory() (:200-202) lstat-guards the images/ root (#548)
  • listArchitecturePages() fails closed on symlinked dirs under docs/architectures/ (#1242)
  • enduser-collector.mjs lstat-guards the landscape roots and logo candidates

The top-level directory enumeration is the one remaining unguarded Dirent.isDirectory() filter over third-party input.

Steps to Reproduce / Evidence

  1. In a clone of cncf/architecture, replace content/en/architectures/<org> with a symlink to another directory.
  2. Run npm run import:architectures.
  3. The symlinked architecture is skipped with no log output. Because the import first prunes every imported page (:80-84: 'Prune every imported page, not just the ones whose directory still exists upstream'), the architecture's page is deleted and the architecture disappears from the published site and from data/architectures/catalog.json with zero evidence in the import log — masking upstream tampering or restructuring.

Existing tests cover the symlinked images/ root (tests/import-architectures.test.mjs:703, #548) and symlinked entries inside a real images/ dir (:739, #533), but nothing covers a symlinked top-level architecture directory.

Recommendation

Mirror the walkFiles guard at the top-level filter: check entry.isSymbolicLink() before the isDirectory() filter and fail loudly (or at minimum console.warn and record the skip), consistent with the repo's fail-loud convention for upstream symlinks. Add a unit test beside the #533/#548 symlink tests in tests/import-architectures.test.mjs.


Filed by scanner agent (ACMM L4 — issues-only mode)


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

— hive: agent=scanner backend=copilot model=kimi-k3 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.