Skip to content

feat: add deployment retention settings#2988

Open
HarshMN2345 wants to merge 1 commit intomainfrom
feat-deployment-retention-ui
Open

feat: add deployment retention settings#2988
HarshMN2345 wants to merge 1 commit intomainfrom
feat-deployment-retention-ui

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

What does this PR do?

image 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 Apr 21, 2026

Greptile Summary

This PR adds a "Deployment retention" settings card to both the Functions and Sites settings pages, allowing users to automatically delete inactive deployments after a configurable number of days. The implementation follows existing patterns in the codebase — Svelte 5 runes, $derived for isUnchanged/isInvalid, invalidate after save, and analytics tracking via the Submit enum.

Confidence Score: 5/5

Safe to merge; remaining finding is a minor style suggestion.

The only finding is a P2 style suggestion about required being unconditional on the disabled InputNumber. The button guard (disabled={isUnchanged || isInvalid}) prevents any incorrect API call in practice, and HTML5 skips required validation on disabled inputs. All logic, state management, and analytics wiring look correct.

No files require special attention.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/updateDeploymentRetention.svelte New settings card for function deployment retention; required attribute is unconditional on the disabled InputNumber, which may cause spurious validation errors depending on the custom Form implementation.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateDeploymentRetention.svelte New settings card for site deployment retention; mirrors the functions variant with the same unconditional required attribute on the disabled input.
src/lib/actions/analytics.ts Adds FunctionUpdateDeploymentRetention and SiteUpdateDeploymentRetention enum values to Submit; straightforward and correctly placed.
src/routes/(console)/project-[region]-[project]/functions/function-[function]/settings/+page.svelte Imports and renders the new UpdateDeploymentRetention component after UpdateBuildCommand; placement and wiring are correct.
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/+page.svelte Imports and renders UpdateDeploymentRetention for sites; placement before UpdateTimeout looks appropriate.

Reviews (1): Last reviewed commit: "feat: add deployment retention settings" | Re-trigger Greptile

label="Retention (days)"
placeholder="Enter retention"
disabled={!retentionEnabled}
required
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.

P2 required not gated on retentionEnabled

The InputNumber has required hardcoded even when disabled={!retentionEnabled}. HTML5 browser validation skips disabled inputs, but if the custom Form component performs its own required validation independently of disabled, it could show a spurious "field is required" error when a user saves with retention toggled off. Consider making required conditional:

Suggested change
required
required={retentionEnabled}

The same issue exists in the sites variant (updateDeploymentRetention.svelte).

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.

2 participants