Merge ~gabrielcocenza/juju-lint:charm_not_recognize/BSENG-2093 into juju-lint:master

Proposed by Gabriel Cocenza
Status: Merged
Approved by: Eric Chen
Approved revision: 9a7a420b95cf67c694dd7a83c297ba149f8ecfc6
Merged at revision: ee96e76c8815e7f4d9e3abacb575ae4bdcc2060e
Proposed branch: ~gabrielcocenza/juju-lint:charm_not_recognize/BSENG-2093
Merge into: juju-lint:master
Diff against target: 29 lines (+3/-4)
2 files modified
jujulint/lint.py (+2/-1)
tests/unit/test_jujulint.py (+1/-3)
Reviewer Review Type Date Requested Status
Tianqi Xiao (community) Approve
Andrea Ieri Approve
Review via email: mp+462904@code.launchpad.net

Commit message

Change loglevel of unrecognized charms from error to info

- error level currently generates too many false positives that hide actual
  errors in the bundle or the deployment.
- this might be a temporary solution until rules are updated to handle COS charms

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Samuel Allan (samuelallan) wrote :

Could you update the commit message here with info about how this is desired as a temporary solution until COS support is ready in juju-lint, and that the false positives relate to extra COS-related charms deployed (I think this was the reason)?

Revision history for this message
Samuel Allan (samuelallan) wrote :

Ah I see now this info is in the linked bug report, by bad. I still think it could be good to have more information in the commit. :)

Revision history for this message
Gabriel Cocenza (gabrielcocenza) wrote :

> Ah I see now this info is in the linked bug report, by bad. I still think it
> could be good to have more information in the commit. :)

Good idea, I've changed to mention it

Revision history for this message
Andrea Ieri (aieri) wrote :

I've taken the liberty of tweaking the commit message, otherwise lgtm

review: Approve
Revision history for this message
Tianqi Xiao (txiao) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision ee96e76c8815e7f4d9e3abacb575ae4bdcc2060e

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/jujulint/lint.py b/jujulint/lint.py
2index 8fa3f97..b40b00d 100755
3--- a/jujulint/lint.py
4+++ b/jujulint/lint.py
5@@ -864,7 +864,8 @@ class Linter:
6 "description": "An unrecognised charm is present in the model",
7 "charm": charm,
8 "message": "Charm '{}' not recognised".format(charm),
9- }
10+ },
11+ log_level=logging.INFO
12 )
13 # Then look for charms we require
14 for charm in self.lint_rules["operations mandatory"]:
15diff --git a/tests/unit/test_jujulint.py b/tests/unit/test_jujulint.py
16index b98474b..8d49cb1 100644
17--- a/tests/unit/test_jujulint.py
18+++ b/tests/unit/test_jujulint.py
19@@ -352,9 +352,7 @@ applications:
20 linter.do_lint(juju_status)
21
22 errors = linter.output_collector["errors"]
23- assert len(errors) == 1
24- assert errors[0]["id"] == "unrecognised-charm"
25- assert errors[0]["charm"] == "ubuntu"
26+ assert len(errors) == 0
27
28 def test_ops_subordinate_missing(self, linter, juju_status):
29 """Test that missing ops subordinate charms are detected."""

Subscribers

People subscribed via source and target branches