Skip to content

Commit 4b1cf42

Browse files
docs: document per-project preview expiration settings (#639)
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
1 parent 79ffec3 commit 4b1cf42

2 files changed

Lines changed: 39 additions & 4 deletions

File tree

guides/developer/preview-projects.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,41 @@ Promoting content allows you to sync charts and dashboards that you've created o
158158

159159
Learn more about promoting content from preview projects [here](/guides/how-to-promote-content).
160160

161+
## Preview expiration
162+
163+
Preview projects are automatically deleted after they expire. By default, previews expire 720 hours (30 days) after they're created.
164+
165+
Project admins can configure the default expiration and a maximum cap for every preview created from an upstream project.
166+
167+
### Configure preview expiration
168+
169+
<Info>
170+
You need `update Project` permission (project admin or organization admin) to change these settings.
171+
</Info>
172+
173+
1. Open the upstream project's **Project settings**.
174+
2. In the sidebar, select **Preview settings**.
175+
3. Set the values you want and click **Save**:
176+
- **Default preview expiration (hours)** — used when a preview is created without an explicit `--expires-in` value.
177+
- **Maximum preview expiration (hours)** — the upper bound. Any `--expires-in` value above this is silently capped to the maximum.
178+
179+
Both values must be at least `1` hour, and the default must be less than or equal to the maximum.
180+
181+
### How the limits are applied
182+
183+
- **Previews created from this project** (CLI, GitHub Actions, or the Lightdash app) inherit the upstream project's default expiration when no value is provided, and any `--expires-in` value above the maximum is clamped down to the maximum.
184+
- **Standalone previews** (CLI previews with no upstream project) keep the platform default of 720 hours and are not clamped.
185+
186+
For example, with a default of `48` and a maximum of `168`:
187+
188+
```bash
189+
# Uses 48 hours (the project default)
190+
lightdash preview --name "PR: Add Revenue Metric"
191+
192+
# Uses 168 hours (clamped down from 240)
193+
lightdash preview --name "Long-lived preview" --expires-in 240
194+
```
195+
161196
## Deleting a Preview Project
162197

163198
Preview projects created using any method can be deleted in the [Lightdash App](/guides/developer/preview-projects#lightdash-app-2).

references/lightdash-cli.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ All standard [dbt options](#dbt-options) work with `lightdash preview`.
319319
- (default: 1)
320320
- Number of batches to upload in parallel when using batched deploy. Use with caution as higher values may overwhelm the server
321321
- `--expires-in <hours>`
322-
- (default: 720, i.e. 30 days)
323-
- Number of hours until the preview project auto-expires
322+
- (default: the upstream project's configured default, or 720 if there is no upstream project)
323+
- Number of hours until the preview project auto-expires. Values above the upstream project's [maximum preview expiration](/guides/developer/preview-projects#preview-expiration) are silently capped to the maximum.
324324

325325
**Examples:**
326326

@@ -382,8 +382,8 @@ All standard [dbt options](#dbt-options) work with `lightdash start-preview`.
382382
- (default: 1)
383383
- Number of batches to upload in parallel when using batched deploy. Use with caution as higher values may overwhelm the server
384384
- `--expires-in <hours>`
385-
- (default: 720, i.e. 30 days)
386-
- Number of hours until the preview project auto-expires
385+
- (default: the upstream project's configured default, or 720 if there is no upstream project)
386+
- Number of hours until the preview project auto-expires. Values above the upstream project's [maximum preview expiration](/guides/developer/preview-projects#preview-expiration) are silently capped to the maximum.
387387

388388

389389
### `lightdash stop-preview`

0 commit comments

Comments
 (0)