Repository navigation
feat(dynatrace): migrate plugin from Material-UI to Backstage UI - #11607
deepthi-28 wants to merge 4 commits into
Conversation
6aad430 to
97527c8
Compare
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
AmbrishRamachandiran
left a comment
There was a problem hiding this comment.
Thanks for the migration @deepthi-28! This is a clean, complete migration: there are no @material-ui imports left in the plugin, @material-ui/core is gone from package.json, and the mocked DynatraceApi and entity in the dev app make it easy to check locally.
A few things before this can go in:
- Merge conflicts: the branch is about 290 commits behind
mainand GitHub reports conflicts. Since it was opened,mainhas bumped this workspace to Backstage v1.56.2 (#11832, which now resolves@backstage/[email protected]) and migrated it to Jest 30 (#11987). Could you rebase on the latestmainand resolve the conflicts? Foryarn.lock, it's usually easiest to takemain's version and re-runyarn installinworkspaces/dynatracerather than hand-merging it. Please check that tests still pass with Jest 30 afterwards. - Peer dependencies: these need to be narrowed to match
@backstage/ui(see inline). - Changeset: use the standard BREAKING wording used by the other migrations.
- Two smaller inline notes.
Could you also link the tracking issue #7869 in the PR description, and use a conventional title (e.g. feat(dynatrace): migrate plugin from Material-UI to Backstage UI), as in your codescene and gcalendar PRs?
| '@backstage-community/plugin-dynatrace': minor | ||
| --- | ||
|
|
||
| Migrated the Dynatrace plugin from Material-UI to Backstage UI. |
There was a problem hiding this comment.
Could we use the same wording as the other BUI migrations? Adopters now need Backstage UI and its stylesheet installed:
| Migrated the Dynatrace plugin from Material-UI to Backstage UI. | |
| **BREAKING** Migrated from Material UI (MUI) to Backstage UI (BUI). This means that Backstage UI is now a requirement for this plugin, see the Backstage UI [installation documentation](https://ui.backstage.io/get-started/installation) for more details. |
minor has been accepted for pre-1.0 plugins on recent migrations, so I'll leave the bump level to the maintainers.
There was a problem hiding this comment.
Addressed in the latest commits on this branch (6e3efb9 and follow-up).
| "@backstage/frontend-plugin-api": "backstage:^", | ||
| "@backstage/plugin-catalog-react": "backstage:^", | ||
| "@material-ui/core": "^4.12.2", | ||
| "@backstage/ui": "backstage:^", |
There was a problem hiding this comment.
@backstage/ui (0.18.0 on this branch, 0.19.0 on main after the v1.56.2 bump) declares peer dependencies react ^18.0.0, react-dom ^18.0.0, react-router-dom ^6.30.2 and @types/react ^18.0.0. This package still advertises ^16.13.1 || ^17.0.0 || ^18.0.0 and 6.0.0-beta.0 || ^6.3.0 in peerDependencies/devDependencies, and the same wide @types/react range, so a React 17 app could install it and end up with unmet peers. Could you narrow them, as was requested on the firehydrant migration?
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.30.2"and "@types/react": "^18.0.0".
There was a problem hiding this comment.
Addressed in the latest commits on this branch (6e3efb9 and follow-up).
| <TagGroup aria-label={`Synthetic location ${value?.name}`}> | ||
| <Tag | ||
| size="medium" | ||
| style={{ backgroundColor: chipColor(lastFailedTimestamp) }} |
There was a problem hiding this comment.
chipColor still returns hard-coded CSS colour names (salmon, sandybrown, palegoldenrod, lightgreen) applied inline. Now that this is a BUI Tag, its text uses the BUI foreground token. In the dark theme that's a light colour on a light pastel background, so the location name becomes hard to read. Reviewers have also asked to use BUI tokens over hard-coded values in other migrations.
Could this map to status tokens through a small CSS module instead? For example:
.failedLastHour { background-color: var(--bui-negative-bg-subdued); color: var(--bui-negative-fg-subdued); }
.failedLast6Hours { background-color: var(--bui-warning-bg-subdued); color: var(--bui-warning-fg-subdued); }
.failedLast24Hours{ background-color: var(--bui-warning-bg-subdued); color: var(--bui-warning-fg-subdued); }
.healthy { background-color: var(--bui-positive-bg-subdued); color: var(--bui-positive-fg-subdued); }with chipColor returning a className. Distinguishing 1h from 6h is up to you, e.g. solid --bui-negative-bg for the most recent failures.
There was a problem hiding this comment.
Addressed in the latest commits on this branch (6e3efb9 and follow-up).
| import { dynatraceApiRef } from '../src/api'; | ||
| import type { DynatraceApi } from '../src/api/DynatraceApi'; | ||
| // eslint-disable-next-line @backstage/no-ui-css-imports-in-non-frontend | ||
| import '@backstage/ui/css/styles.css'; |
There was a problem hiding this comment.
Nit: I think this import (and the eslint-disable above it) isn't needed. createDevApp from @backstage/dev-utils already lazy-loads @backstage/ui/css/styles.css (dist/devApp/BuiCss.esm.js), and the repo's mui-to-bui-migration skill says to skip the import for createDevApp workspaces.
There was a problem hiding this comment.
Addressed in the latest commits on this branch (6e3efb9 and follow-up).
There was a problem hiding this comment.
🟡 Changes recommended
A clean dev launch throws because the mock lacks dynatrace.baseUrl, and the required consumer stylesheet setup is undocumented.
2 open issues
What changed in this PR
Migrates Dynatrace’s layout and synthetic-location badges from Material-UI to Backstage UI, supporting the community-wide migration tracked in #7869.
Changes:
- Replaces Material-UI grids and chips with Backstage UI components.
- Adds a sample entity and mocked Dynatrace responses to the development page.
- Updates dependencies, development stylesheet loading, and release metadata.
| File | Description |
|---|---|
workspaces/dynatrace/yarn.lock |
Records the direct Backstage UI dependency. |
workspaces/dynatrace/plugins/dynatrace/src/components/Synthetics/SyntheticsLocation/SyntheticsLocation.tsx |
Replaces location chips with tags and tag groups. |
workspaces/dynatrace/plugins/dynatrace/src/components/DynatraceTab/DynatraceTab.tsx |
Uses Backstage UI grids for monitoring cards. |
workspaces/dynatrace/plugins/dynatrace/package.json |
Replaces the direct Material-UI dependency with Backstage UI. |
workspaces/dynatrace/plugins/dynatrace/dev/index.tsx |
Adds mock data, entity context, and stylesheet loading. |
workspaces/dynatrace/.changeset/dynatrace-mui-to-bui.md |
Adds a minor-release migration note. |
Review effort: Balanced
| .addPage({ | ||
| element: <DynatraceTab />, | ||
| element: ( | ||
| <TestApiProvider apis={[[dynatraceApiRef, mockDynatraceApi]]}> |
There was a problem hiding this comment.
Addressed in the latest commits on this branch (6e3efb9 and follow-up).
| '@backstage-community/plugin-dynatrace': minor | ||
| --- | ||
|
|
||
| Migrated the Dynatrace plugin from Material-UI to Backstage UI. |
There was a problem hiding this comment.
Addressed in the latest commits on this branch (6e3efb9 and follow-up).
Replace MUI Grid with BUI Grid.Root/Grid.Item and MUI Chip with BUI Tag wrapped in TagGroup. Drop the @material-ui/core dependency and add @backstage/ui. Wire an EntityProvider and a mock Dynatrace API into the dev app so the plugin can be previewed locally without a backend. Signed-off-by: deepthi-ajith_infosys <[email protected]>
97527c8 to
9960f24
Compare
| "@backstage/ui": "backstage:^", | ||
| "@material-ui/core": "^4.12.2", | ||
| "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0", | ||
| "@types/react": "^18.0.0", |
There was a problem hiding this comment.
Addressed in the latest commits on this branch (6e3efb9 and follow-up).
awanlin
left a comment
There was a problem hiding this comment.
Thanks for the contribution @deepthi-28 and for following up on @AmbrishRamachandiran's feedback.
There's a CI error that needs to be address. The Copilot comments need to be followed up on as well.
@AmbrishRamachandiran, thanks for the review, appreciate the initial set of eyes on this 🙏
Co-authored-by: Copilot <[email protected]> Signed-off-by: deepthi-ajith_infosys <[email protected]>
|
Feedback addressed (6a26549):
@AmbrishRamachandiran @awanlin could you please re-review? |
Co-authored-by: Copilot <[email protected]> Signed-off-by: deepthi-ajith_infosys <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: deepthi-ajith_infosys <[email protected]>
AmbrishRamachandiran
left a comment
There was a problem hiding this comment.
Thanks for the updates. The rebase, peer deps, changeset wording and the tag colours are all sorted, and CI is green now. LGTM.
cc @awanlin @backstage/community-plugins-maintainers
There was a problem hiding this comment.
🟡 Changes recommended
The minor changeset would ship breaking React and router peer requirements within ^10.25.0, so a major release is needed to prevent incompatible updates for existing consumers.
4 open issues
1 resolved since last review
Review effort: Balanced
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@backstage-community/plugin-dynatrace': minor | |||



Hey, I just made a Pull Request!
Migrates the Dynatrace plugin from Material-UI to Backstage UI.
Signed-off-byline in the message. (more info)Tracking issue: #7869