How to determine right base dependency in repository.json


#1

I can see from c3Grid(Cluster.hosts) that the server version being used is:

c3-server-7.8.1.5752-1.x86_64.rpm

Is there a way for me to figure out the right c3base dependency to use (without contacting engineering directly)?

The repository.json file in my application repo looks like this currently:

 repository.json 
{
  "name": "trial",
  "version": "1.0.0",
  "description": "C3 IoT Trial and POC Packages",
  "dependencies": { "base" : "7.7.6+70"}
}

and for provisioning to work, I need to specify the correct level of “base”

Thanks


#2

You’re really looking at this backwards… the version of the server should be the one that your version of base requires. You could figure out this version with the following command:

PackageManager.fetchRepositoryBuilds({filter: "semanticVersion == '7.7.6+70' && packageName == 'base'", include: "dependencies"}).at("objs[0].dependencies").server

If you MUST go backwards to find a version of c3base that works with a particular server, you could adapt the above command as:

PackageManager.fetchRepositoryBuilds({filter: "packageName == 'base' && exists(dependencies.key() == 'server' && dependencies == '7.8.1.5752')", include: 'semanticVersion'}).at("objs[0].semanticVersion")

NOTE THAT THE ABOVE COMMAND RETURNS NO VERSIONS.
This is because there never was a c3base that depends on 7.8.1.5752. This is why i say you are asking the question ‘backwards’


#3

Though that might be backwards to think about it from an architectural standpoint it is the right way for some use cases. If you are jumping to and from environments (which usually have different c3server versions) there is no good way to determine the correct c3base version to use. It would be nice to have a simple way to determine this via the console.