0.17 backport source filters - #1208
Draft
cpuguy83 wants to merge 4 commits into
Draft
Conversation
Add a source-options context that can provide a YAML source filter config at build time. The config currently supports global_excludes which can be used to filter out paths from all sources. Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit 3713d39) Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit ff5f3f6) Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit b556dec) Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Backports configurable build-time source filtering across Dalec source loading, generators, and RPM packaging.
Changes:
- Loads global exclusion patterns from a build context.
- Applies filters to regular and generated sources with tests and documentation.
- Updates RPM, strip-test, and CI behavior.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
source_filter.go |
Implements source-filter configuration and LLB filtering. |
source.go |
Integrates filters and modifies patch handling. |
source_inline.go |
Prefixes inline-source filter paths. |
generator_gomod.go |
Filters generated Go modules. |
generator_cargohome.go |
Filters generated Cargo dependencies. |
generator_pip.go |
Filters generated Pip dependencies. |
generator_nodemodules.go |
Filters generated Node dependencies. |
frontend/request.go |
Loads and decodes filter configuration. |
frontend/gateway.go |
Lazily attaches filters to source options. |
load.go |
Recognizes filter build arguments. |
packaging/linux/rpm/buildroot.go |
Propagates filters into RPM specs. |
packaging/linux/rpm/template.go |
Documents filters and Pip sources. |
packaging/linux/rpm/template_test.go |
Tests RPM source output. |
spec_test.go |
Tests filter configuration decoding. |
source_test.go |
Tests filter-generated LLB operations. |
test/source_test.go |
Adds end-to-end source-filter tests. |
test/linux_target_test.go |
Revises strip tests. |
test/target_almalinux_test.go |
Enables AlmaLinux strip testing. |
test/target_rockylinux_test.go |
Enables Rocky Linux strip testing. |
website/docs/sources.md |
Documents source-filter configuration. |
.github/workflows/codeql.yml |
Extends CodeQL to release branches. |
.github/workflows/ci.yml |
Adjusts workflow exclusions and example builds. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| sourceState = worker.Run( | ||
| llb.AddMount("/patch", patchState, llb.Readonly, llb.SourcePath(patchPath)), | ||
| llb.Dir(filepath.Join("src", subPath)), | ||
| llb.Dir("src"), |
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.
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer: