Skip to content

feat: refactor module downloading - #2286

Closed
jcdickinson wants to merge 2 commits into
dagger:mainfrom
jcdickinson:http-download
Closed

jcdickinson wants to merge 2 commits into
dagger:mainfrom
jcdickinson:http-download

Conversation

@jcdickinson

Copy link
Copy Markdown
Contributor

This significantly reworks how modules are downloaded. There are now different strategies for downloading modules.

  • Git: downloads with git and maintains the old behavior
  • Github: downloads using a .tar.gz from github. The API is used to find the latest tag
  • HTTP: Example, https://github.com/dagger/dagger#/archive/refs/tags/v0.2.7.tar.gz results in the github.com/dagger/dagger module name and https://github.com/dagger/dagger/archive/refs/tags/v0.2.7.tar.gz download URL. Everything is simply dumped into the directory, and versions are not supported.

Support for providing a full authentication header has also been added. This is done with the authorization-header flag. For example, --authorization-header 'token ghp_...'. This works for both HTTP and Github repos.

Finally, some of the require_tests were broken. The tests seemed to represent desired behavior, so I updatedparseDaggerRepoName.

An alternative to #2275.

Signed-off-by: Jonathan Dickinson [email protected]

@jcdickinson
jcdickinson requested review from a team, aluzzardi, samalba and shykes as code owners April 23, 2022 03:04
@jcdickinson
jcdickinson marked this pull request as draft April 23, 2022 03:10
@aluzzardi
aluzzardi requested a review from helderco April 23, 2022 06:51
@jcdickinson

Copy link
Copy Markdown
Contributor Author

I want to follow this up with dagger login or something similar to set credentials.

This significantly reworks how modules are downloaded. There are now different strategies for downloading modules.

* Git: downloads with git and maintains the old behavior
* Github: downloads using a .tar.gz from github. The API is used to find the latest tag
* HTTP: Example, `https://github.com/dagger/dagger#/archive/refs/tags/v0.2.7.tar.gz` results in the `github.com/dagger/dagger` module name and `https://github.com/dagger/dagger/archive/refs/tags/v0.2.7.tar.gz` download URL. Everything is simply dumped into the directory, and versions are not supported.

Support for providing a _full_ authentication header has also been added. This is done with the `authorization-header` flag. For example, `--authorization-header 'token ghp_...'`. This works for both HTTP and Github repos.

Finally, some of the require_tests were broken. The tests seemed to represent desired behavior, so I updated`parseDaggerRepoName`.

Signed-off-by: Jonathan Dickinson <[email protected]>
@TomChv TomChv added area/cli All about go code on dagger CLI area/engine About dagger core engine labels May 3, 2022
@TomChv

TomChv commented May 3, 2022

Copy link
Copy Markdown
Member

I think it would be really appreciate to have your point of view on that PR @aluzzardi @helderco

@jcdickinson

jcdickinson commented May 4, 2022 •

Copy link
Copy Markdown
Contributor Author

I think the basic HTTP download might need some redesign. Currently it takes URLs in the form:

https://github.com/dagger/dagger#/archive/refs/tags/v0.2.7.tar.gz

The fragment portion is lost after the project update (it isn't stored anywhere), meaning that any future project update (or project install) won't have the full URL to download from. Any ideas on how this could be improved?

@aluzzardi

Copy link
Copy Markdown
Contributor

/cc @helderco

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli All about go code on dagger CLI area/engine About dagger core engine kind/stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants