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

fix: better error when org is not found for snyk code #2295

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

saark-snyk
Copy link
Contributor

What does this PR do?

This PR shows better error when org is not found for user (instead of showing "Snyk code is not enabled for org")

Where should the reviewer start?

How should this be manually tested?

run snyk code test --org=foo with this PR

Any background context you want to provide?

What are the relevant tickets?

https://snyksec.atlassian.net/browse/COD-556?atlOrigin=eyJpIjoiMTBlZjliODkxMjM4NGVkNjgzMGEyZmE5M2NkMDExMWMiLCJwIjoiaiJ9

Screenshots

Additional questions

@saark-snyk saark-snyk requested a review from a team as a code owner October 4, 2021 10:45
@saark-snyk saark-snyk requested a review from Arvi3d October 4, 2021 10:45
@saark-snyk saark-snyk force-pushed the fix/code-org-not-found branch from 214659d to 5da4c73 Compare October 4, 2021 10:46
@saark-snyk saark-snyk changed the title feat: better condition for showing groupBy button fix: better error when org is not found for snyk code Oct 4, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2021

Warnings
⚠️

Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:

  • test/jest/unit/snyk-code/snyk-code-test.spec.ts

Generated by 🚫 dangerJS against e890d0b

@@ -17,7 +17,7 @@ import { jsonStringifyLargeObject } from '../../../../src/lib/json';
import { ArgsOptions } from '../../../../src/cli/args';

const { getCodeAnalysisAndParseResults } = analysis;
const osName = require('os-name');
import osName = require('os-name');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required: this looks like a typo. import and require

Copy link
Contributor Author

@saark-snyk saark-snyk Oct 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a typo, it's a way of importing es modules that use export =

@@ -16,7 +18,6 @@ export async function validateCodeTest(options: Options) {
}

// TODO: We would need to remove this once we fix circular import issue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: kill this line as well?

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

Successfully merging this pull request may close these issues.

3 participants