Skip to content

Rename id argument in Container.withRootfs - #5513

Merged
helderco merged 2 commits into
dagger:mainfrom
helderco:gh-4192-rename-id-argument
Jul 27, 2023
Merged

helderco merged 2 commits into
dagger:mainfrom
helderco:gh-4192-rename-id-argument

Conversation

@helderco

Copy link
Copy Markdown
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.

@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 <[email protected]>

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

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 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.)

@helderco helderco Jul 27, 2023 •

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.

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
Copy Markdown
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.

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