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
Remove not used parameters from request() and add options hive #4537
Conversation
Seems that I catched all of them. |
9f58e0e
to
ba7e279
Compare
@HyperBrain the options argument is great. Will this indeed allow me to use E.g. to enable multipart uploading as per the AWS docs (this is currently not possible as
|
@tommedema , the options hive here is meant to configure the request execution behavior. E.g. you can set You specific use case for the upload is out of scope for this PR, but could be added as a second step ,either by having some options.params2 or allow params to be an array of params (in addition to the current state) for the request function. |
@horike37 This must get in now that the vars branch has been merged. It removes the wrong/stale request method signature and corrects the unit tests. Can you please review and approve, so that I can get it in? |
Delete bucket was still using them Hopefully all :) Further test fixes. .... worked too long yesterday Fixed Variable tests Remove not used parameters from request() and add options with warning
008c55c
to
e4a5a1d
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.
Thank you for refactoring around request function @HyperBrain 👍
I tried sls deploy
on this PR branch, and when enabling SLS_DEBUG
, saw WARNING: Inappropriate call of provider.request
error continuously as follow.
Was not this done intentionally?
$../serverless/bin/serverless deploy
Serverless: Creating Stack...
Serverless: WARNING: Inappropriate call of provider.request()
Serverless: Checking Stack create progress...
Serverless: WARNING: Inappropriate call of provider.request()
..
Serverless: WARNING: Inappropriate call of provider.request()
.
Serverless: WARNING: Inappropriate call of provider.request()
undefined
Serverless: WARNING: Inappropriate call of provider.request()
Serverless: WARNING: Inappropriate call of provider.request()
Serverless: WARNING: Inappropriate call of provider.request()
..
Serverless: Stack create finished...
Serverless: WARNING: Inappropriate call of provider.request()
Serverless: WARNING: Inappropriate call of provider.request()
Serverless: Uploading CloudFormation file to S3...
Serverless: WARNING: Inappropriate call of provider.request()
Serverless: Uploading artifacts...
@horike37 Do you have any plugin enabled? It will log a warning if someone (a plugin) calls request with the wrong signature (including stage and region) to find misuses. However without any plugins enabled it should not log the message. |
Sorry, I saw old commits. I did pull again and it works correctly 💦 Then all commands work perfectly. Seems everything is good 💯 |
Sorry I didn't get a review in before this was merged but it looked good. I did have the comment that there was pending dependencies on the use of options.stage && options.region throughout the codebase. (e.g. https://github.com/serverless/serverless/blob/master/lib/plugins/aws/remove/lib/bucket.js#L7 )(another example: https://github.com/serverless/serverless/blob/master/lib/plugins/platform/platform.js#L37 - I don't understand this one and it seems AWS specific despite being not within the scope of the AWS plugin... Weird to me). However, I wanted to provide code of what I meant rather than just call it out and I delayed feedback as a result. |
@erikerikson You're right. For the getDeploymentBucket() in aws/remove, the stage/region retrieval should be included within the function itself utilizing the central provider.getStage() and provider.getRegion() functions. For the platform plugin, it seems that I missed the wrong signature in there - however I do not know if that plugin is bound to AWS. However, the parameters in request were not used anymore for a long time - so there they had no effect at all ... |
Thanks for confirming. I'll add that on #4560. Hadn't been sure on scope. |
Signature of this method changed on SLS side, also those two parameters were never supported serverless/serverless#4537
What did you implement:
There were many places were calls to provider.request() received a stage and region parameter, although these are not used since a long time anymore even if the function signature was changed too.
How did you implement it:
Removed the not-used parameters in all calls.
Additionally the new
useCache
parameter was too specific to be part of the signature, so I added an options object, that can be optionally given and is used as container for options that change the request method's behavior.How can we verify it:
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO