Skip to content

Apply source filters without requiring build args - #1182

Open
cpuguy83 wants to merge 3 commits into
project-dalec:mainfrom
cpuguy83:relax_exclude_args
Open

Apply source filters without requiring build args#1182
cpuguy83 wants to merge 3 commits into
project-dalec:mainfrom
cpuguy83:relax_exclude_args

Conversation

@cpuguy83

@cpuguy83 cpuguy83 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

The build-time source filter previously only loaded if
DALEC_SOURCE_FILTER_CONFIG_PATH was set, so a build context carrying a filter
config was silently ignored unless every caller also passed the arg.

Presence of the dalec-source-options build context is now what enables
filtering, and the config is read from source-filter.yml in it. The two build
args become overrides for the path and context name, the way dockerfile handles
similar knobs. Setting either arg without supplying the context is an error,
since the build clearly expected one.

Supporting changes:

  • bkfs implements fs.ReadFileFS, which is all the filter config load needs
    and avoids the open/stat/read dance.
  • The source filter helpers were exported for no caller and had grown two
    parallel code paths for the same operation; collapsed into one.

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for dalec ready!

Name Link
🔨 Latest commit 2d0722c
🔍 Latest deploy log https://app.netlify.com/projects/dalec/deploys/6a7292fbfc0e950008c34d10
😎 Deploy Preview https://deploy-preview-1182--dalec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cpuguy83
cpuguy83 marked this pull request as ready for review August 5, 2026 17:04
Copilot AI balanced review requested due to automatic review settings August 5, 2026 17:05

This comment was marked as resolved.

This is much simpler when all you want to do is read the content of some
file.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
The way we detect if the global filter should be loaded now is just by
checking if the context exists.
The args are used purely for override (similar to how dockerfile handles
such things).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This didn't need to be exported.
We also ended up with some accidental duplication, so cleaned this up.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83
cpuguy83 force-pushed the relax_exclude_args branch from d96d778 to 674f493 Compare August 5, 2026 23:15
@cpuguy83 cpuguy83 self-assigned this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants