Open W1M0R opened 1 month ago
Thank you for your proposal.
it should try and find the registry in one of the other configuration files
I disagree with this idea. aqua.yaml shouldn't depend on other files implicitly.
I recommend the workaround 3
. The drawback of the workaround 2
is you need to add copied registry to a policy file and run aqua policy allow
.
About policy, please see https://aquaproj.github.io/docs/guides/policy-as-code
But the drawback of the workaround 3
is the relative path depends on the location of aqua.yaml.
path: ../../../aqua-registry.yaml # option 3
So my idea is to support a template variable like ${{ GitRootDir }}
in path
.
path: ${{ GitRootDir }}/aqua-registry.yaml
This is useful when multiple aqua.yaml share a local registry in a Monorepo.
Ah, yes, I like your idea, that would be great.
I think I misunderstood the purpose of the configuration file list. I now realize it is only intended for inheriting packages, not so much for inheriting configuration.
Feature Overview
The configuration search order is specified here: https://aquaproj.github.io/docs/reference/config/#configuration-file-path
When I execute
aqua i -l
, I get aregistry isn't found
error when theaqua.yaml
specifies a package that uses a local registry. The local registry has already been declared in the top-mostaqua.yaml
file, but it is not being detected by the command. Ideally, since aqua knows about the list of configuration files (via aqua info), instead ofregistry isn't found
, it should try and find the registry in one of the other configuration files (i.e. the root configuration), and then try again with the installation.Consider the following monorepo setup:
If I am in
proj1
and run theaqua i -l
command, it should create shims for all packages found in the list of configuration files.The
monorepo/.aqua/aqua.yaml
file looks like this:The
monorepo/.aqua/aqua-registry.yaml
file looks like this:The
monorepo/src/proj1/.aqua/aqua.yaml
looks like this:An
aqua i -l
inproj1
should result in two packages being installed:meteor
andwails
. However, the following error occurs:Why is the feature needed?
In a monorepo, it would make sense to have a local registry specified once in the root of the monorepo, that can be used by other projects in the monorepo. The workarounds are good enough, but I think the experience can be improved.
Workaround
A few workarounds exist:
Example
aqua.yaml
:Example Code
Configuration
Note
No response