Skip to content

Write deployment packages to the system temp dir instead of .bref/ - #50

Merged
mnapoli merged 2 commits into
mainfrom
cloud-56-package-temp-dir
Aug 27, 2026
Merged

Write deployment packages to the system temp dir instead of .bref/#50
mnapoli merged 2 commits into
mainfrom
cloud-56-package-temp-dir

Conversation

@mnapoli

@mnapoli mnapoli commented Aug 27, 2026

Copy link
Copy Markdown
Member

Fixes CLOUD-56.

Every deploy of a bref.php application wrote its package to .bref/package-<hash>.zip in the project directory and never removed older ones: the smoke test application had accumulated 12 zips totalling ~520 MB. And a project that also has a serverless.yml would package .bref/ into its Lambda zip and fail on the 250 MB unzipped size limit, with an error pointing nowhere near the cause.

Packages are now written to the system temp directory (tempnam()) instead of .bref/, and deleted once the upload finishes (in a finally, so failed uploads don't leave them behind either). No cleanup of packages left behind by older CLI versions: bref.php deployments are completely internal, so no user projects have accumulated any.

Verified with the Bref Cloud e2e smoke test pointed at this checkout (BREF_CLI=... tests/e2e/smoke-test.sh): the deployment succeeded end to end and no packages were written to the project or left in the temp directory.

The now-pointless !.bref/** default exclusion in Bref\Cloud\Laravel was removed on the cloud branch of brefphp/bref (fd36ad6b).

https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX

Every deploy of a bref.php application wrote its package to
.bref/package-<hash>.zip in the project and never removed older ones,
growing by ~43 MB per deploy. Worse, a project that also has a
serverless.yml would package .bref/ into its Lambda zip and fail on the
250 MB unzipped size limit with an error that points nowhere near the
cause.

Packages are now written to the system temp directory and deleted once
uploaded. Deploys also remove the packages that previous CLI versions
left behind in .bref/ (and the directory itself once empty).

Fixes CLOUD-56

Claude-Session: https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX
mnapoli added a commit to brefphp/bref that referenced this pull request Aug 27, 2026
The CLI no longer writes deployment packages to .bref/ in the project
(brefphp/cli#50), so there is nothing there to exclude anymore.

Claude-Session: https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX
bref.php deployments are completely internal, nobody is using them yet,
so there are no user projects with accumulated packages to clean up.

Claude-Session: https://claude.ai/code/session_01T2dpFaYbbPFQaUWUrmqQuX
@mnapoli
mnapoli merged commit 01b7858 into main Aug 27, 2026
5 checks passed
@mnapoli
mnapoli deleted the cloud-56-package-temp-dir branch August 27, 2026 21:15
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.

1 participant