Skip to content

feat: replace keepGitDir with discardGitDir - #8318

Merged
jedevc merged 4 commits into
dagger:mainfrom
jedevc:switch-to-discard-git-dir
Sep 25, 2024
Merged

jedevc merged 4 commits into
dagger:mainfrom
jedevc:switch-to-discard-git-dir

Conversation

@jedevc

@jedevc jedevc commented Sep 3, 2024 •

Copy link
Copy Markdown
Contributor

Closes #7777

@jedevc jedevc added area/engine/api needs/changelog Pull requests that require a changelog entry labels Sep 3, 2024
@jedevc jedevc added this to the v0.13.0 milestone Sep 3, 2024
@jedevc
jedevc requested review from a team as code owners September 3, 2024 16:14
@jedevc
jedevc requested a review from helderco September 3, 2024 16:15
@aluzzardi

Copy link
Copy Markdown
Contributor

@jedevc 👋 Late to the party -- won't this affect caching? I thought the reason buildkit defaults to NOT doing it is because of how it resets the cache pretty often.

@jedevc

jedevc commented Sep 3, 2024

Copy link
Copy Markdown
Contributor Author

@aluzzardi some discussion in #7777 (comment), does that help?

@jedevc
jedevc force-pushed the switch-to-discard-git-dir branch from 845a42b to d67cea1 Compare September 4, 2024 10:05
@gerhard

gerhard commented Sep 9, 2024

Copy link
Copy Markdown
Contributor

Do we still want this in v0.13.0? The ETA is this week.

If this does not look ready, we can push it to a patch. WDYT @aluzzardi @helderco ?

@jedevc

jedevc commented Sep 10, 2024

Copy link
Copy Markdown
Contributor Author

Because it's a deprecation it doesn't need to be in this release - happy to push.

@jedevc jedevc removed this from the v0.13.0 milestone Sep 11, 2024
@jedevc
jedevc force-pushed the switch-to-discard-git-dir branch 2 times, most recently from b5b0c79 to 9524568 Compare September 11, 2024 11:30
@jedevc

jedevc commented Sep 11, 2024

Copy link
Copy Markdown
Contributor Author

Updated this - if we're changing the property, we should also move it to GitRef.tree instead of being at the top-level.

@jedevc jedevc linked an issue Sep 11, 2024 that may be closed by this pull request
@jedevc jedevc added the needs/docs Pull requests that require a docs change label Sep 11, 2024

@vito vito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving in principle - glad to see this change (#3050 (comment)). Just some nits, and looks like it needs a rebase.

Comment thread core/integration/git_test.go Resolved
Comment thread core/integration/git_test.go Resolved
Comment thread core/integration/legacy_test.go Resolved
Comment thread core/integration/services_test.go Resolved
tree: Directory!
tree(
"""Set to true to discard .git directory."""
discardGitDir: Boolean = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mini-bikeshed: I wonder if we even need this? With #8436 you could just exclude .git at the argument site, which would then be applied no matter how the Directory was created. But - I guess you don't want every call site to have to anticipate and exclude a .git directory. So it kind of makes sense to do it before passing it in, too. But you could also do .withoutDirectory(".git") which might be even less typing depending on your SDK. 🤷‍♂️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue with Python uv that hold #8436 so for now we cannot merge it, but yeah I think it's not a good DX to force // +ignore=[".git/"] on every call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'm happy with the idea of removing it, but also not opposed to keeping it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the point that this would prevent you from needing to always try to ignore/remove the dir out of caution is enough justification for keeping this option in place.

@jedevc
jedevc force-pushed the switch-to-discard-git-dir branch 3 times, most recently from 15f3718 to cee9d4f Compare September 17, 2024 16:22
@jedevc
jedevc force-pushed the switch-to-discard-git-dir branch 2 times, most recently from 60bda5b to 2268342 Compare September 23, 2024 16:27
Doesn't make sense to have it at the top-level at all, since it only
effects the `tree` method.

Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
@jedevc
jedevc force-pushed the switch-to-discard-git-dir branch from 2268342 to baac646 Compare September 25, 2024 11:55
@jedevc jedevc removed the needs/docs Pull requests that require a docs change label Sep 25, 2024
@jedevc
jedevc force-pushed the switch-to-discard-git-dir branch 2 times, most recently from 569dd56 to baac646 Compare September 25, 2024 14:33
@jedevc
jedevc merged commit 57d6061 into dagger:main Sep 25, 2024
@jedevc
jedevc deleted the switch-to-discard-git-dir branch September 25, 2024 15:12
vikram-dagger pushed a commit to vikram-dagger/dagger that referenced this pull request Sep 26, 2024
* feat: replace keepGitDir with discardGitDir

Signed-off-by: Justin Chadwell <[email protected]>

* feat: move discardGitDir onto tree

Doesn't make sense to have it at the top-level at all, since it only
effects the `tree` method.

Signed-off-by: Justin Chadwell <[email protected]>

* chore: add CHANGELOG

Signed-off-by: Justin Chadwell <[email protected]>

* review comments

Signed-off-by: Justin Chadwell <[email protected]>

---------

Signed-off-by: Justin Chadwell <[email protected]>
@jedevc jedevc mentioned this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/engine/api needs/changelog Pull requests that require a changelog entry

Projects

None yet

6 participants