Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dynamic control of dashboard links #134

Merged
merged 7 commits into from
Jul 13, 2023

Conversation

ca-scribner
Copy link
Contributor

@ca-scribner ca-scribner commented Jul 12, 2023

This implements dynamic control of the kubeflow dashboard links (the menuLinks, externalLinks, quickLinks, and documentationLinks as shown in the attached image), as defined in this task and originally requested in #8. See the spec for full details.

image

Changes here include:

  • a new library, kubeflow_dashboard_links, that manages a new relation (links)
  • new config options (additional-*-links and *-link-order) to add links manually and control the link order, respectively
  • breaking the removal of all default links (these will now be implemented in their respective charm in future PRs)

Notes to reviewers:

Everything has previously been reviewed as they were merged into this feature branch (see commit history). If tests pass, this is fully reviewed and can be merged.

Notes for merging:

This PR should be merged, not squashed, as the changes are quite broad and each commit is its own sizable PR

Missing and will be covered separately:

  • updated readme.md (still needs review - will go straight to main)

Closes #8

Changes include:
* adding KubeflowDashboardSidebarRequirer
* adding KubeflowDashboardSidebarProvider
* adding SidebarItem
* adding associated tests, including a Requires side tester for the new relation
* adding the sidebar relation and using the KubeflowDashboardSidebarProvider to manage it
* refactoring computation of k8s context until it is needed, instead of in `__init__`, to make testing easier
* feat: add user-defined sidebar links

This adds a config option additional-sidebar-links which accepts a YAML or JSON formatted input defining additional sidebar links.  These are combined with the relation-driven sidebar links.

Also:
* adds tests for this feature
* temporarily pins quality-checks.yaml to a commit because the main branch has a breaking change and previous releases were not versioned
This adds a config option, sidebar-link-order, that allows users to define the order of the links in the sidebar
…ntrol all dashboard links (#130)

Takes the existing sidebar implementation (for dashboard `menuLinks`) and refactors it to be easily extended to all kubeflow dashboard link types (menu, external, quick, and documentation).

* Changes the library from SidebarItems to DashboardLinks (to make it easier to extend the lib to manage other link types)
* Changes the library to use Dashboard nomenclature
* Refactors charm and tests to use updated library
* Renames any existing sidebar_items to menu_links
This extends the dynamic control of the dashboard's `menuLinks`, enabling control over all four types of dashboard links (menu, external, quick, and documentation).  This includes both relation-driven links and configuration-driven links, plus control of the link order via config.

Changes include:
* adds a `location` field to the DashboardLink
* adds `location` to the get_dashboard_links tools
* add config options for all other dashboard link types
* incorporates new dashboard link types into the dashboard configmap template
* updates/refactors tests
@ca-scribner ca-scribner force-pushed the kf-3664-dynamic-sidebar-feature-branch branch from fd13576 to 821f584 Compare July 12, 2023 23:07
Copy link
Contributor

@i-chvets i-chvets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.
Content has been reviewed previously as well.

@ca-scribner ca-scribner merged commit a4ea068 into main Jul 13, 2023
6 checks passed
@ca-scribner ca-scribner deleted the kf-3664-dynamic-sidebar-feature-branch branch July 13, 2023 11:45
ca-scribner added a commit to canonical/bundle-kubeflow that referenced this pull request Jul 14, 2023
This adds the dashboard links relations to the bundle, as required by the [dynamic dashboard PR](canonical/kubeflow-dashboard-operator#134)
ca-scribner added a commit to canonical/bundle-kubeflow that referenced this pull request Jul 18, 2023
This adds the dashboard links relations to the bundle, as required by the [dynamic dashboard PR](canonical/kubeflow-dashboard-operator#134)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants