Remove superseded preview package documentation automatically
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 143
Description
## Goal
Decide and implement whether Azure SDK reference docs should automatically remove a package from the **Preview** moniker after a stable release supersedes that preview version.
Today, `Update-DocsMsMetadata.ps1` writes stable releases to `metadata/latest` and prereleases to `metadata/preview`, but publishing a stable version does not remove an older preview entry for the same package. `Update-DocsMsPackageMonikers.ps1` only cleans up packages explicitly marked deprecated. As a result, Learn can continue showing obsolete beta documentation alongside newer stable documentation.
## Proposed policy
Treat a preview as superseded when:
- latest and preview represent the same package identity (including Java group ID where applicable);
- the latest version is semantically greater than or equal to the preview version; and
- there is no newer preview line, such as latest `1.5.0` with preview `2.0.0-beta.1`.
Retain and report entries whose versions cannot be compared safely. Do not infer relationships across package renames. Allow an explicit, time-limited exception when the old preview documents functionality not available in the stable release.
## Clarifications required
Before enabling deletion, agree with the language and Learn owners on:
1. Whether removal should be immediate, have a grace period, or remain manual.
2. Whether old beta links must redirect or remain available through an archive.
3. How exceptions are represented, approved, owned, and expired.
4. How zero-major, manually onboarded, and nonstandard ecosystem versions are classified.
5. Whether the policy applies uniformly to .NET, Java, JavaScript, Python, and C++.
## Implementation outline
1. Add a report-only docindex reconciliation step that compares `metadata/latest` and `metadata/preview` using language-appropriate package identity and version rules.
2. Review the candidate inventory with language and Learn owners and resolve ambiguous cases.
3. Perform the initial cleanup through a reviewed docs-repository PR.
4. Enable continuous cleanup in docindex before package onboarding, service README, and ToC regeneration.
5. For each superseded preview, remove its preview metadata and package-level preview README; let existing automation regenerate onboarding and ToC files.
6. Log removed, retained, excepted, and unparseable entries. Ensure repeated runs are idempotent.
## Test cases
Cover stable superseding same-version and older-version betas, a newer preview line that must remain, Java group identity, scoped npm names, Python version syntax and name normalization, zero-major versions, unparseable/manual versions, exceptions and expiration, renamed packages, deprecated packages, missing preview READMEs, report-only mode, and idempotency.
## Done when
- The removal and link-retention policy is approved by SDK language and Learn owners.
- A reviewed inventory establishes the initial impact.
- Newer previews and ambiguous versions are never deleted.
- Exceptions are explicit and time-bound.
- Superseded preview metadata, overview content, onboarding, service README entries, and ToC entries are removed consistently.
- Automated tests cover all supported language version and identity rules.
- by copilot
Contributor guide
Assessment
This issue has not been assessed yet.