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

Add support for specifying latest for version #45

Merged
merged 11 commits into from
Jan 30, 2020
Merged

Conversation

craigdbarber
Copy link
Contributor

Integration tests successfully passed: https://github.com/GoogleCloudPlatform/github-actions/actions/runs/32798521

Addresses: #31

@@ -0,0 +1,52 @@
/*
* Copyright 2019 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: year

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You caught me copying and pasting :)
Done.

@@ -0,0 +1,30 @@
/*
* Copyright 2019 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: year

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

*/
export async function getLatestGcloudSDKVersion(): Promise<string> {
const client: httpm.HttpClient = new httpm.HttpClient(
'github-actions-setup-gcloud',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we pass this in from the other fie where it is defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

.get(
'https://api.github.com/repos/GoogleCloudPlatform/cloud-sdk-docker/tags',
)
.then(res => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change this to async/await pattern to stay consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would love to, sadly the library we're using here doesn't support it, so we have to wrap around it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm seeing async/await in their "docs" aka tests (https://github.com/microsoft/typed-rest-client/blob/master/test/tests/httptests.ts#L52). This code is just getting harder and harder to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh snap! You are correct. For some reason when I first looked into using the library I had decided it didn't support it. Glad to see that's not the case. Good catch!

@craigdbarber craigdbarber force-pushed the latest-version branch 2 times, most recently from e6b55fa to c84e09e Compare January 30, 2020 01:22
@craigdbarber craigdbarber merged commit c965b60 into master Jan 30, 2020
@craigdbarber craigdbarber deleted the latest-version branch January 30, 2020 22:56
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.

2 participants