feat: add --filter support to apiops publish - #236
Merged
Alexander Zaslonov (azaslonov) merged 7 commits intoSep 4, 2026
Conversation
- Implemented unit tests for extracting backend pool members and policy fragment dependencies transitively in extract-service. - Added tests to ensure API exclusions are respected during product publishing in product-publisher. - Enhanced publish-service tests to cover filtering resources, including transitive dependencies and dry-run scenarios. - Introduced tests for resource-publisher to skip entries based on exclusion filters for subscriptions and API tags. - Added tests for workspace-extractor to validate workspace exclusions and transitive extraction of policy fragments. - Created transitive-extractor service to handle extraction of transitive dependencies with proper logging and error handling.
Author
|
@microsoft-github-policy-service agree |
Copilot started reviewing on behalf of
Alexander Zaslonov (azaslonov)
August 31, 2026 23:04
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds filter-aware publishing using extraction-compatible filters, transitive dependency resolution, and workspace support.
Changes:
- Adds
--filterand--no-transitivepublish options. - Expands dependency and association handling across publish and extraction.
- Adds tests and documentation for filtering behavior.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/cli/publish-command.ts |
Adds publish filter options and validation. |
src/models/config.ts |
Extends publish configuration. |
src/lib/resource-path.ts |
Adds descriptor identity helpers. |
src/services/filter-service.ts |
Shares workspace filter resolution. |
src/services/transitive-resolver.ts |
Scans artifact and structural dependencies. |
src/services/transitive-extractor.ts |
Adds shared fixed-point extraction. |
src/services/extract-service.ts |
Uses shared transitive extraction. |
src/services/workspace-extractor.ts |
Adds workspace transitive extraction. |
src/services/publish-service.ts |
Filters and expands publish targets. |
src/services/api-publisher.ts |
Applies filtering to API children. |
src/services/product-publisher.ts |
Filters product associations and policies. |
src/services/resource-publisher.ts |
Validates association and subscription targets. |
tests/unit/cli/publish-command.test.ts |
Tests new CLI options. |
tests/unit/lib/resource-path.test.ts |
Tests descriptor identity. |
tests/unit/services/api-publisher.test.ts |
Tests filtered API publishing. |
tests/unit/services/extract-service.test.ts |
Tests expanded extraction dependencies. |
tests/unit/services/product-publisher.test.ts |
Tests product association filtering. |
tests/unit/services/publish-service.test.ts |
Tests filtered and transitive publishing. |
tests/unit/services/resource-publisher.test.ts |
Tests target safeguards. |
tests/unit/services/transitive-resolver.test.ts |
Tests artifact reference scanning. |
tests/unit/services/workspace-extractor.test.ts |
Tests workspace filtering and dependencies. |
README.md |
Documents publish filtering. |
docs/commands/publish.md |
Documents options and behavior. |
docs/guides/filtering-resources.md |
Extends filtering guidance to publishing. |
docs/architecture.md |
Adds publish-to-filter service flow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Align live and dry-run publish planning, incremental deletion safety, workspace associations, environment mapping, and concrete action results. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Alexander Zaslonov (azaslonov)
September 4, 2026 23:04
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Transitive publishing and extraction currently override explicit filter exclusions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 38/38 changed files
- Comments generated: 2
- Review effort level: Balanced
Tuan Nguyen (atuannguyen1101)
approved these changes
Sep 4, 2026
Vitaliy Kurokhtin (VitaliyKurokhtin)
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--filter <path>and--no-transitiveflags toapiops publish, reusing the filter YAML format, matching rules, and transitive-dependency resolution already supported byapiops extract. The change also extends transitive extraction to workspace-scoped resources, strengthens filtering and target-existence safeguards during publishing, and documents publish filtering.Fixes #215
What's included
Filtered publishing
--filter <path>to publish a selected subset of resources using the same case-insensitive names, wildcards,!exclusions, and nested API/workspace sub-filters as extraction.--no-transitiveto publish only direct filter matches.--commit-idand--dry-run, including republishing eligible child resources and associations when their parent changes.--delete-unmatchedwith--filteror--commit-idusing clear validation errors.Safer resource selection and publishing
Transitive extraction
Documentation
README.mdanddocs/commands/publish.md.docs/guides/filtering-resources.mdonly where needed to cover publishing with the shared filter configuration.Test plan
npm run lintnpx tsc --noEmitnpm test— 1196/1196 passing