Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messaging when files missing #48

Open
tragiclifestories opened this issue Jun 20, 2023 · 1 comment
Open

Improve error messaging when files missing #48

tragiclifestories opened this issue Jun 20, 2023 · 1 comment

Comments

@tragiclifestories
Copy link

tragiclifestories commented Jun 20, 2023

given a pipeline:

{
  sync_id: 'backstage',
  pipelines: [
    {
      sources: [
        {
          'local': {
            files: [
              'catalog-info.yaml',
            ],
          },
        },
      ],
    },
  ]
}

If the catalog-info.yaml file is not found, the import proceeds, but (in this case at least, when there are no other files) you get an error:

catalog-importer: error: outputs (type_name = 'Custom["BackstageComponent"]'): found 0 matching entries and would delete everything but --allow-delete-all not set

In my opinion, importing a non-existent local file should be a hard error as soon as you stat it - it's almost certainly something that needs attention.

PS:

I got into this situation because I was expecting the local paths to be relative to the pipeline file, but they seem to be relative to the directory where you're invoking the binary. I leave this as a discussion point - people may have different expectations around this, and it would obviously be a breaking change.

@DuffleOne
Copy link
Contributor

Hi there!

Sorry for the delay on this, we agree that referencing files that are not found should explicitly error early in the process, and now it does :)

Let us know if you have any follow up on this!

In regards to relative file paths, I do agree that it is not super explicit where the base path starts, I think we should follow Go itself in their model of the base path being where the binary is executed from. But I do encourage that discussion ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants