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

[🐛] github.com/project-slug annotation causes Error - Failed finding Target snyk data for repo #209

Open
danilgotvyansky opened this issue Dec 30, 2024 · 1 comment

Comments

@danilgotvyansky
Copy link

danilgotvyansky commented Dec 30, 2024

  • node -v:
  • npm -v:
  • OS: (e.g. OSX, Linux, Windows, ...) Linux (k8s)
  • Command run: (e.g. snyk-api-import ..., ...)

Expected behaviour

Please share expected behaviour.
github.com/project-slug annotation should be not added to TARGETS at all or the hierarchy of the assumed targets from annotations should be changed from TARGETS > TARGETS + TARGETNAME > TARGETID
to
TARGETS > TARGETID > TARGETNAME (means only added if no other annotation is specified).

Actual behaviour

Please share problematic behaviour you are seeing.
Error - Failed finding Target snyk data for repo org/repo when annotations are:

    snyk.io/org-id: <any-org-id>
    snyk.io/targets: <target-id> # target id of the different target in other repo
    github.com/project-slug: org/repo 

but works when annotations are:

    snyk.io/org-id: <any-org-id>
    snyk.io/targets: <target-id>  

In our Backstage setup entity is not always = repo, so linking to the github.com/project-slug annotation is blocking access to more prioritized plugin features such as direct target linking

Steps to reproduce

Please share minimal steps needed to reproduce your issue. Ideally
a paired down manifest / project to showcase the problem that can also
be used for testing.

  1. Install backstage and add snyk integration (v.2.5.1)
  2. Configure plugin with proxy
  3. Add project to Snyk
  4. Add github.com/project-slug annotation different from the repo related to the snyk project
  5. Add snyk.io/targets annotation with target id different from the repo in github.com/project-slug
  6. See error Error - Failed finding Target snyk data for repo org/repo
  7. Remove github.com/project-slug annotation - No error

Debug log

If applicable, please add DEBUG=*snyk* <command here> before your command and include the output here **ensuring to remove any sensitive/personal details or tokens.

Screenshots

If applicable, add screenshots to help explain your problem.

P.S

Thank you for the work on this plugin, would deeply appreciate if you could fix this for me.

@aarlaud
Copy link
Contributor

aarlaud commented Jan 8, 2025

hi there, so if we were to keep loading instead of throwing the error, that'd work for you essentially?

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