Skip to content

fix(x2a): shorten scaffolder module package name for 63-char catalog limit - #4226

Open
mareklibra wants to merge 1 commit into
redhat-developer:mainfrom
mareklibra:FLPATH-4576.shorten.x2a.module.package.name
Open

fix(x2a): shorten scaffolder module package name for 63-char catalog limit#4226
mareklibra wants to merge 1 commit into
redhat-developer:mainfrom
mareklibra:FLPATH-4576.shorten.x2a.module.package.name

Conversation

@mareklibra

@mareklibra mareklibra commented Aug 10, 2026

Copy link
Copy Markdown
Member

Rename to @red-hat-developer-hub/backstage-plugin-x2a-scaffolder-module so the flattened dynamic-plugin/catalog name fits Backstage ADR002 (FLPATH-4576).


After merge and publishing the NPM package with a new name (post-Version Package PR):

…limit

Rename to @red-hat-developer-hub/backstage-plugin-x2a-scaffolder-module so
the flattened dynamic-plugin/catalog name fits Backstage ADR002 (FLPATH-4576).

Signed-off-by: Marek Libra <marek.libra@gmail.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 10, 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
backend workspaces/x2a/packages/backend none v0.0.0
@red-hat-developer-hub/backstage-plugin-x2a-scaffolder-module workspaces/x2a/plugins/scaffolder-backend-module-x2a major v1.0.0

@sonarqubecloud

Copy link
Copy Markdown

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Aug 10, 2026

Copy link
Copy Markdown

PR Summary by Qodo

Shorten x2a scaffolder module package name to meet Backstage 63-char catalog limit

🐞 Bug fix 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Rename the x2a scaffolder backend module npm package to fit Backstage ADR002 63-char
 metadata.name limit.
• Update backend wiring and build/export scripts to reference the new package/image folder name.
• Document migration steps and publish a major changeset for the breaking rename.
Diagram

