Skip to content

cli: automatically make dir+file flags absolute paths - #6744

Merged
sipsma merged 1 commit into
dagger:mainfrom
sipsma:make-path-flags-abs
Feb 27, 2024
Merged

sipsma merged 1 commit into
dagger:mainfrom
sipsma:make-path-flags-abs

Conversation

@sipsma

@sipsma sipsma commented Feb 26, 2024

Copy link
Copy Markdown
Contributor

The engine complains if the Host API is used with non-absolute paths. For the CLI's use case, this is not really meaningful since the user is explicitly passing paths anyways so we can safely make the paths absolute on the user's behalf automatically.

Adding to v0.10 since it's an annoying enough papercut and the fix is extremely trivial (vast majority of additions here are test code)

@sipsma sipsma added this to the v0.10.0 milestone Feb 26, 2024
@sipsma
sipsma requested review from helderco, jedevc and vito February 26, 2024 21:54

@jedevc jedevc 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.

Oh nice!

I was expecting this would be done by changing the API to remove the warning entirely, but this works nicely 🎉

@sipsma

sipsma commented Feb 26, 2024

Copy link
Copy Markdown
Contributor Author

Failures are due to docs issues being fixed in #6745, will just rebase this one on that once merged

@sipsma

sipsma commented Feb 26, 2024

Copy link
Copy Markdown
Contributor Author

I was expecting this would be done by changing the API to remove the warning entirely, but this works nicely 🎉

Yeah I suspect we could just lift the limitation there at this point, but in the interest of minimizing boat rocking at the last minute decided to just go with this 😄

@helderco helderco 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.

Orthogonal to this but we could also support loading from git://, right?

@sipsma

sipsma commented Feb 27, 2024

Copy link
Copy Markdown
Contributor Author

Orthogonal to this but we could also support loading from git://, right?

Yep! Just wanted this PR to be as minimal as possible, but that should be pretty trivial as a follow-up too if desired

The engine complains if the Host API is used with non-absolute paths.
For the CLI's use case, this is not really meaningful since the user is
explicitly passing paths anyways so we can safely make the paths
absolute on the user's behalf automatically.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the make-path-flags-abs branch from 80b5968 to 655c50a Compare February 27, 2024 02:34
@sipsma
sipsma merged commit 2bf4b6e into dagger:main Feb 27, 2024
@jedevc

jedevc commented Feb 27, 2024

Copy link
Copy Markdown
Contributor

Orthogonal to this but we could also support loading from git://, right?

🤔 I might be missing something, but don't we do this already? https://github.com/sipsma/dagger/blob/ea8997b2e6eec28d0b46969479f963c3846641d5/cmd/dagger/flags.go#L193

Added in #6058

@sipsma

sipsma commented Feb 27, 2024

Copy link
Copy Markdown
Contributor Author

Orthogonal to this but we could also support loading from git://, right?

🤔 I might be missing something, but don't we do this already? https://github.com/sipsma/dagger/blob/ea8997b2e6eec28d0b46969479f963c3846641d5/cmd/dagger/flags.go#L193

Added in #6058

@jedevc that was for Directory args, we don't have the same for File yet though

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.

3 participants