Skip to content

Commit f058d6b

Browse files
Peter HaugeCopilot
andcommitted
feat: align filter and override config formats with APIOps Toolkit
- Rename filter config keys from *Names suffix to bare camelCase plurals (e.g., apiNames -> apis, backendNames -> backends, versionSetNames -> versionSets) to match the Toolkit's configuration.extractor.yaml schema - Rename filter config filename from configuration.extract.yaml to configuration.extractor.yaml across templates, CI/CD workflows, and docs - Add graceful handling for apimServiceName in override config (Toolkit uses this for target APIM instance; CLI logs info and ignores it) - Override config format already aligned (same section names and properties wrapper structure as Toolkit) - Update all 13 test files, 7 docs, CI/CD templates, and specs Closes #114 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 827b308 commit f058d6b

30 files changed

Lines changed: 312 additions & 301 deletions

docs/ci-cd/azure-devops.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The extract pipeline pulls configuration from your APIM instance, publishes the
4343

4444
| Parameter | Type | Default | Description |
4545
|-----------|------|---------|-------------|
46-
| `CONFIGURATION_YAML_PATH` | string | `Extract All APIs` | Choose `Extract All APIs` for a full extract, or `configuration.extract.yaml` to use a [filter file](../guides/filtering-resources.md) |
46+
| `CONFIGURATION_YAML_PATH` | string | `Extract All APIs` | Choose `Extract All APIs` for a full extract, or `configuration.extractor.yaml` to use a [filter file](../guides/filtering-resources.md) |
4747
| `resourceGroup` | string | `$(APIM_RESOURCE_GROUP)` | Azure resource group containing your APIM instance |
4848
| `serviceName` | string | `$(APIM_SERVICE_NAME)` | Name of the APIM service instance |
4949

@@ -55,7 +55,7 @@ flowchart TD
5555
B --> C[npm ci]
5656
C --> D{Configuration choice?}
5757
D -->|Extract All APIs| E[apiops extract --resource-group ... --service-name ...]
58-
D -->|configuration.extract.yaml| F[apiops extract ... --filter configuration.extract.yaml]
58+
D -->|configuration.extractor.yaml| F[apiops extract ... --filter configuration.extractor.yaml]
5959
E --> G[Publish pipeline artifact]
6060
F --> G
6161
G --> H[Create branch apim-extract-BuildId]
@@ -92,7 +92,7 @@ The key task is `AzureCLI@2`, which authenticates using your service connection:
9292
--subscription-id $(AZURE_SUBSCRIPTION_ID)
9393
```
9494
95-
When the filter option is selected, `--filter configuration.extract.yaml` is added to the command.
95+
When the filter option is selected, `--filter configuration.extractor.yaml` is added to the command.
9696

9797
> **Why AzureCLI@2?** This task injects Azure credentials into the shell environment, allowing `apiops extract` to authenticate via `DefaultAzureCredential`. See [Authentication Guide](../guides/authentication.md).
9898

docs/ci-cd/github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The extract workflow pulls configuration from your APIM instance and creates a P
4444
| Input | Description | Options |
4545
|-------|-------------|---------|
4646
| `ENVIRONMENT` | Which APIM instance to extract from | `dev`, `prod` |
47-
| `CONFIGURATION_YAML_PATH` | Extract all APIs or use a filter file | `Extract All APIs`, `configuration.extract.yaml` |
47+
| `CONFIGURATION_YAML_PATH` | Extract all APIs or use a filter file | `Extract All APIs`, `configuration.extractor.yaml` |
4848

4949
### What It Does
5050

docs/commands/extract.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ apiops extract \
3434
--subscription-id 00000000-0000-0000-0000-000000000000 \
3535
--resource-group my-rg \
3636
--service-name my-apim \
37-
--filter ./configuration.extract.yaml
37+
--filter ./configuration.extractor.yaml
3838
```
3939

