Skip to content

Commit 33c1150

Browse files
authored
Document full extract filter surface and explicit exclude-all semantics (#103)
* docs: expand extract filter template fields and guidance --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 3404993 commit 33c1150

2 files changed

Lines changed: 63 additions & 2 deletions

File tree

src/templates/configs/filter-config.ts

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,44 @@ export function generateFilterConfig(): string {
4747
# - rate-limit-fragment
4848
# - cors-fragment
4949
50-
# Uncomment to extract ALL resources (default behavior if no filters specified)
51-
# Leave all sections commented to extract everything
50+
# Extract only specific gateways
51+
# gatewayNames:
52+
# - default
53+
# - internal-gateway
54+
55+
# Extract only specific version sets
56+
# versionSetNames:
57+
# - payments-v1
58+
59+
# Extract only specific groups
60+
# groupNames:
61+
# - administrators
62+
63+
# Extract only specific subscriptions
64+
# subscriptionNames:
65+
# - starter-subscription
66+
67+
# Extract only specific schemas
68+
# schemaNames:
69+
# - pet-schema
70+
71+
# Extract only specific policy restrictions
72+
# policyRestrictionNames:
73+
# - global-policy-restriction
74+
75+
# Extract only specific documentations
76+
# documentationNames:
77+
# - getting-started
78+
79+
# Extract only specific workspaces
80+
# workspaceNames:
81+
# - dev-workspace
82+
83+
# Filter behavior:
84+
# - Leave a section commented out to include ALL resources of that type
85+
# - Set a section to an empty array ([]) to exclude ALL resources of that type
86+
# Example:
87+
# gatewayNames: []
88+
# subscriptionNames: []
5289
`;
5390
}

tests/unit/templates/configs/config-templates.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,30 @@ describe('configs/filter-config', () => {
4040
expect(config).toContain('# policyFragmentNames:');
4141
});
4242

43+
it('should include commented examples for all supported filter fields', () => {
44+
const config = generateFilterConfig();
45+
const fields = [
46+
'gatewayNames',
47+
'versionSetNames',
48+
'groupNames',
49+
'subscriptionNames',
50+
'schemaNames',
51+
'policyRestrictionNames',
52+
'documentationNames',
53+
'workspaceNames',
54+
];
55+
fields.forEach((field) => {
56+
expect(config).toContain(`# ${field}:`);
57+
});
58+
});
59+
60+
it('should document empty arrays as exclude-all behavior', () => {
61+
const config = generateFilterConfig();
62+
expect(config).toContain('# - Set a section to an empty array ([]) to exclude ALL resources of that type');
63+
expect(config).toContain('# gatewayNames: []');
64+
expect(config).toContain('# subscriptionNames: []');
65+
});
66+
4367
it('should not have any uncommented configuration by default', () => {
4468
const config = generateFilterConfig();
4569
const lines = config.split('\n').filter((line) => line.trim() && !line.trim().startsWith('#'));

0 commit comments

Comments
 (0)