Repository navigation
Conversation
helderco
marked this pull request as draft
September 19, 2024 17:28
This was referenced Sep 19, 2024
helderco
force-pushed
the
helder/dev-3952-use-gitignore-by-default-when-loading-modules
branch
from
September 20, 2024 16:11
866f322 to
e162ed3
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
- Start from the context directory and override with more specific paths - Fixed semantics from git patterns - Performance improvements Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
It's premature optimization. Each .gitignore takes approx 1ms to process, so even if the target module is burried in a 6 level deep subdir, with a .gitignore file in each of those parents, it's only 6ms, and only for the same `resolveFromCaller`. If the target module uses a custom SDK in a sibling directory 6 levels deep, all those .gitignore files will be read twice because the custom SDK will make a separate `resolveFromCaller` call. Signed-off-by: Helder Correia <[email protected]>
helderco
force-pushed
the
helder/dev-3952-use-gitignore-by-default-when-loading-modules
branch
from
October 29, 2024 13:16
6ac20a1 to
a8401b9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Contributor
|
This PR was closed because it has been stalled for 7 days with no activity. |
helderco
deleted the
helder/dev-3952-use-gitignore-by-default-when-loading-modules
branch
July 28, 2025 17:45
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.
This is a proof of concept for:
.gitignoreby default when loading modules #6627It reads all the
.gitignorefiles from a git repo root, up to a module being loaded, and adds the patterns inside to the list of "excludes" indagger.jsonautomatically, to limit the files getting uploaded from the host.Example
Consider these
.gitignorefiles:.gitignore.venv__pycache__sdk/python/.gitignore.*_cachedist/docs/_ buildsdk/python/dev/.gitignore/sdkRunning the following command, which requires loading the module:
Will add the following patterns, before the module's own
excludesindagger.json:Note
.gitignoreare prefixed with the path to its directory**is addeddagger.json, it's possible to negate a pattern from.gitignoreif necessary prefixing the pattern with!The result is that for this module, with no excludes in
dagger.json, the following won't be uploaded anymore:sdk/python/dev/.venv(python's virtual environment)sdk/python/dev/sdk(generated SDK library for the module)sdk/python/dev/.../__pycache__(compiled bytecode)Today, those directories are added because they match an implicit include of
<module source>/**/*.Before
On first run for this module:
After
On first run for this module:
\cc @TomChv