Hi All,

My team own a large product that sprawls across a lot of repos.  We also 
manage a private, commercial fork and we occasionally do new development in 
private and then merge across to open source.  While a monorepo might have 
been easier to manage, we're stuck with what we've got.  We've recently 
moved to go mod and it just seems like we're constantly fighting the tool.  
I'm hoping you can either suggest some good workflows or maybe improve the 
tool!

I think the biggest problem we have is when working with private repos.  
 What I want to express to the tool is 

My module requires commit abcd1234 (or version v1.2.3) of dependency x/y/z

Look for any instances of dependency x/y/z in git repo 
g...@github.com:ourfork instead of the default.


However, what I can express to the tool is

My module requires version ??? of dependency x/y/z

Replace  x/y/z @ version ??? with <other module> @ abcd1234

 

This throws up a couple of problems:

   - What should version ??? be?  It's only there to be replaced, which 
   seems like a bit of a smell.  
      - If I set it to the commit ID it gets resolved and I have to change 
      three places in the file each time I move the pin.
      - If I set it to a particular version, that seems misleading.  
      - I guess I can set it to v0.0.0, but again that seems misleading.
   - There's nowhere to specify the details of the repo (e.g. 
   connection/auth type), all that has to magically work according to my git 
   settings and the defaults aren't great for private repos (which we access 
   over ssh).

We also just ran into the new GOPRIVATE env var and had to update all our 
builds to use that.  Couldn't that just fall back to the private behaviour 
if it gets a cache miss, it seems over-engineered to require an explicit 
exception!

Another issue we've had is making a build mode where we can build against 
local copies of the dependencies for quick development.  We can add replace 
directives to point to local directories, which is part of the puzzle, but 
it's hard to do that "just for one build".  Not sure what we're looking for 
here; maybe an optional go.mod override file that can be passed in for just 
one build?  

-Shaun

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/208c32de-2c61-4148-9c31-3e11d4cebbd4%40googlegroups.com.

Reply via email to