Skip to content

Commit

Permalink
updates default deployment url (#1378)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanahamilton authored and kushalmalani committed Sep 12, 2023
1 parent 6ec6411 commit e662c3a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions cloud/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,10 @@ func GetDeploymentURL(deploymentID, workspaceID string) (string, error) {
}
switch ctx.Domain {
case domainutil.LocalDomain:
deploymentURL = ctx.Domain + ":5000/" + workspaceID + "/deployments/" + deploymentID + "/analytics"
deploymentURL = ctx.Domain + ":5000/" + workspaceID + "/deployments/" + deploymentID + "/overview"
default:
_, domain := domainutil.GetPRSubDomain(ctx.Domain)
deploymentURL = "cloud." + domain + "/" + workspaceID + "/deployments/" + deploymentID + "/analytics"
deploymentURL = "cloud." + domain + "/" + workspaceID + "/deployments/" + deploymentID + "/overview"
}
return deploymentURL, nil
}
Expand Down
12 changes: 6 additions & 6 deletions cloud/deployment/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2651,42 +2651,42 @@ func TestGetDeploymentURL(t *testing.T) {

t.Run("returns deploymentURL for dev environment", func(t *testing.T) {
testUtil.InitTestConfig(testUtil.CloudDevPlatform)
expectedURL := "cloud.astronomer-dev.io/workspace-id/deployments/deployment-id/analytics"
expectedURL := "cloud.astronomer-dev.io/workspace-id/deployments/deployment-id/overview"
actualURL, err := GetDeploymentURL(deploymentID, workspaceID)
assert.NoError(t, err)
assert.Equal(t, expectedURL, actualURL)
})
t.Run("returns deploymentURL for stage environment", func(t *testing.T) {
testUtil.InitTestConfig(testUtil.CloudStagePlatform)
expectedURL := "cloud.astronomer-stage.io/workspace-id/deployments/deployment-id/analytics"
expectedURL := "cloud.astronomer-stage.io/workspace-id/deployments/deployment-id/overview"
actualURL, err := GetDeploymentURL(deploymentID, workspaceID)
assert.NoError(t, err)
assert.Equal(t, expectedURL, actualURL)
})
t.Run("returns deploymentURL for perf environment", func(t *testing.T) {
testUtil.InitTestConfig(testUtil.CloudPerfPlatform)
expectedURL := "cloud.astronomer-perf.io/workspace-id/deployments/deployment-id/analytics"
expectedURL := "cloud.astronomer-perf.io/workspace-id/deployments/deployment-id/overview"
actualURL, err := GetDeploymentURL(deploymentID, workspaceID)
assert.NoError(t, err)
assert.Equal(t, expectedURL, actualURL)
})
t.Run("returns deploymentURL for cloud (prod) environment", func(t *testing.T) {
testUtil.InitTestConfig(testUtil.CloudPlatform)
expectedURL := "cloud.astronomer.io/workspace-id/deployments/deployment-id/analytics"
expectedURL := "cloud.astronomer.io/workspace-id/deployments/deployment-id/overview"
actualURL, err := GetDeploymentURL(deploymentID, workspaceID)
assert.NoError(t, err)
assert.Equal(t, expectedURL, actualURL)
})
t.Run("returns deploymentURL for pr preview environment", func(t *testing.T) {
testUtil.InitTestConfig(testUtil.CloudPrPreview)
expectedURL := "cloud.astronomer-dev.io/workspace-id/deployments/deployment-id/analytics"
expectedURL := "cloud.astronomer-dev.io/workspace-id/deployments/deployment-id/overview"
actualURL, err := GetDeploymentURL(deploymentID, workspaceID)
assert.NoError(t, err)
assert.Equal(t, expectedURL, actualURL)
})
t.Run("returns deploymentURL for local environment", func(t *testing.T) {
testUtil.InitTestConfig(testUtil.LocalPlatform)
expectedURL := "localhost:5000/workspace-id/deployments/deployment-id/analytics"
expectedURL := "localhost:5000/workspace-id/deployments/deployment-id/overview"
actualURL, err := GetDeploymentURL(deploymentID, workspaceID)
assert.NoError(t, err)
assert.Equal(t, expectedURL, actualURL)
Expand Down
50 changes: 25 additions & 25 deletions cloud/deployment/fromfile/fromfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ deployment:
workloadIdentity: astro-great-release-name@provider-account.iam.gserviceaccount.com
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
`
fileutil.WriteStringToFile(filePath, data)
Expand Down Expand Up @@ -260,7 +260,7 @@ deployment:
workloadIdentity: astro-great-release-name@provider-account.iam.gserviceaccount.com
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -323,7 +323,7 @@ deployment:
workloadIdentity: astro-great-release-name@provider-account.iam.gserviceaccount.com
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -388,7 +388,7 @@ deployment:
workloadIdentity: astro-great-release-name@provider-account.iam.gserviceaccount.com
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -453,7 +453,7 @@ deployment:
workloadIdentity: astro-great-release-name@provider-account.iam.gserviceaccount.com
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -518,7 +518,7 @@ deployment:
"workloadIdentity": "astro-great-release-name@provider-account.iam.gserviceaccount.com",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -620,7 +620,7 @@ deployment:
workloadIdentity: astro-great-release-name@provider-account.iam.gserviceaccount.com
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails: []
`
Expand Down Expand Up @@ -727,7 +727,7 @@ deployment:
"workloadIdentity": "astro-great-release-name@provider-account.iam.gserviceaccount.com",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -829,7 +829,7 @@ deployment:
"workloadIdentity": "astro-great-release-name@provider-account.iam.gserviceaccount.com",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -921,7 +921,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -1039,7 +1039,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -1201,7 +1201,7 @@ deployment:
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -1331,7 +1331,7 @@ deployment:
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -1488,7 +1488,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -1554,7 +1554,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -1630,7 +1630,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -1707,7 +1707,7 @@ deployment:
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -1806,7 +1806,7 @@ deployment:
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -1897,7 +1897,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -2035,7 +2035,7 @@ deployment:
status: HEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -2205,7 +2205,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -2333,7 +2333,7 @@ deployment:
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -2473,7 +2473,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -2549,7 +2549,7 @@ deployment:
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down Expand Up @@ -2652,7 +2652,7 @@ deployment:
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down
8 changes: 4 additions & 4 deletions cloud/deployment/inspect/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ func TestGetDeploymentInspectInfo(t *testing.T) {
testUtil.InitTestConfig(testUtil.CloudPlatform)
mockCoreClient.On("ListDeploymentsWithResponse", mock.Anything, deploymentListParams).Return(mockCoreDeploymentResponse, nil).Once()
expectedCloudDomainURL := "cloud.astronomer.io/" + sourceDeployment.Workspace.ID +
"/deployments/" + sourceDeployment.ID + "/analytics"
"/deployments/" + sourceDeployment.ID + "/overview"
expectedDeploymentMetadata := deploymentMetadata{
DeploymentID: &sourceDeployment.ID,
WorkspaceID: &sourceDeployment.Workspace.ID,
Expand All @@ -443,7 +443,7 @@ func TestGetDeploymentInspectInfo(t *testing.T) {
var actualDeploymentMeta deploymentMetadata
testUtil.InitTestConfig(testUtil.LocalPlatform)
expectedCloudDomainURL := "localhost:5000/" + sourceDeployment.Workspace.ID +
"/deployments/" + sourceDeployment.ID + "/analytics"
"/deployments/" + sourceDeployment.ID + "/overview"
expectedDeploymentMetadata := deploymentMetadata{
DeploymentID: &sourceDeployment.ID,
WorkspaceID: &sourceDeployment.Workspace.ID,
Expand Down Expand Up @@ -942,7 +942,7 @@ func TestFormatPrintableDeployment(t *testing.T) {
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- email1
Expand Down Expand Up @@ -1093,7 +1093,7 @@ func TestFormatPrintableDeployment(t *testing.T) {
"status": "UNHEALTHY",
"created_at": "2022-11-17T12:26:45.362983-08:00",
"updated_at": "2022-11-17T12:26:45.362983-08:00",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics",
"deployment_url": "cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview",
"webserver_url": "some-url"
},
"alert_emails": [
Expand Down
4 changes: 2 additions & 2 deletions cmd/cloud/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down Expand Up @@ -592,7 +592,7 @@ deployment:
status: UNHEALTHY
created_at: 2022-11-17T13:25:55.275697-08:00
updated_at: 2022-11-17T13:25:55.275697-08:00
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/analytics
deployment_url: cloud.astronomer.io/test-ws-id/deployments/test-deployment-id/overview
webserver_url: some-url
alert_emails:
- [email protected]
Expand Down

0 comments on commit e662c3a

Please sign in to comment.