Skip to content

fix(hub): keep the coder's scratch folder out of the app - #150

Merged
brianjfox merged 1 commit into
mainfrom
fix/scratch-outside-app
Nov 4, 2026
Merged

brianjfox merged 1 commit into
mainfrom
fix/scratch-outside-app

Conversation

@brianjfox

Copy link
Copy Markdown
Contributor

Closes #149

What

The coder's .scratch/ folder is never part of the app: the bundle skips it, the starter ignores it, and the coder is told it is the place for throwaway files.

Why

A coder saved its browser screenshots under .scratch/shots/ (about 420 KB of PNGs). Nothing ignored the folder, so the app bundle carried them, passed the 1 MiB limit on a 450 KB app, and the preview showed app_too_large while a check could not file the app. Details in #149.

Changes

  • apps/hub/src/builds/app-snapshot.ts: .scratch joins the directories the bundle never reads; the test covers it.
  • workflows/coder/starter/.gitignore: .scratch/.
  • workflows/coder/starter/AGENTS.md: names .scratch/ for throwaway files such as screenshots.

A coder saved its browser screenshots under .scratch/, which nothing ignored, so the app bundle carried them past the size limit and the preview and the filing failed. The bundle skips .scratch the way it skips installs and builds, the starter ignores it, and the coder is told it is the place for throwaway files.
@corbits-triage

corbits-triage Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Triage: In progress

Triage is waiting for code review before it decides. This comment shows the verdict once it has.

@brianjfox
brianjfox merged commit ec3038d into main Nov 4, 2026
9 checks passed
"dist",
".git",
".builder",
".scratch",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 · App repository sync still picks up .scratch, so screenshots get pushed for workspaces without the new .gitignore

The bundle now skips .scratch. The git sync in builds/app-repository.ts has its own EXCLUDED_DIRECTORIES list (node_modules, dist, .git, .builder, inputs), and this change does not add .scratch to it. That sync only leaves .scratch out when the workspace's .gitignore lists it. Only the starter's .gitignore was updated, so existing workspaces will still commit and push the screenshots to the app repository, which has a 25 MiB limit and carries them into later checkouts.

A coder in a project created before this change saves screenshots under .scratch/; the workspace walk commits and pushes them to the app repository.

Resolve this comment. Triage will not finish while it is open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The coder's scratch screenshots ride along in the app bundle and push it past the size limit

1 participant