Skip to content

fix(scorecard): Add a view data source menu on homepage sparkline card - #4877

Merged
Eswaraiahsapram merged 2 commits into
redhat-developer:mainfrom
Eswaraiahsapram:feat/scorecard-homepage-sparkline-data-sources-ui
Sep 21, 2026
Merged

Eswaraiahsapram merged 2 commits into
redhat-developer:mainfrom
Eswaraiahsapram:feat/scorecard-homepage-sparkline-data-sources-ui

Conversation

@Eswaraiahsapram

@Eswaraiahsapram Eswaraiahsapram commented Sep 19, 2026

Copy link
Copy Markdown
Member

Hey, I just made a Pull Request!

Fix - https://redhat.atlassian.net/browse/RHIDP-17125

Follow-up to #4596. Homepage sparkline cards were missing View data sources; the entity sparkline already had it.

What

Adds a View data sources kebab on homepage sparkline cards, next to the last-updated info button. Collectors load when the dialog opens. Homepage and entity sparklines now share SparklineDataSources / useSparklineDataSources.

Screenshots

Screenshot 2026-09-21 at 10 45 46 AM Screenshot 2026-09-21 at 10 47 03 AM Screenshot 2026-09-21 at 10 47 54 AM

What changed

  • AggregatedSparklineCard — last-updated (i) plus View data sources menu (hidden on drill-down via showInfo={false}).
  • SparklineDataSources / useSparklineDataSources — shared menu, collector fetch, and dialog used by homepage and entity cards.
  • EntitySparklineCard — uses the shared helper; behavior unchanged.
  • formatSparklineDateLabel — shared axis date formatting.

How to test

  1. Add a homepage DORA sparkline card (for example Change Failure Rate or Median Time to Restore).
  2. Confirm the card header shows the last-updated (i) button and the menu.
  3. Open View data sources and confirm collector rows (GitHub / Jira) load.
  4. Open the drill-down page and confirm the sparkline there still has no (i) / .
  5. On the entity Scorecard tab, confirm View data sources still works.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

@rhdh-gh-app

rhdh-gh-app Bot commented Sep 19, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-scorecard workspaces/scorecard/plugins/scorecard patch v4.3.1

@codecov

codecov Bot commented Sep 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.82%. Comparing base (6ab3fc3) to head (fe77560).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4877   +/-   ##
=======================================
  Coverage   63.81%   63.82%           
=======================================
  Files        2698     2700    +2     
  Lines      107951   107973   +22     
  Branches    30265    30268    +3     
=======================================
+ Hits        68887    68911   +24     
+ Misses      38546    38545    -1     
+ Partials      518      517    -1     
Flag Coverage Δ *Carryforward flag
adoption-insights 84.77% <ø> (ø) Carriedforward from 6ab3fc3
ai-integrations 84.34% <ø> (ø) Carriedforward from 6ab3fc3
app-defaults 63.63% <ø> (ø) Carriedforward from 6ab3fc3
augment 46.67% <ø> (ø) Carriedforward from 6ab3fc3
boost 84.97% <ø> (ø) Carriedforward from 6ab3fc3
bulk-import 73.12% <ø> (ø) Carriedforward from 6ab3fc3
cost-management 13.53% <ø> (ø) Carriedforward from 6ab3fc3
dcm 73.47% <ø> (ø) Carriedforward from 6ab3fc3
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from 6ab3fc3
e2e-extensions 62.31% <ø> (ø) Carriedforward from 6ab3fc3
e2e-global-header 51.82% <ø> (ø) Carriedforward from 6ab3fc3
e2e-homepage 61.11% <ø> (ø) Carriedforward from 6ab3fc3
e2e-intelligent-assistant 46.01% <ø> (ø) Carriedforward from 6ab3fc3
e2e-orchestrator 49.49% <ø> (ø) Carriedforward from 6ab3fc3
e2e-orchestrator-plugin 49.48% <ø> (ø) Carriedforward from 6ab3fc3
e2e-quickstart 55.21% <ø> (ø) Carriedforward from 6ab3fc3
e2e-scorecard 49.77% <ø> (-0.06%) ⬇️ Carriedforward from 6ab3fc3
e2e-theme 16.36% <ø> (ø) Carriedforward from 6ab3fc3
extensions 58.30% <ø> (ø) Carriedforward from 6ab3fc3
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 6ab3fc3
global-header 67.76% <ø> (ø) Carriedforward from 6ab3fc3
homepage 55.05% <ø> (ø) Carriedforward from 6ab3fc3
install-dynamic-plugins 73.52% <ø> (ø) Carriedforward from 6ab3fc3
intelligent-assistant 78.04% <ø> (ø) Carriedforward from 6ab3fc3
konflux 91.98% <ø> (ø) Carriedforward from 6ab3fc3
lightspeed 69.02% <ø> (ø) Carriedforward from 6ab3fc3
mcp-integrations 84.46% <ø> (ø) Carriedforward from 6ab3fc3
orchestrator 77.69% <ø> (ø) Carriedforward from 6ab3fc3
quickstart 63.74% <ø> (ø) Carriedforward from 6ab3fc3
sandbox 79.56% <ø> (ø) Carriedforward from 6ab3fc3
scorecard 88.96% <95.00%> (+0.05%) ⬆️
theme 87.94% <ø> (ø) Carriedforward from 6ab3fc3
translations 5.12% <ø> (ø) Carriedforward from 6ab3fc3
x2a 78.44% <ø> (ø) Carriedforward from 6ab3fc3

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ab3fc3...fe77560. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Eswaraiahsapram
Eswaraiahsapram force-pushed the feat/scorecard-homepage-sparkline-data-sources-ui branch from 3c32b6e to fe77560 Compare September 21, 2026 05:10
@sonarqubecloud

Copy link
Copy Markdown

@dzemanov dzemanov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would like to point out that not all metrics with visualization: sparkline have collectors in View datasources - only metrics that are composite (like DORA). Non-composite metrics should show metric description. You can see it in the design:

Screen.Recording.2026-09-21.at.11.48.51.mov

Currently, there is no way to set visualization to a different type then the default type, and we have only DORA metric (that is composite). But, in future with CRUD, users can configure visualization type (so for example github.openPRs can be shown as 30 days trend). Furthermore, even now, users can contribute their own metrics and they can set defaultVisualization to sparkline, which would mean, View datasources is showing nothing for them (same for the entity page).

You can test it out by setting defaultVisualization for GithubOpenPrsProvider to sparkline and updating openPrsKpi from statusGrouped to type: average.

Design also shows that View datasources should be shown in all scorecards (homepage and entity page), not only sparkline scorecards. It can be fixed as a bug.
We have discussed this in slack.
Adding metric description above collector description for View datasources entity and homepage is also to be worked upon as a separate bug. Translation of collectors description as well. I will create those tickets now to not forget.

I have tested that for composite metrics, VIew datasources works correctly:
(at the end, there is shown the bug for non-composite metric with sparkline.

Screen.Recording.2026-09-21.at.11.36.27.mov

Translation + no View datasources dialog in drill down:

Screen.Recording.2026-09-21.at.11.39.15.mov

@dzemanov

Copy link
Copy Markdown
Member

@Eswaraiahsapram
Eswaraiahsapram merged commit 73e2c67 into redhat-developer:main Sep 21, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants