Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename id argument in Container.withRootfs #5513

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

helderco
Copy link
Contributor

Closes #4192

This has minimal impact since the renamed argument is required/positional in the SDKs. Will only break if someone's using the argument name directly such as in a GraphQL query string.

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
@helderco helderco added the kind/breaking Breaking Change label Jul 27, 2023
@helderco helderco requested a review from vito July 27, 2023 11:53
Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
@@ -86,7 +86,7 @@ type Container {
fs: Directory! @deprecated(reason: "Replaced by `rootfs`.")

"Initializes this container from this DirectoryID."
withRootfs(id: DirectoryID!): Container!
withRootfs(directory: DirectoryID!): Container!
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't disagree with this name, but want to flag that other APIs like withMountedDirectory call this source. I think directory is OK here case because there's nothing to disambiguate it against, whereas withMountedDirectory also has a "target" path. But then withMountedDirectory just calls it path anyway so there's no symmetry like source/target. 🤦‍♂️

Just raising to see what you think. Would it make sense to rename the others to directory too? 🤔 (Not necessarily as part of this PR; approving as-is.)

Copy link
Contributor Author

@helderco helderco Jul 27, 2023

Choose a reason for hiding this comment

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

Yeah, I initially had source in the issue but then changed to directory to mirror withDirectory(path: String!, directory: DirectoryID!).

So in mounts source is used, in builds context is used and directory outside of that.

Outliers are Directory.diff which uses other but that makes sense, and Project.load, which uses source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm good with renaming these for consistency though in a follow-up.

@helderco helderco merged commit cf4c468 into dagger:main Jul 27, 2023
21 checks passed
@helderco helderco deleted the gh-4192-rename-id-argument branch July 27, 2023 18:08
sipsma pushed a commit to sipsma/dagger that referenced this pull request Jul 29, 2023
* Rename `id` argument in `Container.withRootfs`

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>

* Add change log

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>

---------

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
@gerhard gerhard added this to the 0.8.0 BREAKING CHANGES RELEASE milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/breaking Breaking Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename id argument name in fields that don’t return its type
3 participants