Skip to content

Conversation

safoinme
Copy link
Contributor

@safoinme safoinme commented Sep 29, 2025

Describe changes

  • extend the deployment domain models and API surface to represent curated deployment visualizations, including request/update/response models and filter support.
  • persist curated visualizations by introducing the corresponding SQLModel schema, Alembic migration, and REST/SQL store logic, and wiring the new routes into the FastAPI server.
  • expose client helpers so SDK users can add, list, update, and delete the curated visualizations associated with a deployment while keeping responses hydrated with attached artifacts.

Why

  • product teams need a first-class way to curate which artifact visualizations show up alongside a deployment so dashboards can surface the right insights without manual filtering.
  • storing these curation decisions in the backend ensures they survive across sessions, are shareable across users, and can participate in RBAC/project scoping.
  • wiring the API through the client and stores keeps the SDK in sync with the server capabilities, enabling immediate consumption by CLI/UI flows.

This is related to #4007 and the Custom visualisation ticket in Notion

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • I have based my new branch on develop and the open PR is targeting develop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.
  • IMPORTANT: I made sure that my changes are reflected properly in the following resources:
    • ZenML Docs
    • Dashboard: Needs to be communicated to the frontend team.
    • Templates: Might need adjustments (that are not reflected in the template tests) in case of non-breaking changes and deprecations.
    • Projects: Depending on the version dependencies, different projects might get affected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

@github-actions github-actions bot added internal To filter out internal PRs and issues enhancement New feature or request labels Sep 29, 2025
@safoinme safoinme linked an issue Sep 29, 2025 that may be closed by this pull request
1 task
@schustmi
Copy link
Contributor

@safoinme Can you write a description for this PR please, and include why we need all of this?

This change sets the `include_metadata` and `include_resources` parameters to `False` in the `visualization.to_model` method call within the `DeploymentSchema` class. This adjustment ensures that unnecessary metadata and resources are not included in the visualizations.

No functional changes are expected as a result of this update.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2025

ZenML CLI Performance Comparison (Threshold: 1.0s, Timeout: 60s, Slow: 5s)

❌ Failed Commands on Current Branch (feature/deployment-custom-visualizations)

  • zenml stack list: Command failed on run 1 (exit code: 1)
  • zenml pipeline list: Command failed on run 1 (exit code: 1)
  • zenml model list: Command failed on run 1 (exit code: 1)

🚨 New Failures Introduced

The following commands fail on your branch but worked on the target branch:

  • zenml stack list
  • zenml pipeline list
  • zenml model list

Performance Comparison

Command develop Time (s) feature/deployment-custom-visualizations Time (s) Difference Status
zenml --help 1.390243 ± 0.025020 1.409484 ± 0.009000 +0.019s ✓ No significant change
zenml model list Not tested Failed N/A ❌ Broken in current branch
zenml pipeline list Not tested Failed N/A ❌ Broken in current branch
zenml stack --help 1.377932 ± 0.007937 1.409590 ± 0.015748 +0.032s ✓ No significant change
zenml stack list Not tested Failed N/A ❌ Broken in current branch

Summary

  • Total commands analyzed: 5
  • Commands compared for timing: 2
  • Commands improved: 0 (0.0% of compared)
  • Commands degraded: 0 (0.0% of compared)
  • Commands unchanged: 2 (100.0% of compared)
  • Failed commands: 3 (NEW FAILURES INTRODUCED)
  • Timed out commands: 0
  • Slow commands: 0

Environment Info

  • Target branch: Linux 6.11.0-1018-azure
  • Current branch: Linux 6.11.0-1018-azure
  • Test timestamp: 2025-10-23T14:59:56Z
  • Timeout: 60 seconds
  • Slow threshold: 5 seconds

Copy link
Contributor

@stefannica stefannica left a comment

Choose a reason for hiding this comment

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

This feature has the potential of becoming more than just a deployment association. In fact, I would even say that attaching visualizations to deployments is the least useful of the possible range of associations that can happen at pipeline, pipeline run and pipeline snapshot level.

If it's not too late, I'll still recommend that this be implemented using a more generic and extensible approach, similar to how run metadata is implemented (see RunMetadataResourceSchema).

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

Documentation Link Check Results

Absolute links check failed
There are broken absolute links in the documentation. See workflow logs for details
Relative links check passed
Last checked: 2025-10-23 17:14:17 UTC

@stefannica stefannica self-requested a review October 10, 2025 11:39
Copy link
Contributor

@stefannica stefannica left a comment

Choose a reason for hiding this comment

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

This looks mostly great and I love how extensible you've made it. That being said, I do have a couple of high-level comments that will require you to change things a bit:

  1. the CuratedVisualization models and Client methods don't reflect the UX expectations (see my comments)
  2. you still need to add support in the schema for all the various resources

@stefannica stefannica force-pushed the feature/deployment-custom-visualizations branch from 09d791a to eeec764 Compare October 20, 2025 12:13
schema_class=CuratedVisualizationSchema,
session=session,
)
schema.update(visualization_update)
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if I update a curated visualization to have the same display index as another one? Does that cause issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe question for @Cahllagerfeld? how are we expecting to send this from front-end

Copy link
Contributor

Choose a reason for hiding this comment

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

Well I assume that backend should just guarantee that they have unique values? The frontend gets a list I assume, but if you want to allow users to define the order for this, it should work as expected. (Which currently, when we allow duplicate values, it doesn't. I can set something to display in position 2, but if 10 others already have the same value, it might only show up in position 11.

@safoinme safoinme requested a review from schustmi October 23, 2025 10:03
schema_class=CuratedVisualizationSchema,
session=session,
)
schema.update(visualization_update)
Copy link
Contributor

Choose a reason for hiding this comment

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

Well I assume that backend should just guarantee that they have unique values? The frontend gets a list I assume, but if you want to allow users to define the order for this, it should work as expected. (Which currently, when we allow duplicate values, it doesn't. I can set something to display in position 2, but if 10 others already have the same value, it might only show up in position 11.

This migration introduces a new table `curated_visualization` to store visualizations associated with projects. It includes necessary columns and constraints to ensure data integrity and relationships with existing tables.
@safoinme safoinme requested a review from schustmi October 23, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request internal To filter out internal PRs and issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deployment details: Show custom visualizations

3 participants