Skip to content

feat: add WithFiles to Directory and Container - #6556

Merged
jedevc merged 1 commit into
dagger:mainfrom
tomasmota:with-files
Feb 12, 2024
Merged

jedevc merged 1 commit into
dagger:mainfrom
tomasmota:with-files

Conversation

@tomasmota

Copy link
Copy Markdown
Contributor

Fixes: #6475

The issue mentioned only Directory, but I also added it to Container, not sure that was a good idea. Also, this is my first contribution so I might be missing a few things.

With regards to the sdk changelog, it seems like that is something I should do after creating the PR? go through every sdk and run it?

Also a question: in Directory WithFiles, I wasn't sure whether or not I should have re-used WithFile, some feedback on that would be great :)

@helderco

helderco commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

With regards to the sdk changelog, it seems like that is something I should do after creating the PR? go through every sdk and run it?

Since this is a core change you only run changie in the root of the repo, not the sdks.

@helderco

helderco commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

Also a question: in Directory WithFiles, I wasn't sure whether or not I should have re-used WithFile, some feedback on that would be great :)

Yeah, I was wondering why you didn't 🙂

@tomasmota
tomasmota force-pushed the with-files branch 3 times, most recently from a773d0a to b94e2c7 Compare February 1, 2024 17:39
@tomasmota

Copy link
Copy Markdown
Contributor Author

refactored and added the changeset :)

Comment thread core/directory.go Outdated

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.

While this is fine today, I think we could potentially invert this - have WithFile call WithFiles.

We could have mergeStates take multiple source inputs, which would potentially be much more efficient (translating to one MergeOp instead of lots of individual ones). That said, this is a trickier optimization (and I think is also somewhat blocked on #6073).

Just a note, no action required here (but we could potentially leave a TODO comment for follow-up).

Comment thread docs/docs-graphql/schema.graphqls Outdated
Comment on lines 521 to 522

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.

Suggested change
"""Identifiers of the files to copy."""
files: [FileID!]!
"""Identifiers of the files to copy."""
sources: [FileID!]!

We should mirror the structure of withFile.

  • withFile ➡️ withFiles
  • source ➡️ sources

@jedevc

jedevc commented Feb 8, 2024

Copy link
Copy Markdown
Contributor

Thanks for the contribution @tomasmota! 🎉 Sorry for the nitpicky-comments, only just got round to reviewing this 😢

@jedevc jedevc added this to the v0.9.10 milestone Feb 8, 2024
@tomasmota

Copy link
Copy Markdown
Contributor Author

The more thorough the review the more I learn, so nitpick away! I'll rename and add the TODO :)

@jedevc
jedevc merged commit da94119 into dagger:main Feb 12, 2024
@jedevc

jedevc commented Feb 12, 2024

Copy link
Copy Markdown
Contributor

Thanks @tomasmota!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Add WithFiles to Directory

3 participants