2

There are multiple projects and they all are dependent on each other. I want to manage the versions for all. e.g. There are three projects: 1. A ---> Contains schema 2. B ---> Contains config 3. C ---> Contains actual api code

Now, I want to manage the version of all the dependent projects in project C. How to do that?

  • git is not designed to handle dependencies, packages are. You'd better use packaging. – OznOg Mar 17 '19 at 12:40
  • It is golang project. How to do that in go? – Surinder Rajpal Mar 17 '19 at 12:41
  • I don't know go, but google seems to have quite a lot of hits on the subject (go dependencies and packaging) – OznOg Mar 17 '19 at 12:45
  • That said, if you want a painful solution using git, you may use submodules, but it requires extra care when working on your repository. – OznOg Mar 17 '19 at 12:47
  • Additional info: These are two different projects and interact via rest calls or kafka only. – Surinder Rajpal Mar 17 '19 at 12:48
  • if you want to ask how to do that in go, consider closing this question and opening a new one. Answer to the question as it is is "you shouldn't do this with git, but instead with some packaging mechanism/build tool" – eis Mar 18 '19 at 06:10

1 Answers1

0

It is golang project. How to do that in go?

With Go modules, which would record those dependencies with go.mod/go.lock files: those files would be recorded in your project C Git repo as part of C source codebase.
See an example here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • These are two different projects and interact via rest calls or kafka only. – Surinder Rajpal Mar 18 '19 at 07:07
  • @SurinderRajpal So you need to define a third project, which will manage the interaction, REST API calls and Kafka calls, and will be used by the first two projects. – VonC Mar 18 '19 at 07:28
  • Let me explain it again: There are two two projects: **A** --> Which takes oracle data and puts that in kafka **B** ---> Which takes data from kafka and converts it to mongo. Now, I want to manage which version of A is compatible with which version of B. Suppose, A has version 2.1.1 and B version compatible for this is 3.2.1. Now A has version 2.4.3 and B version compatible for this is 3.4.1. – Surinder Rajpal Mar 18 '19 at 07:38
  • @SurinderRajpal So this is not a Go dependency issue, but a runtime data dependency compatibility one? – VonC Mar 18 '19 at 08:22
  • you can say that. – Surinder Rajpal Mar 18 '19 at 09:20