feat(framework): Enable user-specified include/exclude for FAB build#6805
feat(framework): Enable user-specified include/exclude for FAB build#6805chongshenng wants to merge 48 commits intomainfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nclude-based-fab-build
…ent-related files
f79f7c0 to
1cb1020
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates FAB bundling (flwr build) so that file selection is driven by user-provided [tool.flwr.app].fab-include / fab-exclude patterns (when configured), and then constrained by the built-in FAB include/exclude safeguards. It also standardizes how warnings/notes are emitted for pattern issues and adds tests for the updated behavior.
Changes:
- Remove
.gitignore-based filtering from FAB build; rely on user include/exclude patterns plus built-in constraints. - Add unified warning/note emission for empty lists, unmatched patterns, include/exclude overlap, and built-in constraint removals.
- Add tests validating filtering outcomes and warning output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
framework/py/flwr/cli/build.py |
Reworks FAB path filtering to apply user patterns and built-in constraints; adds consistent warning/note emission. |
framework/py/flwr/cli/build_test.py |
Adds helper and tests for new filtering behavior and warning messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if user_exclude_spec: | ||
| final_paths = [ | ||
| path | ||
| for path in built_in_constrained_paths | ||
| if not user_exclude_spec.match_file(path) | ||
| ] |
There was a problem hiding this comment.
Since we decided to allow overlaps between fab-include and fab-exclude by applying exclusion rules first, should we move this above and use both fab-include and fab-exclude to build the candidate paths?
This PR:
fab-includeorfab-excludeset to an empty listfab-includepatterns whose matched files are all removed by built-in constraintsfab-includeandfab-excludepatterns overlap,fab-excludepatterns prevail and the matching files are filtered out.KeyErrorfor Windows-style path separators inbuild_fab_from_files: all keys are now normalized to forward slashes up-front, so callers passingsrc\client.py-style keys are handled correctly.Merge after: