Skip to content
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

Cloud Run Action #117

Merged
merged 27 commits into from
Jul 30, 2020
Merged

Cloud Run Action #117

merged 27 commits into from
Jul 30, 2020

Conversation

averikitsch
Copy link
Contributor

No description provided.

@averikitsch averikitsch requested a review from sethvargo June 3, 2020 22:58
description: |-
Region in which the resource can be found.
required: false
default: us-central1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a conventional default region with other GCP services? Just want to make sure we're following established conventions vs defining our own.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes per DevRel but not officially, I can remove and make this required?

projectId = jsonContent.project_id;
core.info('Setting project Id from credentials');
}
} else if (!projectId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be clearer if the assumptions are stated explicitly within the conditional statement as opposed to transitively like this. Consider something like:
if (!projectId && json.project_id) {} elseif (!projectId && process.env.GCLOUD_PROJECT) {} else {throw new Error()}


// Deploy service
let serviceResponse = await client.deploy(service);
while (!serviceResponse.status!.url) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the error messaging look like to the user with these non-null assertions? I want to be mindful of the potential errors messages which might be seen by users. I wonder if it make sense to do explicit null checks here and throughout so that we can control the error messaging.

Copy link
Contributor Author

@averikitsch averikitsch Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a serviceResponse obj then there will be a status field. If that breaks then it most likely with error: TypeError: Cannot read property 'url' of undefined or TypeError: Cannot read property 'status' of undefined.

Copy link
Contributor

@craigdbarber craigdbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work here!!
Left some feedback in-line.

Copy link
Contributor

@craigdbarber craigdbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo outstanding feedback items :)

*
* @param service Service object
*/
async delete(service: Service): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for removing test resources

*
* @param service Service object
*/
async allowUnauthenticatedRequests(service: Service): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we supporting this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not supporting, but I was keeping for prosperity. Should I remove?

deploy-cloudrun/README.md Outdated Show resolved Hide resolved
deploy-cloudrun/README.md Outdated Show resolved Hide resolved
@averikitsch averikitsch merged commit a244a88 into master Jul 30, 2020
@averikitsch averikitsch deleted the cloud-run branch July 30, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants