Repository navigation
feat: add module source pins - #8587
Merged
Merged
Conversation
jedevc
force-pushed
the
module-source-pins
branch
from
September 27, 2024 19:44
7e8278a to
275c9ff
Compare
jedevc
force-pushed
the
module-source-pins
branch
3 times, most recently
from
October 8, 2024 12:42
7b9b61e to
ada2f4c
Compare
jedevc
marked this pull request as ready for review
October 8, 2024 12:45
jedevc
force-pushed
the
module-source-pins
branch
from
October 8, 2024 14:22
ada2f4c to
82f08c7
Compare
sipsma
reviewed
Oct 8, 2024
| require.Equal(t, "", strings.TrimSpace(out)) | ||
| } | ||
|
|
||
| func (ConfigSuite) TestDepPins(ctx context.Context, t *testctx.T) { |
Contributor
There was a problem hiding this comment.
It would be very nice to have a test where the pinned commit is behind HEAD on the branch and we verify that the pinned commit is used correctly
Contributor
Author
There was a problem hiding this comment.
Added a test for this using dagger/dagger-test-modules#5, and another one for testing that dagger develop doesn't modify the pins.
Contributor
There was a problem hiding this comment.
Approved that one, will let you press the merge button in case anything else needed
jedevc
force-pushed
the
module-source-pins
branch
from
October 9, 2024 14:58
82f08c7 to
a2c5268
Compare
Contributor
jedevc
force-pushed
the
module-source-pins
branch
from
October 17, 2024 14:54
a2c5268 to
b2e1407
Compare
sipsma
approved these changes
Oct 18, 2024
| require.Equal(t, "", strings.TrimSpace(out)) | ||
| } | ||
|
|
||
| func (ConfigSuite) TestDepPins(ctx context.Context, t *testctx.T) { |
Contributor
There was a problem hiding this comment.
Approved that one, will let you press the merge button in case anything else needed
Signed-off-by: Justin Chadwell <[email protected]>
jedevc
force-pushed
the
module-source-pins
branch
from
October 18, 2024 10:07
b2e1407 to
2738237
Compare
This was referenced Dec 10, 2024
8 tasks done
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.
Fixes #7898.
This PR modifies the module config
dependenciesfield to ensure that we preserve the original tags that the user specified duringdagger install.So with a command like:
We get the following (see the diff between before and after):
This essentially allows us to keep the original source that we installed a dependency via, while also keeping the pins.
Note
Naming note - I chose
pinbecause that matches up with terminology in other tooling, and it's also generic. If we ever support non-git remote source (e.g. OCI images), thenpinis more generic and correct thancommit.To gracefully upgrade old
dagger.jsons, we leavesourceunaltered, and copy thepinfrom the commit in thesource(which is always guaranteed to be there).