From 054fdb048dca00b06a7ae360a2d3d9ec302f309c Mon Sep 17 00:00:00 2001 From: James Garner Date: Mon, 31 Aug 2026 21:03:32 +1200 Subject: [PATCH 1/2] fix(kubeflow-dashboard-links): correct the requirer databag in the interface schema The schema declared the requirer's application databag as a bare list of dashboard items. A Juju databag is always a mapping, and the library (`charms.kubeflow_dashboard.v0.kubeflow_dashboard_links`) writes the list JSON-encoded under a `dashboard_links` key. The schema now says that, which also makes it usable with `ops.Relation.load`. The interface README still shows the bare list, and should be updated to match. Alongside this, the schema moves to the new format: models are named directly as `ProviderAppData`, `ProviderUnitData`, `RequirerAppData` and `RequirerUnitData` rather than wrapped in `pytest-interface-tester` classes, with `None` for a databag that is always empty. A follow-up PR documents the format and adds a CI check for it, once every interface has been migrated. Co-Authored-By: Claude Opus 5 --- .../interface/v0/schema.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/interfaces/kubeflow_dashboard_links/interface/v0/schema.py b/interfaces/kubeflow_dashboard_links/interface/v0/schema.py index 95fe7ce72..995f34756 100644 --- a/interfaces/kubeflow_dashboard_links/interface/v0/schema.py +++ b/interfaces/kubeflow_dashboard_links/interface/v0/schema.py @@ -3,9 +3,10 @@ """This file defines the schemas for the provider and requirer sides of the kubeflow-dashboard-links interface. Examples: - RequirerSchema: + Requirer: unit: - app: [ + app: { + "dashboard_links": '[ { "text": "Some link text", "link": "/some-relative-link", @@ -14,10 +15,10 @@ "icon": "assessment", "desc": "link description" } - ] + ]' + } """ -from interface_tester.schema_base import DataBagSchema from pydantic import BaseModel @@ -45,7 +46,12 @@ class DashboardItem(BaseModel): desc: str = "" -class RequirerSchema(DataBagSchema): - """Requirer schema for Ingress.""" +class RequirerAppData(BaseModel): + """The requirer's application databag.""" - app: list[DashboardItem] + dashboard_links: list[DashboardItem] + + +ProviderAppData = None +ProviderUnitData = None +RequirerUnitData = None From a900aa7668fbb682fcdab68fb9eb94c90262c781 Mon Sep 17 00:00:00 2001 From: James Garner Date: Thu, 3 Sep 2026 17:22:22 +1200 Subject: [PATCH 2/2] docs: correct readme --- interfaces/kubeflow_dashboard_links/interface/v0/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interfaces/kubeflow_dashboard_links/interface/v0/README.md b/interfaces/kubeflow_dashboard_links/interface/v0/README.md index c514b2f4b..ec21511dc 100644 --- a/interfaces/kubeflow_dashboard_links/interface/v0/README.md +++ b/interfaces/kubeflow_dashboard_links/interface/v0/README.md @@ -25,6 +25,8 @@ The requirer specifies zero or more sidebar items in the required format. #### Example +The `dashboard_links` key might contain the following as a JSON-encoded string: + ```json [ {