Azure / Azure/azure-sdk-tools

[APIView] WI-4: Retention Configuration & RetainUntil Field

Open
#14,995 1 comment 0 reactions 1 assignee Claimed by @tjprescott View on GitHub
APIView
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
144

Description

## Goal

Lay the config and schema groundwork for the unified retention system.

**Area:** Retention · **Depends on:** Nothing (parallel with WI-1) · **Stable alone:** ✅ Yes — adds config keys and a nullable field; nothing reads them yet

## Deliverables

### Configuration

Add keys to Azure App Configuration under `RetentionPolicy:` prefix with `RetentionPolicyOptions` class:

| Key | Default | Purpose |
|---|---|---|
| `RetentionPolicy:SupersededPreviewDaysAfterStable` | `90` | Unapproved/unreleased preview cleanup after stable ships |
| `RetentionPolicy:GraduatedRollingPrereleaseDays` | `30` | Rolling prerelease cleanup after stable ships |
| `RetentionPolicy:MergedPullRequestDays` | `60` | Non-promoted merged PR version cleanup |
| `RetentionPolicy:ClosedPullRequestDays` | `30` | Closed-without-merge PR version cleanup |
| `RetentionPolicy:SupersededRevisionHardDeleteDays` | `30` | Hard-delete for superseded revisions within a version |

Register in `Startup.cs` with `services.Configure(configuration.GetSection("RetentionPolicy"))`.

### `RetainUntil` field

Add `DateTime? RetainUntil` to both `APIVersionModel` and `APIRevisionListItemModel`. Default `null` = retain indefinitely. Set when retention clock starts, not computed during purge.

### Tests

- `RetentionPolicyOptionsTests.cs` — Defaults correct; App Config overrides work; missing keys fall back to defaults

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.