Skip to content

Improve how repos from required modules are downloaded (i.e., make it more modular) #2511

Closed as not planned

Description

@helderco

Problem

When downloading modules from cue.mod/dagger.mod, we have a regex that tries to match a repo prefix and path suffix from a URL. This has limited capability. It works well enough if you have .git to split them, or if it's GitHub, though.

As for authentication, it assumes a public repo (https) unless a --private-key argument is provided, in which case ssh is used. We need more authentication methods.

We could also benefit from downloading from import path, instead of just URL.

Solution

Make this more modular to be easier to add capabilities later:

  • Find URL to fetch:
    • Is it a URL? VCS?
    • Is it an import path? Vanity URL?
  • Download repo:
    • Try known vcs providers like Go does
    • Based on those, is downloading a zip available instead of a clone (e.g., GitHub)?
  • Authentication:
    • Try public
    • Try ssh forwarding
    • Check CLI arguments for additional methods

Activity

  1. added
    area/engine
    on Jul 11, 2022
  2. added and removed
    area/engine
    on Dec 6, 2022
  3. helderco commented on Dec 22, 2022

    @helderco
    ContributorAuthor

    Closing. More context in parent issue: #2163.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions