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.
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
CBG-3791: change getAuthScopeHandleCreateDB method to not expand environment variables #6703
CBG-3791: change getAuthScopeHandleCreateDB method to not expand environment variables #6703
Changes from 2 commits
9c79882
fd5f2a9
6ecb17f
4dcb4a3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think you can call
readSantizedJson
here.The thing that might happen is that you need to call
ConvertBackQuotedStrings
to make it valid json. The test should include a config with backquotesThere 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.
We're doing bytes->reader->bytes for no reason here with NewReader->ReadAll
We should be able to pass
bodyJSON
straight intoexpandEnv
andConvertBackQuotedStrings
, since they don't modify the slice, they return a modified copy of it.It does feels like we need to push those two pieces (
expandEnv
/ConvertBackQuotedStrings
) into a shared function called by this,DecodeAndSanitiseConfig
, andreadSanitizeJSON
.We can pass a bool in to that function control env var behaviour and just have it take bytes and return bytes.
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.
This test doesn't work for
SG_TEST_USE_GSI=false
orSG_TEST_USE_DEFAULT_COLLECTION=true
Will need to build the db config to accommodate those modes.
Some existing functions to consider using or adapting:
dbConfigForTestBucket
makeDbConfig
Should be able to include string values like
"${VAR}"
for sync function before marshalling it to pass into the request.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.
Oh wow didn't even think about that, on it fixing it
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.
this might fail if SG_TEST_USE_XATTRS=false is set, can you check?
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.
Just checked and no failure.