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.

catalog-import plugin does not support Unicode characters in catalog-info.yaml file

See original GitHub issue

Expected Behavior

Importing a GitHub repo should allow Unicode characters in the submitted catalog-info.yaml file. For example, a file like this should work:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: test-service
  description: Description with emojis 🤖
spec:
  lifecycle: production
  type: service
  owner: test-team

Current Behavior

Right now if you try to import the file above, you will get the following error: Failed to submit PR to repo, Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

Possible Solution

Use a library like js-base64 to encode the file contents, which allows for Unicode characters.

Steps to Reproduce

  1. Create a custom LocationAnalyzer
  2. Modify the generated Entity in the custom LocationAnalyzer by adding a description field with Unicode characters in it
  3. Use custom LocationAnalyzer
  4. Try to import GitHub repository via /catalog-import

Context

We are trying to add some extra information to the generated catalog-info.yaml file. This reduces the work for developers as they can import the file and not make any modifications afterwards. We fetch the description from GitHub and add it to the generated catalog-info.yaml file. Some of our repos have emojis in them, so creating the PR fails due to the lack of Unicode support in the native btoa function.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
padraigobriencommented, Jan 28, 2021

I am happy to wait, I can be working on the issue quietly in the background and implement once #4271 is merged

1reaction
Fox32commented, Apr 7, 2021

Should be fixed with #5146, thanks @padraigobrien.

Read more comments on GitHub >

github_iconTop Results From Across the Web

yamllint fail to capture invalid unicode characters
yamllint says no errors. But I am expecting yamllint to show (<unknown>): found invalid Unicode character escape code while parsing a quoted ...
Read more >
Descriptor Format of Catalog Entities - Backstage.io
Documentation on Descriptor Format of Catalog Entities which describes the default data shape and semantics of catalog entities.
Read more >
MySQL 8.0 Reference Manual :: 10.10.1 Unicode Character Sets
MySQL supports multiple Unicode character sets: utf8mb4 : A UTF-8 encoding of the Unicode character set using one to four bytes per character....
Read more >
MySQL plugin password can't work with a hash character in it
However, I noticed if the password to the mysql server contains a hash, I am not able to get it to parse the...
Read more >
Sharing dependency versions between projects
The version catalog plugin. While importing catalogs from local files is convenient, it doesn't solve the problem of sharing a catalog in an...
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