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
replace single usage of enable with ensure #3941
Conversation
@@ -22,8 +22,8 @@ module.exports = async function (setup: any, config: any, options: Options) { | |||
if (projectId) { | |||
await requirePermissions({ ...options, project: projectId }); | |||
await Promise.all([ | |||
ensureApiEnabled.enable(projectId, "cloudfunctions.googleapis.com"), | |||
ensureApiEnabled.enable(projectId, "runtimeconfig.googleapis.com"), | |||
ensure(projectId, "cloudfunctions.googleapis.com", "unused", true), |
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 did you add these last 2 args? Doesn't seem like they should be here.
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.
At least the 3rd is required. It's "label" (for printing messages) and "silent" (again, printing messages). Setting them to have the same behavior as it does today.
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.
My bad - I was looking at the signature for enable in the file above and wondering where those args were coming from 🤦
* replace single usage of enable with ensure * add comment to enable
Description
Permissions for checking if an API is enabled and actually enabling the API are separate. Some users may have the former, not the latter. So, let's stick to using only
ensure
so that those users can succeed.I went ahead and un-exported
enable
to make it harder to use it outside its file (and added a comment in code).Fixes #2574.
Scenarios Tested
init
'd functions. also did it turning off the API to make sure it was re-enabled.