You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make dagger.json include/exclude patterns consistent with defaultPath #8547
Make include/exclude patterns dagger.json relative to the context directory if they start with a slash (/).
Motivation
The include and exclude patterns in a dagger.json are always relative to the dagger.json file.
But with the recent Context directory feature, module authors are able to specify a path that is either relative to the root directory, or absolute to the context directory.
Example for a foo/bar module:
Feature
<repo root>/src
<module root>/src
dagger.json include/exclude
../../src
src
defaultPath
../../src or /src
src
Sometimes a /src is easier to manage than ../../src (less brittle to move directory and even to read depending on how deep in the file tree a module is), and it’s more consistent with how defaultPath resolves in relation to the context directory. There was a need for this there, and I think the same need applies here.
Compatibility
The downside is that it’s possibly a breaking change for anyone that already has include/exclude patterns in their dagger.json that start with a slash (/).
One way to mitigate this is to emit a warning until next minor version bump if we detect patterns that start with a slash, to let users know the meaning of that will change in a future version. Solution for them is to remove that slash prefix. Then make this change in that version.
No strong conviction to go down this road, just leaving it here and see if there’s demand.
Activity