-
Notifications
You must be signed in to change notification settings - Fork 31
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
OWL-884 feat: add learn jit to webpanel #187
Conversation
08b9715
to
6efa31a
Compare
src/snyk/snykOss/views/suggestion/ossSuggestionWebviewProvider.ts
Outdated
Show resolved
Hide resolved
1a786c1
to
d4bdad3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @denis-snyk! I've left some minor comments to address.
Something I am not sure about is whether Learn about this vulnerability link would always bring a user to a learn doc. I've tested goof and opened Directory Traversal
issue that upon opening a link brought me to the generic Snyk Learn page. Same with "Arbitrary Code Execution" from OSS results. Is there some logic bug maybe?
Also couldn't find any links to test from Code Security results.
src/snyk/snykOss/views/suggestion/ossSuggestionWebviewProvider.ts
Outdated
Show resolved
Hide resolved
src/snyk/snykOss/views/suggestion/ossSuggestionWebviewProvider.ts
Outdated
Show resolved
Hide resolved
src/snyk/snykOss/views/suggestion/ossSuggestionWebviewProvider.ts
Outdated
Show resolved
Hide resolved
src/snyk/snykOss/views/suggestion/ossSuggestionWebviewProvider.ts
Outdated
Show resolved
Hide resolved
53490b6
to
44f481f
Compare
return cacheResult.data; | ||
} else { | ||
const res = await axios.get<Lesson[]>('/lessons', { | ||
baseURL: 'https://api.snyk.io/v1/learn', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to declare URL as const and pull the host from configuration.baseApiUrl
from configuration.ts
@Geit @denis-snyk Also Changelog.md, Readme.md and Snyk Docs should be updated accordingly. |
@@ -154,6 +156,10 @@ export class Configuration implements IConfiguration { | |||
return this.defaultOssApiEndpoint; | |||
} | |||
|
|||
get snykLearnEndpoint(): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to have this as a constant on LearnService instead, since it's the only place where it gets called from :)
Great one, folks 👏 |
What is this PR
This PR adds a Snyk learn link to Snyk OSS and Snyk Code Suggestion Webviews
The logic follows:
Considerations
Screenshots:
Snyk OSS
Snyk Code