question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relax restrictions on component names

See original GitHub issue

Feature Suggestion

Today, I when ingesting catalog info files I see the error Error: "metadata.name" is not valid; expected a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total but found...

Possible Implementation

Hard to say; I’m not sure why component names are restricted in this way (still very new to Backstage!). I see that supporting / might be tough currently because of the namespace syntax; perhaps namespace would take precedence when parsing such names?

Context

I’m trying to populate backstage with NuGet and npm packages as library-type components. I’d really like to populate backstage with our internal and external package dependencies and link these to our services so we can use Backstage for processes like flagging apps that reference out-of-date/vulnerable package versions and understand usages across our ecosystem.

All of our internal packages (and many external ones we reference) use a scope to avoid name collisions. Therefore, the names are like @<company>/abc-xyz.

In a few cases, we’ve also run into the length limitation; some packages are very verbosely named such as https://www.nuget.org/packages/runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/.

Given that packages have well-known and unique names, I’d really like to just be able to use the true name of the package as the component name rather than mangling the name to meet the restrictions.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
frebencommented, Jul 23, 2021

Hi!

You can make your own validation rule overrides by using makeValidator and passing that to the catalog builder in your backend setup of the catalog.

However as you say, slashes (and colons) are discouraged and may lead to breakage in unexpected places.

The reason that this is kind of restricted is that it’s more than a name - it’s the unique ID of the entity (together with namespace and kind).

0reactions
github-actions[bot]commented, Feb 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Relaxing restrictions on custom attribute names - HTML - WICG
Custom attribute names must contain a hyphen · The prefix must be at least 2 characters long · The prefix must not be...
Read more >
Relax resource name restrictions — Nova Specs documentation
Resource names are unnecessarily restricted. It's pretty much always a bad idea to add unnecessary restrictions without a good reason.
Read more >
Restricting wcms component or page in hybris
We can restrict a page or component from being displayed to specified users or user groups, on specified dates etc.. There are different...
Read more >
Applying Restrictions to Content Slots and Component Types
You can apply restrictions to CMS component types and content slots. The Component Type Group changes the relationship between the Content Slot Name...
Read more >
Allowed characters in Reactjs component names - jsx
Other than react component names being PascalCased, I believe the rest fall under plain old vanilla JS identifier requirements/restrictions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found