Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat(versions): keep developer setup files and tests/ in Git snapshots - #1678

Merged
gregpriday merged 4 commits into
developfrom
feature/issue-1484-preserve-developer-configuration-files
Nov 28, 2026
Merged

gregpriday merged 4 commits into
developfrom
feature/issue-1484-preserve-developer-configuration-files

Conversation

@gregpriday

Copy link
Copy Markdown
Member

Git-backed saved versions (and the export milestones and restore backups built on the same snapshot) now keep the developer's own setup files and tests, as an Editable Source export already does. Private files stay out at any depth.

Resolves #1484

Changes

  • Snapshot allowlist (src/main/project/snapshot-inventory.ts): at the project's top, tsconfig*.json, wrangler.toml / wrangler.json / wrangler.jsonc, netlify.toml and any <name>.config[.<variant>].{js,ts,mjs,cjs,mts,cts,json} (eslint.config.js, vitest.config.ts, playwright.config.e2e.ts, searchsocket.config.ts). The vite.config.*.timestamp-*.mjs copies Vite writes while it runs are not kept. tests/ is kept at any depth.
  • Kept out: Wrangler's .wrangler/ state at any depth, a test run's playwright-report/, test-results/, blob-report/ under tests/ and tests/coverage/, .gitmodules (no version can hold one, so a fixture's copy would abort the save), and two new private names that exports leave out too: direnv's .envrc / .envrc.<name>, and a .auth/ folder (Playwright's signed-in browser state).
  • Publications keep their scope: a publication carries the snapshot tree minus these developer-only files (developerOnly), so tests/ and tool configs never reach a published site, and a build setting that loads one still stops with "a publication does not carry".
  • Export milestone check (copiedAsCaptured): lists the copy the way a snapshot walk does, so a test file added between the milestone's capture and the copy stops the export. A fixture repository under tests/ (its .git a file, a folder or a link) doesn't stop it.
  • Plain (non-Git) saved versions are unchanged: they hold the documents and media only, and none of the project's code (package.json, src/) either.

Testing

  • Own: tests/unit/snapshot-inventory.test.ts, tests/unit/publication-controller.test.ts, tests/unit/milestones-export.test.ts, tests/unit/export.test.ts. The new snapshot-place and capture tests and the milestone "test added" / fixture-repository cases fail without the change.
  • Adjacent: publication, published-addresses, remote-publish, source-sync-session, saved-versions, milestones, export-staging, open-project, draft-export: green.
  • Impact: 66 of 653 unit test files (10%), all green. After rebasing onto the latest develop, the tests covering controller.ts (the one file changed on both sides) were rerun: green.
  • npm run typecheck: green.

Not changed

  • A secret written straight into wrangler.toml ([vars]) is still captured: the issue asks for that file, and Wrangler's secrets belong in .dev.vars, which stays private.

- Snapshot allowlist takes tsconfig*.json, wrangler.{toml,json,jsonc}, netlify.toml and <name>.config.* at the top, and tests/ at any depth
- Wrangler state and a test run's reports stay out as caches; .envrc is private
- Publications keep carrying the site alone, never the developer's own files
- An export milestone's copy check covers files added under tests/
…orts out of snapshots

- .gitmodules is local state and a .auth folder private at any depth; .envrc.<name> is private
- Named setup configs (vitest.config.unit.ts) are kept, Vite's timestamped copies are not
- Only tests/coverage is a test run's coverage, not a fixture folder named so
- An export milestone's copy check lists the copy as a snapshot walk does, so a fixture repository no longer stops it
…ure repository through a milestone export

- A .auth folder is a private name, in exports and snapshots alike
- The milestone check skips a copied file the project's own snapshot walk leaves out, unless it is gone from the project
@gregpriday
gregpriday merged commit ddec1cf into develop Nov 28, 2026
1 check passed
@gregpriday
gregpriday deleted the feature/issue-1484-preserve-developer-configuration-files branch November 28, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve developer configuration files and tests/ in saved versions and Git snapshots

1 participant