4040
### Extract without transitive dependencies
@@ -98,23 +98,23 @@ By default, `apiops extract` exports **all** resources from the APIM instance (3
9898
To extract only specific resources, pass a YAML filter file with `--filter`:
9999

100100
```yaml
101-
# configuration.extract.yaml
102-
apiNames:
101+
# configuration.extractor.yaml
102+
apis:
103103
- echo-api
104104
- petstore-api
105-
productNames:
105+
products:
106106
- starter
107-
backendNames:
107+
backends:
108108
- backend-api
109-
namedValueNames:
109+
namedValues:
110110
- api-key
111-
tagNames:
111+
tags:
112112
- production
113-
policyFragmentNames:
113+
policyFragments:
114114
- rate-limit-fragment
115-
loggerNames:
115+
loggers:
116116
- appinsights-logger
117-
diagnosticNames:
117+
diagnostics:
118118
- applicationinsights
119119
```
120120
@@ -124,22 +124,22 @@ All 16 supported filter keys:
124124
125125
| Filter key | Resource type |
126126
|------------|---------------|
127-
| `apiNames` | APIs |
128-
| `backendNames` | Backends |
129-
| `productNames` | Products |
130-
| `namedValueNames` | Named values |
131-
| `loggerNames` | Loggers |
132-
| `diagnosticNames` | Diagnostics |
133-
| `tagNames` | Tags |
134-
| `policyFragmentNames` | Policy fragments |
135-
| `gatewayNames` | Gateways |
136-
| `versionSetNames` | API version sets |
137-
| `groupNames` | Groups |
138-
| `subscriptionNames` | Subscriptions |
139-
| `schemaNames` | Schemas |
140-
| `policyRestrictionNames` | Policy restrictions |
141-
| `documentationNames` | Documentation resources |
142-
| `workspaceNames` | Workspaces |
127+
| `apis` | APIs |
128+
| `backends` | Backends |
129+
| `products` | Products |
130+
| `namedValues` | Named values |
131+
| `loggers` | Loggers |
132+
| `diagnostics` | Diagnostics |
133+
| `tags` | Tags |
134+
| `policyFragments` | Policy fragments |
135+
| `gateways` | Gateways |
136+
| `versionSets` | API version sets |
137+
| `groups` | Groups |
138+
| `subscriptions` | Subscriptions |
139+
| `schemas` | Schemas |
140+
| `policyRestrictions` | Policy restrictions |
141+
| `documentations` | Documentation resources |
142+
| `workspaces` | Workspaces |
143143

144144
### Transitive dependencies
145145

docs/commands/init.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ In interactive mode (the default when running in a terminal), `apiops init` prom
8080
|------|---------|
8181
| `.github/workflows/extract.yaml` | Pipeline to extract APIM artifacts |
8282
| `.github/workflows/publish.yaml` | Pipeline to publish artifacts to APIM |
83-
| `configuration.extract.yaml` | Sample filter configuration for extraction |
83+
| `configuration.extractor.yaml` | Sample filter configuration for extraction |
8484
| `configuration.{env}.yaml` | Override templates per environment (e.g., `configuration.dev.yaml`, `configuration.prod.yaml`) |
8585
| `IDENTITY-SETUP-GITHUB.md` | Step-by-step guide for configuring federated credentials |
8686

@@ -90,9 +90,7 @@ In interactive mode (the default when running in a terminal), `apiops init` prom
9090
|------|---------|
9191
| `pipelines/extract.yaml` | Pipeline to extract APIM artifacts |
9292
| `pipelines/publish.yaml` | Pipeline to publish artifacts to APIM |
93-
| `configuration.extract.yaml` | Sample filter configuration for extraction |
94-
| `configuration.{env}.yaml` | Override templates per environment |
95-
| `IDENTITY-SETUP-AZDO.md` | Step-by-step guide for configuring service connections |
93+
| `configuration.extractor.yaml` | Sample filter configuration for extraction |
9694

9795
### Both platforms
9896

docs/guides/filtering-resources.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ By default, `apiops extract` pulls every resource from your APIM instance. For l
1616
1. Create a filter file:
1717

1818
```yaml
19-
# configuration.extract.yaml
20-
apiNames:
19+
# configuration.extractor.yaml
20+
apis:
2121
- petstore-api
2222
- orders-api
2323
```
@@ -29,7 +29,7 @@ apiops extract \
2929
--resource-group my-rg \
3030
--service-name my-apim \
3131
--subscription-id 00000000-0000-0000-0000-000000000000 \
32-
--filter configuration.extract.yaml
32+
--filter configuration.extractor.yaml
3333
```
3434

3535
Only `petstore-api`, `orders-api`, and their transitive dependencies are extracted.
@@ -41,29 +41,29 @@ Only `petstore-api`, `orders-api`, and their transitive dependencies are extract
4141
The filter file is a YAML document where each key is a resource type and the value is an array of resource names:
4242

4343
```yaml
44-
# configuration.extract.yaml
44+
# configuration.extractor.yaml
4545

4646
# APIs to extract (by display name or API ID)
47-
apiNames:
47+
apis:
4848
- petstore-api
4949
- orders-api
5050

5151
# Backends to include
52-
backendNames:
52+
backends:
5353
- orders-backend
5454

5555
# Products to include
56-
productNames:
56+
products:
5757
- starter
5858
- enterprise
5959

6060
# Named values to include
61-
namedValueNames:
61+
namedValues:
6262
- api-key
6363
- connection-string
6464

6565
# Leave sections out (or comment them) to extract ALL of that type
66-
# loggerNames:
66+
# loggers:
6767
# - appinsights
6868
```
6969

@@ -79,22 +79,22 @@ namedValueNames:
7979

8080
| Filter Field | APIM Resource | Example Values |
8181
|-------------|---------------|----------------|
82-
| `apiNames` | APIs | `petstore-api`, `orders-v2` |
83-
| `backendNames` | Backends | `orders-backend`, `payment-service` |
84-
| `productNames` | Products | `starter`, `enterprise`, `internal` |
85-
| `namedValueNames` | Named Values | `api-key`, `db-connection-string` |
86-
| `loggerNames` | Loggers | `appinsights-logger`, `eventhub-logger` |
87-
| `diagnosticNames` | Diagnostics | `applicationinsights`, `azuremonitor` |
88-
| `tagNames` | Tags | `production`, `beta`, `internal` |
89-
| `policyFragmentNames` | Policy Fragments | `rate-limit-fragment`, `cors-policy` |
90-
| `gatewayNames` | Self-hosted Gateways | `on-prem-gateway`, `edge-gateway` |
91-
| `versionSetNames` | API Version Sets | `orders-version-set` |
92-
| `groupNames` | Groups | `developers`, `partners`, `admins` |
93-
| `subscriptionNames` | Subscriptions | `team-a-subscription` |
94-
| `schemaNames` | Global Schemas | `shared-error-schema` |
95-
| `policyRestrictionNames` | Policy Restrictions | `no-external-calls` |
96-
| `documentationNames` | Documentation | `getting-started`, `changelog` |
97-
| `workspaceNames` | Workspaces | `team-a-workspace`, `team-b-workspace` |
82+
| `apis` | APIs | `petstore-api`, `orders-v2` |
83+
| `backends` | Backends | `orders-backend`, `payment-service` |
84+
| `products` | Products | `starter`, `enterprise`, `internal` |
85+
| `namedValues` | Named Values | `api-key`, `db-connection-string` |
86+
| `loggers` | Loggers | `appinsights-logger`, `eventhub-logger` |
87+
| `diagnostics` | Diagnostics | `applicationinsights`, `azuremonitor` |
88+
| `tags` | Tags | `production`, `beta`, `internal` |
89+
| `policyFragments` | Policy Fragments | `rate-limit-fragment`, `cors-policy` |
90+
| `gateways` | Self-hosted Gateways | `on-prem-gateway`, `edge-gateway` |
91+
| `versionSets` | API Version Sets | `orders-version-set` |
92+
| `groups` | Groups | `developers`, `partners`, `admins` |
93+
| `subscriptions` | Subscriptions | `team-a-subscription` |
94+
| `schemas` | Global Schemas | `shared-error-schema` |
95+
| `policyRestrictions` | Policy Restrictions | `no-external-calls` |
96+
| `documentations` | Documentation | `getting-started`, `changelog` |
97+
| `workspaces` | Workspaces | `team-a-workspace`, `team-b-workspace` |
9898

9999
---
100100

@@ -120,7 +120,7 @@ flowchart TD
120120
Given this filter:
121121

122122
```yaml
123-
apiNames:
123+
apis:
124124
- petstore-api
125125
```
126126
@@ -150,7 +150,7 @@ apiops extract \
150150
--resource-group my-rg \
151151
--service-name my-apim \
152152
--subscription-id 00000000-0000-0000-0000-000000000000 \
153-
--filter configuration.extract.yaml \
153+
--filter configuration.extractor.yaml \
154154
--no-transitive
155155
```
156156

@@ -170,8 +170,8 @@ apiops extract \
170170
A team that owns one or two APIs:
171171

172172
```yaml
173-
# configuration.extract.yaml
174-
apiNames:
173+
# configuration.extractor.yaml
174+
apis:
175175
- orders-api
176176
- orders-admin-api
177177
```
@@ -183,33 +183,33 @@ Transitive dependencies (backends, named values, policy fragments) are auto-incl
183183
Extract everything associated with a product:
184184

185185
```yaml
186-
# configuration.extract.yaml
187-
productNames:
186+
# configuration.extractor.yaml
187+
products:
188188
- enterprise
189189
```
190190

191-
> **Note:** Filtering by `productNames` extracts the product definition and its associations, but does **not** transitively include the APIs in that product. To include the APIs, add them to `apiNames` as well.
191+
> **Note:** Filtering by `products` extracts the product definition and its associations, but does **not** transitively include the APIs in that product. To include the APIs, add them to `apis` as well.
192192

193193
### Shared Infrastructure Team
194194

195195
A platform team managing cross-cutting resources:
196196

197197
```yaml
198-
# configuration.extract.yaml
199-
namedValueNames:
198+
# configuration.extractor.yaml
199+
namedValues:
200200
- global-api-key
201201
- rate-limit-threshold
202202
- cors-allowed-origins
203203
204-
policyFragmentNames:
204+
policyFragments:
205205
- standard-rate-limit
206206
- cors-policy
207207
- auth-validation
208208
209-
loggerNames:
209+
loggers:
210210
- appinsights-logger
211211
212-
backendNames:
212+
backends:
213213
- identity-service
214214
```
215215

@@ -222,7 +222,7 @@ There is no "exclude" syntax. To extract everything except certain resources, li
222222
## Tips
223223

224224
- **Start broad, narrow later** — Begin with no filter to see what's in your APIM instance, then create a filter for your team's slice
225-
- **One filter per team** — In multi-team setups, each team maintains its own `configuration.extract.yaml`
225+
- **One filter per team** — In multi-team setups, each team maintains its own `configuration.extractor.yaml`
226226
- **Commit the filter file** — Keep it in version control alongside your artifacts so CI/CD pipelines can use it
227227
- **Case-sensitive names** — Filter values must match APIM resource names exactly (usually lowercase with hyphens)
228228
- **Validate early** — The config loader validates that each filter field is an array of strings and will throw `Failed to load filter config` on invalid YAML

docs/guides/migration-from-v1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,20 @@ Replace the v1 pipeline tasks/actions with v2 CLI commands.
148148
**v1** (`configuration.extractor.yaml`):
149149

150150
```yaml
151-
apiNames:
151+
apis:
152152
- payments-api
153153
- orders-api
154154
```
155155

156-
**v2** (filter YAML — same format, different file name convention):
156+
**v2** (`configuration.extractor.yaml` — same format and file name):
157157

158158
```yaml
159-
apiNames:
159+
apis:
160160
- payments-api
161161
- orders-api
162162
```
163163

164-
The filter YAML format is compatible. Rename the file if you prefer the v2 convention, and pass it with `--filter`:
164+
The filter YAML format is fully compatible with v1. You can use your existing `configuration.extractor.yaml` as-is with the `--filter` flag:
165165

166166
```bash
167167
apiops extract \

docs/reference/configuration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ flowchart TD
1717
|----------|--------|---------|
1818
| **1 (highest)** | CLI flags | `--resource-group my-rg` |
1919
| **2** | Environment variables | `AZURE_SUBSCRIPTION_ID=...` |
20-
| **3** | YAML config files | `configuration.extract.yaml`, `configuration.dev.yaml` |
20+
| **3** | YAML config files | `configuration.extractor.yaml`, `configuration.dev.yaml` |
2121
| **4 (lowest)** | Default values | `--output ./apim-artifacts` |
2222

2323
For example, if `AZURE_SUBSCRIPTION_ID` is set as an environment variable but `--subscription-id` is also passed on the command line, the CLI flag wins.
@@ -109,16 +109,16 @@ See [Authentication Guide](../guides/authentication.md) for details on each auth
109109

110110
### Filter Configuration
111111

112-
**File:** `configuration.extract.yaml` (or any path passed to `--filter`)
112+
**File:** `configuration.extractor.yaml` (or any path passed to `--filter`)
113113

114114
Controls which resources are extracted. See [Filtering Resources](../guides/filtering-resources.md) for the full reference.
115115

116116
```yaml
117-
# configuration.extract.yaml
118-
apiNames:
117+
# configuration.extractor.yaml
118+
apis:
119119
- petstore-api
120120
- orders-api
121-
backendNames:
121+
backends:
122122
- petstore-backend
123123
```
124124

specs/contracts/cli-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Initialize repository structure and CI/CD pipeline configuration.
9797
- `.github/workflows/extract.yml` and `publish.yml` (for `github-actions`)
9898
- `.azdo/pipelines/extract.yml` and `publish.yml` (for `azure-devops`)
9999
- `apim-artifacts/` directory (empty, with `.gitkeep`)
100-
- `configuration.extract.yaml` (sample filter file)
100+
- `configuration.extractor.yaml` (sample filter file)
101101
- `configuration.{env}.yaml` (sample override files)
102102

103103
---

0 commit comments

Comments
 (0)