Allow aliases for the rules provided by the snap

Bug #2012952 reported by Mert Kirpici
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Lint
Triaged
Wishlist
Unassigned

Bug Description

The snap package provides some rules files for common configurations, however we still need to provide the full path to them, which I think is not ideal from a user experience point of view.

I propose supporting well documented aliases for the provided defaults.
Instead of this

  $ juju-lint -c /snap/juju-lint/current/contrib/openstack-focal-ovn.yaml ...

We could have something like this

  $ juju-lint -c openstack-focal-ovn ...

Also taking this idea further, a mechanism to declare aliases may be another good feature to have as well.

Eric Chen (eric-chen)
Changed in juju-lint:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Andrea Ieri (aieri) wrote :

Given that it's targeting a built-in ruleset, the reason to run something like

$ juju-lint -c /snap/juju-lint/current/contrib/openstack-focal-ovn.yaml

is usually to work around a failed autodetection. So I think it would be more valuable to focus on how to make it less likely for operators to need to run such a command. Is there another use case for wanting to manually pass a built-in ruleset?

Revision history for this message
Mert Kirpici (mertkirpici) wrote :

if I understand you correctly, juju-lint is supposed to auto detect the cloud series, release and configuration information from the given bundle file as input.

I was not aware of this feature and could not get it to work with the current released version in the edge channel(1.0.7).

It always seems to be looking for a ruleset file, either given through the command line, or a file named lint-rules.yaml in the current working directory by default.

However there is an auto detection feature that determines the type of the cloud, i.e. openstack or k8s. That feature checks for the existence of the typically expected charms from that type of cloud. Here is an example log line:

$ juju lint -c contrib/fcb-yoga-focal.yaml tests/resources/fcb-yoga-focal-bundle.yaml
...
2023-06-20 21:08:14 [WARNING] [tests/resources/fcb-yoga-focal-bundle.yaml] [manual/manual] Setting cloud-type to 'openstack'. Deployment has these charms: {'keystone', 'nova-cloud-controller', 'glance', 'nova-compute', 'openstack-dashboard', 'neutron-api'} that are typically from openstack.
...

For the sake of completeness, here is my trial for auto detecting the cloud configuration:
$ juju lint tests/resources/fcb-yoga-focal-bundle.yaml
2023-06-20 21:19:00 [ERROR] Cloud not locate rules file lint-rules.yaml

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.