Skip to content

Commit

Permalink
chore: bump charm libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Feb 17, 2025
1 parent 7c9e3b1 commit ea49b02
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
11 changes: 10 additions & 1 deletion lib/charms/grafana_k8s/v0/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def __init__(self, *args):
# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version

LIBPATCH = 41
LIBPATCH = 42

PYDEPS = ["cosl >= 0.0.50"]

Expand Down Expand Up @@ -964,6 +964,13 @@ def _replace_uid(
"Processed dashboard '%s': kept original uid '%s'", dashboard_path, original_uid
)

@classmethod
def _add_tags(cls, dashboard_dict: dict, charm_name: str):
tags: List[str] = dashboard_dict.get("tags", [])
if not any(tag.startswith("charm: ") for tag in tags):
tags.append(f"charm: {charm_name}")
dashboard_dict["tags"] = tags

@classmethod
def load_dashboards_from_dir(
cls,
Expand Down Expand Up @@ -1006,6 +1013,8 @@ def _is_dashboard(p: Path) -> bool:
charm_name=charm_name,
)

cls._add_tags(dashboard_dict=dashboard_dict, charm_name=charm_name)

id = "file:{}".format(path.stem)
dashboard_templates[id] = cls._content_to_dashboard_object(
charm_name=charm_name,
Expand Down
10 changes: 5 additions & 5 deletions lib/charms/parca_k8s/v0/parca_scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ def _on_scrape_targets_changed(self, event):
import json
import logging
import socket
from cosl import JujuTopology
from typing import List, Optional, Union
from ops.model import Relation

import ops
from cosl import JujuTopology
from ops.model import Relation

# The unique Charmhub library identifier, never change it
LIBID = "dbc3d2e89cb24917b99c40e14354dd25"
Expand All @@ -185,7 +185,7 @@ def _on_scrape_targets_changed(self, event):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 4
LIBPATCH = 5


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -298,12 +298,12 @@ def _validate_relation_by_interface_and_direction(

if expected_relation_role == ops.RelationRole.provides:
if relation_name not in charm.meta.provides:
raise ops.RelationRoleMismatchError(
raise RelationRoleMismatchError(
relation_name, ops.RelationRole.provides, ops.RelationRole.requires
)
elif expected_relation_role == ops.RelationRole.requires:
if relation_name not in charm.meta.requires:
raise ops.RelationRoleMismatchError(
raise RelationRoleMismatchError(
relation_name, ops.RelationRole.requires, ops.RelationRole.provides
)
else:
Expand Down

0 comments on commit ea49b02

Please sign in to comment.