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 rules only apply to base definition, not applied to urls in catalog

See original GitHub issue

When a rule is applied to a URL, than any catalog components defined in that url should be allowed. Currently it seems the rule is only applying directly to the component.

catalog: 
  locations: 
    - type: url 
      target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/all-templates.yaml 
      rules: 
        - allow: [Template] 

Currently, templates are not allowed to be applied when found via a url

2021-04-26T19:28:49.532Z catalog warn Failed item in location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml, NotAllowedError: Entity of kind Template is not allowed from location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml
    at LocationReaders.read (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:1034:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async HigherOrderOperations.refreshSingleLocation (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:936:26)
    at async HigherOrderOperations.refreshAllLocations (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:924:9)
    at async startRefresh (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:865:9) type=plugin component=catalog-all-locations-refresh
2021-04-26T19:28:49.533Z catalog warn Failed item in location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/docs-template/template.yaml, NotAllowedError: Entity of kind Template is not allowed from location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/docs-template/template.yaml
    at LocationReaders.read (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:1034:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async HigherOrderOperations.refreshSingleLocation (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:936:26)
    at async HigherOrderOperations.refreshAllLocations (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:924:9)
    at async startRefresh (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:865:9) type=plugin component=catalog-all-locations-refresh
2021-04-26T19:28:49.533Z catalog warn Failed item in location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml, NotAllowedError: Entity of kind Template is not allowed from location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml
    at LocationReaders.read (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:1034:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async HigherOrderOperations.refreshSingleLocation (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:936:26)
    at async HigherOrderOperations.refreshAllLocations (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:924:9)
    at async startRefresh (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:865:9) type=plugin component=catalog-all-locations-refresh
2021-04-26T19:28:49.534Z catalog warn Failed item in location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/template.yaml, NotAllowedError: Entity of kind Template is not allowed from location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/template.yaml
    at LocationReaders.read (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:1034:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async HigherOrderOperations.refreshSingleLocation (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:936:26)
    at async HigherOrderOperations.refreshAllLocations (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:924:9)
    at async startRefresh (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:865:9) type=plugin component=catalog-all-locations-refresh
2021-04-26T19:28:49.534Z catalog warn Failed item in location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/v1beta2-demo/template.yaml, NotAllowedError: Entity of kind Template is not allowed from location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/v1beta2-demo/template.yaml
    at LocationReaders.read (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:1034:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async HigherOrderOperations.refreshSingleLocation (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:936:26)
    at async HigherOrderOperations.refreshAllLocations (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:924:9)
    at async startRefresh (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:865:9) type=plugin component=catalog-all-locations-refresh
2021-04-26T19:28:49.535Z catalog warn Failed item in location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/pull-request/template.yaml, NotAllowedError: Entity of kind Template is not allowed from location url:https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend/sample-templates/pull-request/template.yaml
    at LocationReaders.read (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:1034:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async HigherOrderOperations.refreshSingleLocation (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:936:26)
    at async HigherOrderOperations.refreshAllLocations (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:924:9)
    at async startRefresh (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:865:9) type=plugin component=catalog-all-locations-refresh
2021-04-26T19:28:49.535Z catalog warn Failed item in location url:https://github.com/spotify/cookiecutter-golang/tree/master/template.yaml, NotAllowedError: Entity of kind Template is not allowed from location url:https://github.com/spotify/cookiecutter-golang/tree/master/template.yaml
    at LocationReaders.read (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:1034:22)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async HigherOrderOperations.refreshSingleLocation (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:936:26)
    at async HigherOrderOperations.refreshAllLocations (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:924:9)
    at async startRefresh (/app/node_modules/@backstage/plugin-catalog-backend/dist/index.cjs.js:865:9) type=plugin component=catalog-all-locations-refresh

As a temporary workaround, you’d have to define all templates at the base catalog definition.

catalog:
  locations:
    - type: url
      target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/all-templates.yaml
      rules:
        - allow: [Template]
    - type: url
      target: https://github.com/backstage/backstage/blob/master/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml
      rules:
        - allow: [Template] 

Context

Would like to keep each catalog component seperate from the main app-config.yaml

Your Environment

  • NodeJS Version (v12): v14.16.1
  • Operating System and Version (e.g. Ubuntu 14.04): Debian Buster-slim
  • Browser Information: Firefox

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
frebencommented, Sep 21, 2021

Hey! No distinct plans - but I’ll take a quick look now to try to gauge what the effort / complexity is

0reactions
frebencommented, Sep 21, 2021

Alright, made a pull request that hopefully addresses this. #7270

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up Platform URLs for catalog modules
You can direct users to a specific catalog via a URL to a module in that particular catalog.
Read more >
Connect and disconnect a publishing site to a catalog in ...
Integrate the catalog into my site. This option enables you to define how your friendly URLs will look, and where to integrate the...
Read more >
UNT Catalogs Archive | University of North Texas
Links to archived online versions of UNT undergraduate and graduate catalogs produced from 1995-1996 through the last completed academic year.
Read more >
How can I redirect and rewrite my URLs with an .htaccess ...
The first path to the old file must be a local UNIX path, NOT the full path. So, if the .htaccess file is...
Read more >
3 Special Cataloging Guidelines
Provider-neutral records function as "base" records in the shared ... However, do not include elements applicable only to the physical ...
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