-
Notifications
You must be signed in to change notification settings - Fork 90
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
SALTO-6867 Fetch bot builder #6751
base: main
Are you sure you want to change the base?
Conversation
9bd6ae5
to
0e08127
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.
looks good! 🔥 added some small comments
} | ||
const headers = { | ||
...params.headers, | ||
'Content-Type': 'application/json', |
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.
why is this always application/json
?
} catch (e) { | ||
if (e.response?.status === 400) { | ||
log.debug('Got 400, trying to get new CSRF token') | ||
this.csrfToken = await this.getCsrfToken() |
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.
is expired csrf token is the only reason for a 400 status?
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.
also, if this.getCsrfToken()
fails it throws an error, but then we won't see the original error that was caught in this block
endpoints: { | ||
default: { | ||
post: { | ||
// This is for the graphql endpoint, which is readonly for fetch. It allows it to be used in fetch |
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.
then maybe set it specifically for the graphql path? or are there multiple?
(is there a reason to define the clients in a separate PR from the fetch definitions? there's probably no harm in adding it, but there isn't enough context here to actually review the only thing using it - even if these are in separate PRs, probably worth having the next one available for review?)
9f709cf
to
414cd9f
Compare
This is still missing a filter to order the paths, some references and error handling for the graphql response
Additional context for reviewer
Release Notes:
Replace me with a short sentence that describes the effect of this change on Salto users
User Notifications:
Replace me with a short sentence that describes changes that will appear in NaCls and are not caused by user actions (e.g. a new annotation, field values that are converted to references, etc). Hidden changes should not be listed.