-
Notifications
You must be signed in to change notification settings - Fork 72
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 cloud provider prefix to deployment ID #1480
Conversation
@@ -511,6 +512,79 @@ export type Deployment = { | |||
versions?: DeploymentVersion[]; | |||
}; | |||
|
|||
// If deploymentId is provided tries fetch only that one deployment and finishes early when found |
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.
If deploymentId is provided it tries to fetch only that one deployment and returns early when found
@@ -511,6 +512,79 @@ export type Deployment = { | |||
versions?: DeploymentVersion[]; | |||
}; | |||
|
|||
// If deploymentId is provided tries fetch only that one deployment and finishes early when found | |||
async function fetchDeployments(cloudProvider: CloudProvider['type'], deploymentId?: string) { |
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.
Nit: I think we will be using type CloudProvider['type']
so consider defining it as type CloudProviderType = CloudProvider['type']
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'm currently replacing it with a full CloudProvider
type at some places so I'll see whether it makes sense.
|
||
const latestDeployment = Object.keys(stageDirectory.children).sort().reverse()[0]; | ||
const bucketConfigPath = `${airnodeAddress}/${stage}/${latestDeployment}/config.json`; | ||
const config = JSON.parse( |
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'd wrap this in go
since this can fail in many ways (users manually edit aws config, we change the region and nodeVersion field). It would be nice to handle this gracefully.
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'll do that as part of #1449
const { id, cloudProvider, region, airnodeAddress, stage, airnodeVersion, lastUpdate, versions } = | ||
deployment as Deployment; | ||
const deployment = goCloudDeploymentInfo.data[0]; | ||
const { id, region, airnodeAddress, stage, airnodeVersion, lastUpdate, versions } = deployment as Deployment; |
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 is this not typed automatically? The go utils should provide inference for these things.
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.
👍 LGTM.
2a78011
to
f32cdcd
Compare
67fb485
to
a10b1ac
Compare
Close #1473