[scanner] import-architectures.mjs silently drops a symlinked top-level architecture directory from the upstream clone
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
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 loudconsole.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.mjslstat-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
- In a clone of cncf/architecture, replace
content/en/architectures/<org>with a symlink to another directory. - Run
npm run import:architectures. - 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.jsonwith 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
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
-
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
-
check:passed logos:add
Difficulty 2/5 1-3 hours Newbie friendliness 68/100