fix: iac usage tracking missing custom org#4262
Merged
Conversation
6fdd558 to
dd70a12
Compare
dd70a12 to
8e8fddb
Compare
andreeaneata
approved these changes
Dec 28, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes an issue in IaC usage tracking where it was not passing the org data to Registry, causing it to count for the default org instead of the custom set org.
How should this be manually tested?
SNYK_CFG_ORGvariable or the--orgflag.With this branch, the correct test-count for the custom org will be increased.
Any background context you want to provide?
This came up in a Customer Support Ticket, when a customer was using the VS-Code plugin with a custom org to scan IaC files, they mentioned that scan counts are increased for wrong organization. I was able to replicate this quickly and worked on a solution.
I've also validated this solution with VSCode and made sure it resolved the original issue.
To try the solution in VsCode, generate a custom
snyk-macosbinary from the CLI using the Make file and point the plugin in VSCode to it via the advanced settings.This did not happen when fetching org-settings as the correct query-string data was passed:

What are the relevant tickets?
Support Ticket:
https://snyk.zendesk.com/agent/tickets/38402
Screenshots
CLI output shows a Custom Org is used as expected (
test-organd notron.tal) ✅Before Fix 👎
IaC Usage tracking endpoint in Registry detects the wrong org (default org):
73234f0b-a44f-4838-8562-3e0160070570❌After Fix 👍
Registry Usage tracking endpoint detects the right org (custom one):
7160edb4-5c66-4fd1-bc84-c1350b240cc1✅