Skip to content

chore(bulk-import): bump Backstage dependencies to 1.52.0#3896

Open
lokanandaprabhu wants to merge 2 commits into
redhat-developer:mainfrom
lokanandaprabhu:bulk-import/v1.52.0
Open

chore(bulk-import): bump Backstage dependencies to 1.52.0#3896
lokanandaprabhu wants to merge 2 commits into
redhat-developer:mainfrom
lokanandaprabhu:bulk-import/v1.52.0

Conversation

@lokanandaprabhu

Copy link
Copy Markdown
Member

Summary

  • Bump all @backstage/* packages to Backstage 1.52.0 versions
  • Update resolutions in workspace package.json to match 1.52.0 package versions (was pinned to pre-1.52.0 versions, blocking correct resolution)

Regression fixes included

  • NavItemBlueprint removal: Migrated from NavItemBlueprint to PageBlueprint icon/title params (NavItemBlueprint removed in @backstage/frontend-plugin-api@0.17.0)
  • Sidebar navItems migration: Switched from deprecated items prop to navItems API in NavContentBlueprint
  • catalogServiceRef moved: Import changed from @backstage/plugin-catalog-node/alpha to @backstage/plugin-catalog-node (moved in 2.2.x)
  • CatalogService vs CatalogApi incompatibility: Replaced catalogServiceRef dependency with direct CatalogClient instantiation in plugin init, since the new CatalogService type requires credentials instead of token and is incompatible with the existing CatalogApi-based code
  • catalog-client moved to dependencies: @backstage/catalog-client moved from devDependencies to dependencies since it's now used directly in plugin.ts
  • API reports regenerated: Updated report-alpha.api.md to reflect the NavItemBlueprint removal

Test plan

  • yarn tsc passes
  • Dev server starts successfully (yarn start)
  • Bulk import UI loads and functions correctly
  • CI checks pass

🤖 Generated with Claude Code

Upgrade all @backstage/* packages to the versions shipped with
Backstage 1.52.0. Includes regression fixes:

- Migrate NavItemBlueprint → PageBlueprint icon/title params
  (NavItemBlueprint removed in frontend-plugin-api 0.17.0)
- Migrate Sidebar from deprecated `items` to `navItems` API
- Move catalogServiceRef import from /alpha to main entry point
  (moved in plugin-catalog-node 2.2.x)
- Replace catalogServiceRef with CatalogClient in plugin init
  (CatalogService type is incompatible with CatalogApi)
- Update resolutions in package.json to match 1.52.0 versions
- Regenerate API reports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Jul 21, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
app-legacy workspaces/bulk-import/packages/app-legacy none v0.0.3
app workspaces/bulk-import/packages/app none v0.0.1
backend workspaces/bulk-import/packages/backend none v0.0.0
@red-hat-developer-hub/backstage-plugin-bulk-import-backend workspaces/bulk-import/plugins/bulk-import-backend minor v7.3.7
@red-hat-developer-hub/backstage-plugin-bulk-import-common workspaces/bulk-import/plugins/bulk-import-common minor v7.3.7
@red-hat-developer-hub/backstage-plugin-bulk-import workspaces/bulk-import/plugins/bulk-import minor v7.3.7

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.59%. Comparing base (f8f09d1) to head (363ec8f).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3896   +/-   ##
=======================================
  Coverage   56.59%   56.59%           
=======================================
  Files        2372     2372           
  Lines       95021    95021           
  Branches    26591    26576   -15     
=======================================
  Hits        53777    53777           
  Misses      39700    39700           
  Partials     1544     1544           
Flag Coverage Δ *Carryforward flag
adoption-insights 84.54% <ø> (ø) Carriedforward from 11e4f98
ai-integrations 69.26% <ø> (ø) Carriedforward from 11e4f98
app-defaults 69.79% <ø> (ø) Carriedforward from 11e4f98
augment 46.67% <ø> (ø) Carriedforward from 11e4f98
boost 75.27% <ø> (ø) Carriedforward from 11e4f98
bulk-import 72.59% <ø> (ø)
cost-management 13.55% <ø> (ø) Carriedforward from 11e4f98
dcm 60.72% <ø> (ø) Carriedforward from 11e4f98
extensions 56.18% <ø> (ø) Carriedforward from 11e4f98
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 11e4f98
global-header 62.19% <ø> (ø) Carriedforward from 11e4f98
homepage 47.58% <ø> (ø) Carriedforward from 11e4f98
install-dynamic-plugins 56.77% <ø> (ø) Carriedforward from 11e4f98
intelligent-assistant 69.50% <ø> (ø) Carriedforward from 11e4f98
konflux 91.98% <ø> (ø) Carriedforward from 11e4f98
lightspeed 69.02% <ø> (ø) Carriedforward from 11e4f98
mcp-integrations 83.40% <ø> (ø) Carriedforward from 11e4f98
orchestrator 57.01% <ø> (ø) Carriedforward from 11e4f98
quickstart 65.11% <ø> (ø) Carriedforward from 11e4f98
sandbox 79.56% <ø> (ø) Carriedforward from 11e4f98
scorecard 82.66% <ø> (ø) Carriedforward from 11e4f98
theme 83.85% <ø> (ø) Carriedforward from 11e4f98
translations 5.15% <ø> (ø) Carriedforward from 11e4f98
x2a 79.31% <ø> (ø) Carriedforward from 11e4f98

*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 f8f09d1...363ec8f. 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.

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Jul 21, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 11 rules
✅ Cross-repo context
  Explored: repo: redhat-developer/rhdh (sha: 5992bddd)
  Explored: repo: redhat-developer/rhdh-local (sha: 48b26cbd)
  Not relevant to this PR: redhat-developer/rhdh-chart
  Not relevant to this PR: redhat-developer/rhdh-operator

Grey Divider


Action required

1. Catalog mock ignored in tests ✓ Resolved 🐞 Bug ☼ Reliability
Description
startBackendServer now ignores the mockCatalogClient passed by tests and no longer registers a
service factory for it, while tests still stub/assert
mockCatalogClient.queryEntities/addLocation expecting the backend router to use those mocks.
This will make those tests fail (assertions won’t match) or behave unpredictably because the backend
will instead use a real CatalogClient instance.
Code

workspaces/bulk-import/plugins/bulk-import-backend/fixtures/testUtils.ts[R168-172]

export async function startBackendServer(
-  mockCatalogClient: CatalogClient,
+  _mockCatalogClient: CatalogClient,
  authorizeResult?: AuthorizeResult.DENY | AuthorizeResult.ALLOW,
  config?: any,
  db?: any,
Relevance

⭐⭐⭐ High

Team frequently accepts test/reliability fixes; similar backend changes updated mocks/fixtures to
match runtime behavior (e.g., catalog locations).

PR-#2465

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fixture now marks the catalog client argument as intentionally unused and removes the previous
service factory registration, while existing tests still stub methods on the provided mock client
expecting those stubs to be used during request handling.

workspaces/bulk-import/plugins/bulk-import-backend/fixtures/testUtils.ts[168-191]
workspaces/bulk-import/plugins/bulk-import-backend/src/service/handlers/import/imports.test.ts[40-57]
workspaces/bulk-import/plugins/bulk-import-backend/src/service/handlers/import/imports-gitlab.test.ts[53-100]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`startBackendServer` no longer injects the provided `mockCatalogClient` into the backend plugin, but many tests still pass `mockCatalogClient` and stub its methods expecting the router to call them. Since the plugin now constructs its own `CatalogClient`, those stubs/assertions no longer apply.

### Issue Context
- The backend plugin constructs `catalogApi` internally using `new CatalogClient({ discoveryApi: discovery })`.
- The test helper still accepts a `mockCatalogClient` but does not connect it to the plugin runtime.
- Multiple tests mutate `mockCatalogClient` methods (e.g. `queryEntities`, `addLocation`) expecting them to drive behavior.

### Fix Focus Areas
Choose one consistent approach and update both the fixture + tests:

**Option A (recommended, minimal): switch tests to mock the real `CatalogClient` used by the plugin**
- Use `jest.spyOn(CatalogClient.prototype, 'queryEntities')`, `jest.spyOn(CatalogClient.prototype, 'addLocation')`, etc., in the tests that currently mutate `mockCatalogClient`.
- Remove the unused `mockCatalogClient` parameter from `startBackendServer` and stop creating the unused mock object in `setupTest`.

**Option B: mock at HTTP layer**
- Add MSW handlers for the Catalog endpoints that `CatalogClient` calls (e.g. entity queries/locations) and remove `mockCatalogClient`-based stubbing.

Fix focus code locations:
- workspaces/bulk-import/plugins/bulk-import-backend/__fixtures__/testUtils.ts[168-191]
- workspaces/bulk-import/plugins/bulk-import-backend/src/service/handlers/import/imports.test.ts[40-57]
- workspaces/bulk-import/plugins/bulk-import-backend/src/service/handlers/import/imports-gitlab.test.ts[53-100]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. RHDH wrappers pinned bulk-import 🔗 Cross-repo conflict ☼ Reliability
Description
This PR publishes new minor versions for the bulk-import plugin packages, but redhat-developer/rhdh
dynamic-plugin wrapper packages are pinned to
@red-hat-developer-hub/backstage-plugin-bulk-import@7.3.5 and
@red-hat-developer-hub/backstage-plugin-bulk-import-backend@7.3.5, so rhdh will keep consuming the
older artifacts until it updates those wrapper dependencies. Coordinate a follow-up PR in rhdh to
bump the wrapper package dependencies (and lockfiles) to the new released versions from this PR.
Code

workspaces/bulk-import/.changeset/version-bump-1-52-0.md[R1-4]

+---
+'@red-hat-developer-hub/backstage-plugin-bulk-import': minor
+'@red-hat-developer-hub/backstage-plugin-bulk-import-backend': minor
+'@red-hat-developer-hub/backstage-plugin-bulk-import-common': minor
Relevance

⭐⭐ Medium

No historical evidence on coordinating downstream rhdh wrapper bumps; cross-repo dependency notes
not seen in past reviews.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR introduces a Changesets entry that will publish new minor versions of the bulk-import
packages. In redhat-developer/rhdh, the dynamic-plugin wrapper packages declare exact dependencies
on bulk-import version 7.3.5, so they will not consume the newly published versions until those
dependencies are bumped in rhdh.

workspaces/bulk-import/.changeset/version-bump-1-52-0.md[1-4]
External repo: redhat-developer/rhdh, dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json [44-47]
External repo: redhat-developer/rhdh, dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json [41-43]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
This repo is releasing new minor versions of bulk-import packages, but `redhat-developer/rhdh` wrapper packages pin exact bulk-import versions (`7.3.5`). Without a coordinated bump in `rhdh`, the RHDH dynamic-plugin distributions will continue embedding/depending on the older bulk-import packages and won’t pick up the Backstage 1.52.0-related changes from this release.

## Issue Context
- The changeset in this PR will produce a new published version for:
 - `@red-hat-developer-hub/backstage-plugin-bulk-import`
 - `@red-hat-developer-hub/backstage-plugin-bulk-import-backend`
 - `@red-hat-developer-hub/backstage-plugin-bulk-import-common`
- In `rhdh`, the dynamic-plugin wrapper packages depend on exact versions of the bulk-import packages.

## Fix Focus Areas
- workspaces/bulk-import/.changeset/version-bump-1-52-0.md[1-4]
- /cross_repos/rhdh/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import/package.json[44-47]
- /cross_repos/rhdh/dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic/package.json[41-43]

## Suggested fix steps (in rhdh repo)
1. After this PR is released, update the wrapper dependencies to the newly published bulk-import versions.
2. Regenerate/update the relevant lockfiles (`yarn.lock` under `dynamic-plugins/` if applicable).
3. Re-run the wrapper export/build pipeline for the dynamic plugins (the wrapper `export-dynamic` scripts) and validate that the updated plugins load and run.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@rhdh-qodo-merge

Copy link
Copy Markdown

PR Summary by Qodo

chore(bulk-import): bump Backstage dependencies to 1.52.0

⚙️ Configuration changes ✨ Enhancement 🕐 40+ Minutes

Grey Divider

AI Description

• Bump Bulk Import workspace to Backstage 1.52.0 across apps, plugins, and backend.
• Migrate deprecated frontend extension/nav APIs removed in newer Backstage packages.
• Update backend catalog integration to use CatalogClient and align workspace resolutions.
Diagram

graph TD
  A["Root package.json"] --> B{{"Backstage 1.52"}} --> C["App/Plugin deps"] --> D(["Frontend plugin"]) --> E(["Sidebar nav"])
  C --> F(["Backend plugin"]) --> G{{"Catalog API"}}
  D --> B
  F --> B
  subgraph Legend
    direction LR
    _file["File"] ~~~ _mod(["Runtime module"]) ~~~ _ext{{"Backstage/API"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Migrate fully to CatalogService (service ref) instead of CatalogClient
  • ➕ Aligns with Backstage’s newer backend service model (credentials-based auth)
  • ➕ Easier to swap/mock via DI once fully adopted
  • ➖ Requires refactoring router/plugin code to the new CatalogService interface
  • ➖ Higher risk/effort for what is primarily a version bump PR
2. Provide a small adapter shim (CatalogService -> CatalogApi)
  • ➕ Keeps existing router code mostly unchanged
  • ➕ Allows continued use of injected service refs while bridging API mismatch
  • ➖ Adds maintenance burden and type surface area
  • ➖ May hide auth/credential semantics that should be handled explicitly

Recommendation: The PR’s approach (direct CatalogClient instantiation) is a pragmatic compatibility move to unblock the Backstage 1.52 bump with minimal backend refactor. Consider a follow-up to adopt CatalogService end-to-end once the plugin is ready to handle credentials-based auth, removing the need for a client-side workaround.

Files changed (14) +185 / -234

Bug fix (1) +2 / -3
plugin.tsReplace catalogServiceRef injection with direct CatalogClient construction +2/-3

Replace catalogServiceRef injection with direct CatalogClient construction

• Stops wiring catalogServiceRef via backend DI and instead instantiates CatalogClient using discovery, avoiding type incompatibilities introduced by newer CatalogService auth semantics.

workspaces/bulk-import/plugins/bulk-import-backend/src/plugin.ts

Refactor (2) +11 / -35
Sidebar.tsxMigrate Sidebar nav to NavContentBlueprint navItems API +8/-3

Migrate Sidebar nav to NavContentBlueprint navItems API

• Replaces deprecated 'items' usage with 'navItems.rest()' and updates SidebarItem props to the newer nav item shape (href/title/icon).

workspaces/bulk-import/packages/app/src/modules/nav/Sidebar.tsx

alpha.tsxRemove NavItemBlueprint extension; move title/icon to PageBlueprint params +3/-32

Remove NavItemBlueprint extension; move title/icon to PageBlueprint params

• Eliminates NavItemBlueprint usage (removed upstream) and configures the bulk import page’s title/icon directly on the PageBlueprint definition.

workspaces/bulk-import/plugins/bulk-import/src/alpha.tsx

Tests (1) +2 / -11
testUtils.tsRemove catalogServiceRef test wiring incompatible with new catalog service types +2/-11

Remove catalogServiceRef test wiring incompatible with new catalog service types

• Drops the service factory override for catalogServiceRef and cleans up imports, reflecting the switch away from catalog service injection in this plugin path.

workspaces/bulk-import/plugins/bulk-import-backend/fixtures/testUtils.ts

Documentation (1) +1 / -23
report-alpha.api.mdRegenerate alpha API report after NavItemBlueprint removal +1/-23

Regenerate alpha API report after NavItemBlueprint removal

• Updates generated API documentation to reflect removal of nav-item extension typing and related frontend-plugin-api symbol changes.

workspaces/bulk-import/plugins/bulk-import/report-alpha.api.md

Other (9) +169 / -162
version-bump-1-52-0.mdAdd changeset for Backstage 1.52.0 bump +7/-0

Add changeset for Backstage 1.52.0 bump

• Introduces a Changesets entry to publish minor releases of the bulk-import packages due to the Backstage version upgrade.

workspaces/bulk-import/.changeset/version-bump-1-52-0.md

backstage.jsonBump Backstage framework version to 1.52.0 +1/-1

Bump Backstage framework version to 1.52.0

• Updates the workspace Backstage version metadata from 1.49.3 to 1.52.0.

workspaces/bulk-import/backstage.json

package.jsonUpdate workspace resolutions/pins to Backstage 1.52.0 package set +25/-25

Update workspace resolutions/pins to Backstage 1.52.0 package set

• Bumps Backstage tooling versions and updates pinned package versions to the Backstage 1.52.0-compatible releases, unblocking correct dependency resolution.

workspaces/bulk-import/package.json

package.jsonBump legacy app dependencies to Backstage 1.52.0-compatible versions +30/-30

Bump legacy app dependencies to Backstage 1.52.0-compatible versions

• Updates Backstage frontend package versions and related dev tooling for the legacy app build.

workspaces/bulk-import/packages/app-legacy/package.json

package.jsonBump app dependencies to Backstage 1.52.0-compatible versions +34/-34

Bump app dependencies to Backstage 1.52.0-compatible versions

• Updates Backstage frontend dependencies (including frontend-plugin-api) and dev tooling to versions compatible with Backstage 1.52.0.

workspaces/bulk-import/packages/app/package.json

package.jsonBump backend app dependencies to Backstage 1.52.0-compatible versions +38/-38

Bump backend app dependencies to Backstage 1.52.0-compatible versions

• Updates Backstage backend packages and test tooling versions to match the upgraded Backstage baseline.

workspaces/bulk-import/packages/backend/package.json

package.jsonPromote @backstage/catalog-client to runtime dependency and bump backend plugin deps +14/-14

Promote @backstage/catalog-client to runtime dependency and bump backend plugin deps

• Updates Backstage backend plugin dependencies to 1.52.0-compatible versions and moves catalog-client into dependencies since it is now used by plugin runtime code.

workspaces/bulk-import/plugins/bulk-import-backend/package.json

package.jsonAlign bulk-import-common permission-common versions with Backstage 1.52.0 +3/-3

Align bulk-import-common permission-common versions with Backstage 1.52.0

• Bumps Backstage CLI and permission-common versions, including peer dependency alignment.

workspaces/bulk-import/plugins/bulk-import-common/package.json

package.jsonBump bulk-import frontend plugin dependencies to Backstage 1.52.0-compatible versions +17/-17

Bump bulk-import frontend plugin dependencies to Backstage 1.52.0-compatible versions

• Updates frontend plugin Backstage dependencies and dev tooling versions to match the upgraded workspace baseline.

workspaces/bulk-import/plugins/bulk-import/package.json

@rhdh-qodo-merge rhdh-qodo-merge Bot added documentation Improvements or additions to documentation enhancement New feature or request Bug fix labels Jul 21, 2026
The new catalogServiceRef returns DefaultCatalogService which requires
credentials-based options, incompatible with the existing CatalogApi
token-based call sites. Override the default factory in the backend to
return a CatalogClient instead, keeping tests working via their existing
mock injection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug fix documentation Improvements or additions to documentation enhancement New feature or request workspace/bulk-import

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant