`publish --delete-unmatched` (full publish) does not remove child resources, and does not protect the built-in `master` subscription
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- azure, github-actions, javascript, node.js, typescript
Rechercherichtung
Start in services/delete-unmatched-service.js at computeDeleteActions, which lists deployed resources per type with listResources and silently swallows errors for child types that need a parent. Check isSystemResource for where the built-in master subscription (scope /) should be excluded. Done when child resources missing from the artifact folder yield DELETE actions in a dry-run, and master is never listed as DELETE, with tests covering both cases.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
With apiops-cli 1.0.5, a full apiops publish --delete-unmatched (no --commit-id) only reconciles top-level resources (and managed-gateway API assignments). Child resources that exist in APIM but not in the artifact folder are never deleted. Separately, the built-in master subscription is not treated as a system resource, so it is deleted when its file is absent.
1. Child resources are not reconciled
Steps to reproduce
- Publish an artifact folder that contains an API with an API-level policy (
apis/<api>/policy.xml) and a product with an API link (products/<p>/apis.json). - Remove
apis/<api>/policy.xmland the API fromproducts/<p>/apis.json. - Run
apiops publish --delete-unmatched --dry-run, then without--dry-run.
Expected
The API policy and the product–API link are listed as DELETE and removed, so APIM matches the artifact folder (as with top-level resources).
Actual
No DELETE actions are produced for them; both remain in APIM.
Analysis
computeDeleteActions (services/delete-unmatched-service.js) lists deployed resources per resource type via listResources. For child types (ApiPolicy, ApiOperationPolicy, ProductPolicy, ApiDiagnostic, ApiSchema, ProductApi, ProductGroup, ApiTagDescription, …) the list path needs a parent, so the call throws and the error is swallowed; those types are silently skipped. Incremental mode (--commit-id) does delete children whose files were removed in that commit, but full publish – the mode needed to redeploy an older revision (rollback) – does not.
Impact
- Removing a policy/diagnostic/link from Git has no effect in APIM.
- Redeploying an older revision leaves child resources that were added later.
- The dry-run gives no indication of this.
Suggestion
For each deployed parent (API, product, operation, …), enumerate its children and compare them with the artifact folder; at minimum, warn in the dry-run/publish output that child resources are not reconciled.
2. master subscription is not protected
isSystemResource covers the built-in products/APIs (starter, unlimited, echo-api, …) and built-in groups, but not the built-in master subscription (scope /). Publish already skips root-scoped subscriptions, but with --delete-unmatched the master subscription is listed as DELETE when subscriptions/master is not present in the artifact folder. Expected: treat it as a system resource, like the other built-ins.
Environment
@azure-tools/apiops-cli1.0.5, Node.js 22, GitHub Actions (ubuntu-latest) and Windows.
Possibly related: #142, #169.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 44
- Forks
- 14
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Azure/apiops-cli
-
type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 71/100
Azure/apiops-cli#350 ·
-
stale
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Azure/apiops-cli#333 · 1 Kommentar ·
-
extract fails when a policy uses set-backend-service backend-id="{{namedValue}}"Evtl. vergeben @dannyward630 hat das vor 37 Tagen übernommen. Offenstale type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Azure/apiops-cli#331 · 1 Kommentar ·
-
Docs example says products are auto-included transitively, but they aren't extracted with `products: []`Evtl. vergeben @cdayne hat das vor 27 Tagen übernommen. Offenstale type:question
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Azure/apiops-cli#277 · 1 Kommentar ·
-
Extractor mistakes set-body json response as transitive dependency which causes pipeline failureOffentype:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 56/100
Azure/apiops-cli#349 ·
Alle Issues in Azure/apiops-cli
Ähnliche Issues
-
area:api bug good first issue priority:high
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Doezer/Questarr#1486 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Sergey-Bar/Penny#245 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
mihazs/lazysh#3377 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Approve the Cloudflare agent plugin for harness sessionsEvtl. vergeben @joshtsch hat das heute übernommen. Offenenhancement ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag