Skip to content

test(swizzle): cover destination symlinks - #10484

Merged
cixzhang merged 2 commits into
mainfrom
test/swizzle-destination-symlinks
Nov 7, 2026
Merged

cixzhang merged 2 commits into
mainfrom
test/swizzle-destination-symlinks

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Who this helps

People who run astryx swizzle into an output folder that is, or contains, a symlink. These tests pin what the merged swizzle code already does, so it can't regress:

  • A destination linked outside the project is refused before anything is written, with or without --overwrite. That covers the output folder, the component folder, a nested folder, or a nested file (live or dangling); the file outside is untouched.
  • A folder linked elsewhere inside the project (for example components → src/components) is written through, nested folders included.

What changed

Test-only. packages/cli/api/swizzle/copy/copy.test.mjs gains the "destination symlinks" suite (spec:AST-017 FR1, FR5) from #5101 by jiunshinn, credited as co-author. It's adapted to the merged code in one way: the fixture's Table.tsx imports the nested file, because the copy follows imports. The rest of the file is unchanged.

Refs #5101

Verification

  • The swizzle copy suite passes (24, all 6 new cases included).
  • Lint passes.

No changeset (test-only).

cixzhang and others added 2 commits November 7, 2026 02:09
Carries the destination-symlink tests from #5101 over to the merged
swizzle code: an output folder, component folder, nested folder or file
linked outside the project is refused before anything is written, with
or without --overwrite, and a folder linked elsewhere inside the project
is written through, nested folders included. The fixtures import the
nested file, since the copy follows imports.

Refs #5101

Co-authored-by: jiunshinn <[email protected]>
Only the destination-symlink block is added; the rest of the file is as
on main.
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 7, 2026 10:19am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 7, 2026
@astracat-bot

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 11:47 AM UTC

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 01dce3c

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 19 rows, core 25 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet because the pull request is a draft. It runs once the pull request is marked ready for review.

The six new destination-symlink cases pin the swizzle confinement rule. A destination linked outside the project is refused with ERR_PATH_TRAVERSAL before anything is written, with or without --overwrite, and a folder linked inside the project is written through. They pass, and disabling the symlink check in assertWithin makes all five refusal cases fail, so they guard the right code. No changes are needed.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 7, 2026 11:32
@cixzhang
cixzhang merged commit 99ab16d into main Nov 7, 2026
113 checks passed
@github-actions
github-actions Bot deleted the test/swizzle-destination-symlinks branch November 8, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 01dce3c1 Deployed Nov 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant