#The Go toolchain linter does when dependencies are from the same private repo

1 messages · Page 1 of 1 (latest)

tired cove
#

Not sure on how to structure this.

In one repository we have multiple smaller dagger modules that are used in several other private repositories in our GitHub org. I've been using the Go toolchain linting for each modules, but I recently noticed that if I have a module that depends on another module that is adjacently located to this module, the linter fails with the following:

# <for one of the private dependencies>
failed to determine Git URL protocol

I've checked that I have the Git Credential Manager set up by reinstalling the dependency with dagger install.

Has anyone experienced this issue before?

An observation I have is that it is perfectly fine to lint the module in another private repository depending on a module from a different private repository.

proven prawn
#

@tired cove so IIUC:

modules repo: 

m/moda
m/modb  (depends on moda)


application repo: 

a/appmod (uses to go toolchain and has a dependency on modb?)

So when you run the Go linting in appmod that fails?

#

just trying to understand what the setup is here

tired cove
#

@proven prawn , in that kind of structure, yes: The error message I receive from dagger suggests that dagger is not able to resolve the dependency from git, even though dagger is perfectly fine to install the dependency with dagger install.

Here is the dagger.json manifest for the specific project, although with redacted org and repos and renamed:

{
  "name": "my-package", // Inside github.com/org/repo/dagger/my-package
  "engineVersion": "v0.19.11",
  "sdk": {
    "source": "go"
  },
  "toolchains": [
    {
      "name": "go",
      "source": "github.com/dagger/dagger/toolchains/go@main",
      "pin": "aed37d3afe9d9f1fa318afc679c4bbc7ff7b41b2"
    }
  ],
  "dependencies": [
    {
      "name": "my-dep",
      "source": "github.com/org/repo/dagger/my-dep@dagger/my-dep/v0.1.2",
      "pin": "567670f7148e0114c77490bab554ff17ae0249b3"
    }
  ]
}

To add to this, if I pull my-package as a dependency to another dagger module outside of this repository and run the linter, I won't run into this issue.

The temporary solution for now have been to just not use the linter for this project, which is unfortunate.

proven prawn
tired cove
proven prawn
#

fwiw it should also work with the remote URL. I'm just checking if I can unblock you in the meantime while I find the time to troubleshoot since this requires setting up private repos, etc

tired cove
# proven prawn gotcha. Since they're in the same repo, would you be able to use a relative path...

I appreciate the help very much. I've tried pulling in the my-dep dependency through relative path, but that had limited success: I'm able to install the dependency as a filesystem dependency and consume the dependency through dagger call <some function>, but not with dagger call go --source . lint. Dagger eventually fails with stat /my-dep/dagger.json: no such file or directory.

We are not blocked by this at the moment: We can get around this by not using the linter for this specific dagger module. Our dagger modules are only used for CI and are not part of any production code, so it is okay for us to not use the linter, even though it would be very nice to have.

proven prawn