Skip to content

Fix deployment upload archive validation and queue state#3021

Merged
HarshMN2345 merged 2 commits intomainfrom
fix-deployment-upload-queue-state
May 5, 2026
Merged

Fix deployment upload archive validation and queue state#3021
HarshMN2345 merged 2 commits intomainfrom
fix-deployment-upload-queue-state

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

What does this PR do?

image **

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 4, 2026

Greptile Summary

  • Centralises deployment archive validation into getInvalidDeploymentArchiveReason (enforces .tar.gz-only), applies it reactively in all four upload pages, and narrows Upload.Dropzone accepted extensions from ['gz', 'tar'] to ['gz'].
  • Refactors uploader.ts to add per-kind group state (storage / deployments) with independent open/close visibility, a stable clientId for queue identity, and a shared uploadDeployment helper that correctly wires onProgress for both site and function deployments.
  • The handleInvalid fallback in create-site/manual/+page.svelte lost its native-event file extraction, which causes a generic "Invalid file" toast instead of a specific message when the Dropzone's own extension filter rejects a file.

Confidence Score: 4/5

Safe to merge with one minor UX regression in the site-creation page's invalid-file error messaging.

Only P2 findings remain. The core logic (progress tracking, queue identity, archive validation) is correctly implemented. The single regression (wrong toast message for Dropzone-native rejected files) is a non-critical UX issue.

src/routes/(console)/project-[region]-[project]/sites/create-site/manual/+page.svelte — handleInvalid fallback path.

Important Files Changed

Filename Overview
src/lib/helpers/files.ts Adds getInvalidDeploymentArchiveReason helper that centralises .tar.gz-only and size validation; maxSize guard now correctly uses !== undefined instead of a falsy check.
src/lib/stores/uploader.ts Major refactor: adds per-group state (storage / deployments), a clientId for stable identity, and a shared uploadDeployment helper that properly wires onProgress; startCommand is silently dropped from site deployments (previously flagged).
src/lib/components/uploadBox.svelte Rewritten from using Upload.Box to a custom grouped layout; shows per-group open/close controls and per-file status icons; no progress percentage is displayed (intentional per PR screenshot).
src/routes/(console)/project-[region]-[project]/sites/create-site/manual/+page.svelte Adds reactive archive validation, removes startCommand from upload call, and narrows Dropzone to gz only; the handleInvalid fallback path now queries the bound files variable instead of the native DOM event, which can produce a generic error message when the Dropzone itself rejects a file.
src/routes/(console)/project-[region]-[project]/functions/create-function/manual/+page.svelte Adds reactive archive validation via getInvalidDeploymentArchiveReason, narrows accepted extensions to ['gz'], and scopes upload-file lookup by kind.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/(modals)/createManual.svelte Adds reactive archive validation and narrows Upload.Dropzone to ['gz'] extensions only.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/createManualDeploymentModal.svelte Adds reactive archive validation and narrows Upload.Dropzone to ['gz'] extensions only.
src/routes/(console)/project-[region]-[project]/storage/bucket-[bucket]/+page.svelte Scopes the isUploading check to kind === 'storage' files only, fixing false positives when deployment uploads are in progress.

Reviews (2): Last reviewed commit: "fix: restore deployment upload progress" | Re-trigger Greptile

Comment thread src/lib/stores/uploader.ts
Comment thread src/lib/helpers/files.ts Outdated
</Typography.Text>
<Upload.Dropzone
extensions={['gz', 'tar']}
extensions={['gz']}
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.

Can you try to upload something like .png.gz? If that will work, I think thats wrong. Curious if tere is any way to be more specific. If not by inpu itself, maybe by JS implementation

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Upload.Dropzone only supports filtering by extension, so ['gz'] is the closest we can get there. That still allows files like .png.gz, so I added a check in JS (file.name.endsWith('.tar.gz')) after selection to make sure only .tar.gz files are accepted.

Comment thread src/lib/helpers/files.ts Outdated
@HarshMN2345 HarshMN2345 requested a review from ChiragAgg5k May 5, 2026 05:58
@HarshMN2345 HarshMN2345 merged commit 076c98c into main May 5, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-deployment-upload-queue-state branch May 5, 2026 06:06
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.

3 participants