Skip to content

Commit ef07fc9

Browse files
authored
Update API retirement and deletion prompts (#28494)
1 parent 72948ac commit ef07fc9

2 files changed

Lines changed: 30 additions & 8 deletions

File tree

.github/prompts/author-api-docs/deprecate-retire.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,15 @@ Retirement is the final stage of the API lifecycle — the deprecated API has re
214214

215215
### Inputs for retirement
216216

217-
The Documentation Plan must explicitly identify:
218-
- Which resources (entity types, complex types) are being retired (marked as "Deleted" or "Removed")
219-
- Which API operation files are linked to the retired resources
220-
- **Dependency analysis for related types:** Complex types referenced as property return types and entity types referenced as relationship targets must be explicitly called out. The Documentation Plan must state whether each related type is also being retired or should be retained.
217+
Retirement can be triggered by:
218+
- **Schema change:** A Documentation Plan or changelog showing `ChangeType: "Deletion"` for entities, complex types, properties, relationships, actions, or functions
219+
- **Endpoint removal:** The product stops supporting an endpoint — this may not appear in the schema. The author will specify which endpoints are removed and the affected version(s).
220+
221+
The Documentation Plan or author prompt must identify:
222+
- Which resources (entity types, complex types) are being retired
223+
- Which version(s): beta, v1.0, or both
224+
- The alternative API or resource (for redirects)
225+
- **Dependency analysis for related types:** Complex types referenced as property return types and entity types referenced as relationship targets may still be in use by other APIs. Only delete a related type if it is explicitly called out as retired — otherwise retain it.
221226

222227
### Retirement workflow
223228

@@ -242,11 +247,14 @@ Based on the Documentation Plan, delete:
242247
3. **Permission include files** for the retired API operation files:
243248
- `api-reference/{version}/includes/permissions/{operation}-permissions.md` (naming may vary — match the include reference in each API operation file)
244249

245-
4. **Complex type files** explicitly called out as retired/deleted in the Documentation Plan:
250+
4. **RBAC include files** for the retired API operation files (if they exist and not in use by other APIs):
251+
- `api-reference/{version}/includes/rbac-for-apis/{rbac-file}.md` (match the include reference in each API operation file)
252+
253+
5. **Complex type files** explicitly called out as retired/deleted in the Documentation Plan:
246254
- Only delete if the Documentation Plan explicitly marks the complex type as retired/deleted
247255
- If not explicitly called out as retired, retain the file
248256

249-
5. **Enum files or sections** explicitly called out as retired/deleted in the Documentation Plan:
257+
6. **Enum files or sections** explicitly called out as retired/deleted in the Documentation Plan:
250258
- For standalone enum files: delete if explicitly marked as retired
251259
- For H3 sections in parent resources: removed when parent resource is deleted
252260
- For entries in global enums files (`enums.md`, `enums-{subnamespace}.md`): remove the enum section
@@ -277,12 +285,12 @@ Add redirects for **resource files that include Methods tables** (entity types)
277285
"redirections": [
278286
{
279287
"source_path": "api-reference/{version}/resources/{retired-resource}.md",
280-
"redirect_url": "/graph/api/resources/{alternative-resource}",
288+
"redirect_url": "/graph/api/resources/{alternative-resource}?view=graph-rest-{version}",
281289
"redirect_document_id": false
282290
},
283291
{
284292
"source_path": "api-reference/{version}/api/{retired-operation}.md",
285-
"redirect_url": "/graph/api/{alternative-operation}",
293+
"redirect_url": "/graph/api/{alternative-operation}?view=graph-rest-{version}",
286294
"redirect_document_id": false
287295
}
288296
]
@@ -367,6 +375,7 @@ In addition to the [base quality checklist](common.md#base-quality-checklist), v
367375
- [ ] All resource files explicitly marked as retired/deleted are deleted
368376
- [ ] All API operation files linked to retired resources are deleted
369377
- [ ] All permission include files for retired operations are deleted
378+
- [ ] All RBAC include files for retired operations are deleted (if they existed and not in use by other APIs)
370379
- [ ] Complex types and enums only deleted if explicitly called out as retired in the Documentation Plan
371380
- [ ] References to retired resources removed from parent/related resource tables (Methods, Relationships, Properties)
372381
- [ ] TOC entries removed for deleted files

.github/prompts/review-api-docs.prompt.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,18 @@ When reviewing resources that are part of a polymorphic hierarchy (base types wi
208208

209209
Full rules: [common.md — Cross-file consistency validation](./author-api-docs/common.md#cross-file-consistency-validation) (point d) and [public-preview.md — Handling polymorphic entity types](./author-api-docs/public-preview.md#handling-polymorphic-entity-types)
210210

211+
### Retirement (file deletion) review
212+
213+
When a PR deletes API documentation files, validate:
214+
- **Completeness:** All API operation files, permission includes, and RBAC includes tied to a deleted entity type resource are also deleted
215+
- **Retained types:** Complex types and entity types referenced by the deleted resource are NOT deleted unless explicitly called out — they may be in use by other APIs
216+
- **Reference cleanup:** Deleted resources are removed from Methods tables, Relationships tables, and Properties tables in parent/related resource files
217+
- **Redirects:** Each deleted entity type resource file and API operation file has a redirect entry in the latest `.openpublishing.redirection.yyyy-mm.json` file in `redirects/`
218+
- **TOC:** Entries for deleted files removed from `toc.mapping.json`
219+
- **Changelog and What's New:** Entries with Change type "Deletion" are present
220+
221+
Full rules: [deprecate-retire.md — Retirement workflow](./author-api-docs/deprecate-retire.md#retirement-api-removal) and [Retirement quality checklist](./author-api-docs/deprecate-retire.md#quality-checklist)
222+
211223
---
212224

213225
## Optional Context-Enhanced Review
@@ -341,6 +353,7 @@ If requested, provide specific edits to fix identified issues.
341353

342354
**Special handling:**
343355
- Mixed scenarios: If both deprecation and other changes exist, flag this for the reviewer
356+
- Retirement (file deletions): Validate redirect entries, reference cleanup, and dependency safety — see [Retirement review](#retirement-file-deletion-review)
344357
- Autogenerated content: If file appears autogenerated (check metadata), validate that manual edits are appropriate
345358
- Permission files: These are typically autogenerated; validate format but don't require extensive review unless issues are evident
346359

0 commit comments

Comments
 (0)