$text substitutions in catalog descriptor files do not support local files

See original GitHub issue

Expected Behavior

According to the documentation for $text, $json and $yaml, we should be able to use $text: <local file path> to substitute catalog-info.yaml. This is especially useful for spec.definition in API entities.

Example

kind: API
...
spec:
  type: openapi
  definition:
    $text: ./api-definition.yaml

Actual Behavior

Catalog throws an error when processing API entities where $test is either a relative local path or an absolute local path. It works only with URLs.

2022-10-28T12:16:01.069Z catalog warn Processor PlaceholderProcessor threw an error while preprocessing; caused by Error:
Placeholder $text could not form a URL out of /Users/himanshumishra/workspace/backstage/packages/catalog-
model/examples/apis/petstore-api.yaml and ./my-api-definition.yaml, Error: URL parsing failed. type=plugin entity=api:default/petstore

Steps to Reproduce

Update an API definition where $text points to a local file path

Context

Looking into the processor code, there is a comment saying the support for relative file is not there.

Your Environment

  • Browser Information:

  • Output of yarn backstage-cli info:

master branch of this repository

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
awanlincommented, Nov 1, 2022

Sorry for sending you down the wrong path @OrkoHunter. I wonder why the person on Discord said it worked for them 🤔

0reactions
OrkoHuntercommented, Nov 10, 2022

@doemEINS Oh awesome! I wonder if that still works if the catalog-info.yaml is registered locally instead of from a URL? In my case, I have a local instance where my catalog-info.yaml is registered locally using catalog.locations in app-config.yaml.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Descriptor Format of Catalog Entities - Backstage.io
The descriptor format supports substitutions using $text , $json , and $yaml . Placeholders like $json: https://example.com/entity.json are substituted by the ...
Read more >
Using Oracle GoldenGate Parameter Files
Oracle GoldenGate creates parameter files in the default character set of the local operating system. In the event that the local platform does...
Read more >
Manage missing fonts – Figma Help Center
The missing fonts modal allows you to quickly update affected text layers. You can use this approach to select an alternative font to...
Read more >
Data Catalog Vocabulary (DCAT) - Version 2 - W3C
Abstract. DCAT is an RDF vocabulary designed to facilitate interoperability between data catalogs published on the Web.
Read more >
Reading and Writing Files in Python - DataCamp
When you add 'b' to the access modes, you can read the file in binary format rather than the default text format. It...
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