graph TD
  A([RHDH backend]) --> B([x2a scaffolder module])
  B --> C["build-dynamic-plugins.sh"] --> D([OCI image / folder name])
  B --> E["export-to-rhdh-repo.js"] --> F([Exported overlay artifacts])
  B --> G[".changeset (major bump)"]
  B --> H["Docs (README/AGENTS)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Add an explicit catalog/dynamic-plugin name override (no npm rename)
  • ➕ Avoids breaking change for npm consumers
  • ➕ Reduces downstream churn in imports and dependency declarations
  • ➖ May conflict with/undermine ADR002 expectations (name derived from npm)
  • ➖ Requires non-standard tooling/config support and ongoing maintenance
  • ➖ Risk of inconsistent naming across build/export paths and catalog entities
2. Publish new package name but keep the old package as a compatibility wrapper
  • ➕ Provides a smoother migration path (old name keeps working short-term)
  • ➕ Allows deprecation messaging and phased rollout
  • ➖ Adds maintenance and release complexity (dual packages)
  • ➖ Potential for confusion over which package to depend on long-term
3. Shorten via scoped rename only in exported artifacts (truncate/alias folder name)
  • ➕ Minimizes npm-facing change
  • ➕ Targets the 63-char limit symptom directly
  • ➖ Introduces aliasing/truncation logic with collision risk
  • ➖ Makes artifact naming less predictable and harder to debug
  • ➖ Still requires coordinated updates across tooling and downstream configs

Recommendation: Proceed with the PR’s approach (rename the npm package) because it keeps the naming scheme consistent with ADR002 and ensures the flattened catalog/artifact name stays within the 63-character limit without special-case overrides. If migration pain is a concern, consider additionally publishing a temporary compatibility wrapper package and deprecating the old name pointing to the new one (as noted in the PR description).

Files changed (12) +53 / -33

Bug fix (1) +1 / -1
index.tsUpdate backend module import to the new scaffolder package name +1/-1

Update backend module import to the new scaffolder package name

• Changes the dynamic import used to register the scaffolder module with the backend to point at the renamed npm package. Keeps backend composition behavior the same, but fixes runtime resolution after the rename.

workspaces/x2a/packages/backend/src/index.ts

Documentation (5) +26 / -12
AGENTS.mdUpdate x2a plugin inventory with new scaffolder module npm name +9/-9

Update x2a plugin inventory with new scaffolder module npm name

• Updates the workspace plugin table to reflect the renamed scaffolder module npm package. Keeps directory naming unchanged while correcting the published package identifier.

workspaces/x2a/AGENTS.md

README.mdDocument dynamic plugin naming and migration for renamed scaffolder module +12/-0

Document dynamic plugin naming and migration for renamed scaffolder module

• Adds a dedicated section explaining how OCI/export folder names are derived from npm names. Provides concrete guidance for updating configs when moving from the old scaffolder module name to the new shortened name.

workspaces/x2a/README.md

CHANGELOG.mdRename changelog header to new package name +1/-1

Rename changelog header to new package name

• Updates the package heading in the changelog to match the new published npm name. No release notes content changes beyond the name.

workspaces/x2a/plugins/scaffolder-backend-module-x2a/CHANGELOG.md

README.mdUpdate plugin README with new package and flattened artifact name +3/-1

Update plugin README with new package and flattened artifact name

• Renames the README title to the new npm package name. Adds the flattened dynamic-plugin/catalog name to make the 63-character constraint explicit for consumers.

workspaces/x2a/plugins/scaffolder-backend-module-x2a/README.md

report.api.mdRefresh API extractor report header for new package name +1/-1

Refresh API extractor report header for new package name

• Updates the API report file header to reflect the renamed package identifier. The report remains a generated artifact with no functional changes implied.

workspaces/x2a/plugins/scaffolder-backend-module-x2a/report.api.md

Other (6) +26 / -20
shorten-x2a-scaffolder-module-name.mdAdd major changeset for scaffolder module package rename +7/-0

Add major changeset for scaffolder module package rename

• Introduces a changeset marking a major bump due to renaming the scaffolder module package. Documents the flattened artifact name change and the consumer migration steps (OCI/image refs and dynamic plugin metadata paths).

workspaces/x2a/.changeset/shorten-x2a-scaffolder-module-name.md

package.jsonSwitch backend dependency to the renamed scaffolder module package +1/-1

Switch backend dependency to the renamed scaffolder module package

• Replaces the old scaffolder backend module workspace dependency with the new package name. Ensures the backend package installs the renamed module from the workspace.

workspaces/x2a/packages/backend/package.json

package.jsonRename scaffolder module package identifier +1/-1

Rename scaffolder module package identifier

• Changes the package.json 'name' field to '@red-hat-developer-hub/backstage-plugin-x2a-scaffolder-module'. This is the core breaking change that shortens the flattened artifact/catalog name.

workspaces/x2a/plugins/scaffolder-backend-module-x2a/package.json

build-dynamic-plugins.shUpdate dynamic plugin image mapping for renamed scaffolder module +2/-2

Update dynamic plugin image mapping for renamed scaffolder module

• Adjusts comments and the plugin-to-image mapping so the scaffolder module builds/publishes under the new flattened image name. Prevents producing artifacts with the old, overlong name.

workspaces/x2a/scripts/build-dynamic-plugins.sh

export-to-rhdh-repo.jsUpdate export target directory for renamed scaffolder module +1/-2

Update export target directory for renamed scaffolder module

• Changes the scaffolder module 'targetDir' to the new flattened folder name derived from the renamed npm package. Keeps export behavior consistent with the new artifact naming.

workspaces/x2a/scripts/export-to-rhdh-repo.js

yarn.lockRegenerate lockfile entries for renamed workspace package +14/-14

Regenerate lockfile entries for renamed workspace package

• Removes the old workspace resolution entry and adds a new one for '@red-hat-developer-hub/backstage-plugin-x2a-scaffolder-module'. Updates backend dependency resolution accordingly.

workspaces/x2a/yarn.lock

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.34%. Comparing base (50e1563) to head (33111c0).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4226   +/-   ##
=======================================
  Coverage   58.34%   58.34%           
=======================================
  Files        2433     2433           
  Lines       96793    96793           
  Branches    26925    26946   +21     
=======================================
  Hits        56470    56470           
+ Misses      38853    38852    -1     
- Partials     1470     1471    +1     
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from 50e1563
ai-integrations 69.16% <ø> (ø) Carriedforward from 50e1563
app-defaults 69.79% <ø> (ø) Carriedforward from 50e1563
augment 46.67% <ø> (ø) Carriedforward from 50e1563
boost 76.77% <ø> (ø) Carriedforward from 50e1563
bulk-import 72.79% <ø> (ø) Carriedforward from 50e1563
cost-management 13.55% <ø> (ø) Carriedforward from 50e1563
dcm 67.21% <ø> (ø) Carriedforward from 50e1563
extensions 56.59% <ø> (ø) Carriedforward from 50e1563
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 50e1563
global-header 66.50% <ø> (ø) Carriedforward from 50e1563
homepage 47.50% <ø> (ø) Carriedforward from 50e1563
install-dynamic-plugins 59.95% <ø> (ø) Carriedforward from 50e1563
intelligent-assistant 75.24% <ø> (ø) Carriedforward from 50e1563
konflux 91.98% <ø> (ø) Carriedforward from 50e1563
lightspeed 69.02% <ø> (ø) Carriedforward from 50e1563
mcp-integrations 83.40% <ø> (ø) Carriedforward from 50e1563
orchestrator 66.91% <ø> (ø) Carriedforward from 50e1563
quickstart 63.74% <ø> (ø) Carriedforward from 50e1563
sandbox 79.56% <ø> (ø) Carriedforward from 50e1563
scorecard 86.23% <ø> (ø) Carriedforward from 50e1563
theme 88.77% <ø> (ø) Carriedforward from 50e1563
translations 5.12% <ø> (ø) Carriedforward from 50e1563
x2a 79.20% <ø> (ø)

*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 50e1563...33111c0. 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 Aug 10, 2026

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Missing header in build script 📘 Rule violation § Compliance
Description
The modified script workspaces/x2a/scripts/build-dynamic-plugins.sh does not include a
standardized Copyright ... header at the beginning of the file. This can violate repository/legal
compliance requirements for redistributed source artifacts.
Code

workspaces/x2a/scripts/build-dynamic-plugins.sh[18]

+#   quay.io/x2ansible/red-hat-developer-hub-backstage-plugin-x2a-scaffolder-module:<version>
Relevance

●●● Strong

License/header compliance fixes are commonly accepted; precedent shows reviewers enforce/restore
standard headers.

PR-#1856
PR-#3641

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1716 requires a standardized copyright header at the start of newly added or
modified source files. The beginning of build-dynamic-plugins.sh has a shebang and comments but no
Copyright ... line.

Rule 1716: Source files must begin with a standardized copyright header
workspaces/x2a/scripts/build-dynamic-plugins.sh[1-23]

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

## Issue description
`workspaces/x2a/scripts/build-dynamic-plugins.sh` is modified in this PR but does not start with the required standardized copyright header.

## Issue Context
Compliance requires that newly added or modified source files begin with a standardized copyright header line starting with `Copyright`.

## Fix Focus Areas
- workspaces/x2a/scripts/build-dynamic-plugins.sh[1-23]

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


2. index.ts lacks co-located test 📘 Rule violation ▣ Testability
Description
The modified TypeScript source file workspaces/x2a/packages/backend/src/index.ts has no co-located
index.test.ts(x) file in the same directory. This violates the requirement to keep tests next to
their source using the *.test.ts(x) suffix.
Code

workspaces/x2a/packages/backend/src/index.ts[R89-91]

backend.add(
-  import('@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-x2a'),
+  import('@red-hat-developer-hub/backstage-plugin-x2a-scaffolder-module'),
);
Relevance

●● Moderate

Repo sometimes rejects adding tests solely for coverage/minor changes; but tests are often added for
real behavior gaps.

PR-#3764
PR-#3539

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1692 requires co-located tests for changed TypeScript source files using the
*.test.ts(x) suffix. The diff shows workspaces/x2a/packages/backend/src/index.ts was modified,
triggering the requirement for a corresponding co-located test file.

Rule 1692: Co-locate TypeScript test files with source using *.test.ts(x) suffix
workspaces/x2a/packages/backend/src/index.ts[89-91]

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

## Issue description
`workspaces/x2a/packages/backend/src/index.ts` was changed but there is no co-located test file matching `index.test.ts` or `index.test.tsx`.

## Issue Context
Compliance requires that changed TS/TSX source files have at least one corresponding co-located test file in the same directory, using the `*.test.ts(x)` suffix.

## Fix Focus Areas
- workspaces/x2a/packages/backend/src/index.ts[89-91]

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


Grey Divider

Context used
✅ Compliance rules (platform): 22 rules
✅ Cross-repo context
  Explored: repo: redhat-developer/rhdh (sha: 820e6260)
  Explored: repo: redhat-developer/rhdh-operator (sha: a425373c)
  Explored: repo: redhat-developer/rhdh-local (sha: a1776caa)
  Not relevant to this PR: redhat-developer/rhdh-chart

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous review results

Review updated until commit 33111c0 ⚖️ Balanced

Results up to commit 33111c0 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Missing header in build script 📘 Rule violation § Compliance
Description
The modified script workspaces/x2a/scripts/build-dynamic-plugins.sh does not include a
standardized Copyright ... header at the beginning of the file. This can violate repository/legal
compliance requirements for redistributed source artifacts.
Code

workspaces/x2a/scripts/build-dynamic-plugins.sh[18]

+#   quay.io/x2ansible/red-hat-developer-hub-backstage-plugin-x2a-scaffolder-module:<version>
Relevance

●●● Strong

License/header compliance fixes are commonly accepted; precedent shows reviewers enforce/restore
standard headers.

PR-#1856
PR-#3641

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1716 requires a standardized copyright header at the start of newly added or
modified source files. The beginning of build-dynamic-plugins.sh has a shebang and comments but no
Copyright ... line.

Rule 1716: Source files must begin with a standardized copyright header
workspaces/x2a/scripts/build-dynamic-plugins.sh[1-23]

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

## Issue description
`workspaces/x2a/scripts/build-dynamic-plugins.sh` is modified in this PR but does not start with the required standardized copyright header.

## Issue Context
Compliance requires that newly added or modified source files begin with a standardized copyright header line starting with `Copyright`.

## Fix Focus Areas
- workspaces/x2a/scripts/build-dynamic-plugins.sh[1-23]

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


2. index.ts lacks co-located test 📘 Rule violation ▣ Testability
Description
The modified TypeScript source file workspaces/x2a/packages/backend/src/index.ts has no co-located
index.test.ts(x) file in the same directory. This violates the requirement to keep tests next to
their source using the *.test.ts(x) suffix.
Code

workspaces/x2a/packages/backend/src/index.ts[R89-91]

backend.add(
-  import('@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-x2a'),
+  import('@red-hat-developer-hub/backstage-plugin-x2a-scaffolder-module'),
);
Relevance

●● Moderate

Repo sometimes rejects adding tests solely for coverage/minor changes; but tests are often added for
real behavior gaps.

PR-#3764
PR-#3539

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 1692 requires co-located tests for changed TypeScript source files using the
*.test.ts(x) suffix. The diff shows workspaces/x2a/packages/backend/src/index.ts was modified,
triggering the requirement for a corresponding co-located test file.

Rule 1692: Co-locate TypeScript test files with source using *.test.ts(x) suffix
workspaces/x2a/packages/backend/src/index.ts[89-91]

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

## Issue description
`workspaces/x2a/packages/backend/src/index.ts` was changed but there is no co-located test file matching `index.test.ts` or `index.test.tsx`.

## Issue Context
Compliance requires that changed TS/TSX source files have at least one corresponding co-located test file in the same directory, using the `*.test.ts(x)` suffix.

## Fix Focus Areas
- workspaces/x2a/packages/backend/src/index.ts[89-91]

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


Qodo Logo

@rhdh-qodo-merge

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 33111c0

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 workspace/x2a

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant