-
Notifications
You must be signed in to change notification settings - Fork 29
feat: add GetDynamicDashboard to DashboardService #441
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
73a8e8f
feat: add GetDynamicDashboard to DashboardService
NickJosevski bdb4d3f
fix: complete DashboardItem and document that the dashboard filters o…
NickJosevski e8dacf3
fix: model environment Links and add dashboard e2e coverage
NickJosevski 66fdcff
test: skip dashboard e2e assertions on an instance with no deployments
NickJosevski f7ae233
feat: add interruptions.InterruptionType and use it on DashboardItem
NickJosevski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| package dashboard | ||
|
|
||
| import ( | ||
| "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/resources" | ||
| ) | ||
|
|
||
| // Dashboard represents the deployment overview returned by the dashboard and | ||
| // dynamic dashboard endpoints: the deployments themselves in Items, plus the | ||
| // reference data needed to resolve the IDs those items carry. | ||
| type Dashboard struct { | ||
| Items []*DashboardItem `json:"Items"` | ||
| Projects []*DashboardProject `json:"Projects"` | ||
| ProjectGroups []*DashboardProjectGroup `json:"ProjectGroups"` | ||
| Environments []*DashboardEnvironment `json:"Environments"` | ||
| Tenants []*DashboardTenant `json:"Tenants"` | ||
|
|
||
| // ProjectLimit is set when the server caps how many projects the dashboard | ||
| // reports on, and is nil when no cap applies. Callers showing a full list | ||
| // should say so rather than presenting capped results as complete. | ||
| ProjectLimit *int `json:"ProjectLimit"` | ||
|
|
||
| // IsFiltered reports whether the server narrowed the response, either from | ||
| // the query or from the caller's permissions. | ||
| IsFiltered bool `json:"IsFiltered"` | ||
|
|
||
| resources.Resource | ||
| } | ||
|
|
||
| // DashboardProject is the subset of a project the dashboard returns to | ||
| // accompany its items. | ||
| type DashboardProject struct { | ||
| Name string `json:"Name,omitempty"` | ||
| Slug string `json:"Slug,omitempty"` | ||
| ProjectGroupID string `json:"ProjectGroupId,omitempty"` | ||
| EnvironmentIDs []string `json:"EnvironmentIds,omitempty"` | ||
| TenantedDeploymentMode string `json:"TenantedDeploymentMode,omitempty"` | ||
| CanPerformUntenantedDeployment bool `json:"CanPerformUntenantedDeployment"` | ||
| IsDisabled bool `json:"IsDisabled"` | ||
|
|
||
| resources.Resource | ||
| } | ||
|
|
||
| // DashboardEnvironment is the subset of an environment the dashboard returns to | ||
| // accompany its items. | ||
| type DashboardEnvironment struct { | ||
| Name string `json:"Name,omitempty"` | ||
|
|
||
| resources.Resource | ||
| } | ||
|
|
||
| // DashboardProjectGroup is the subset of a project group the dashboard returns | ||
| // to accompany its items. | ||
| type DashboardProjectGroup struct { | ||
| Name string `json:"Name,omitempty"` | ||
| EnvironmentIDs []string `json:"EnvironmentIds,omitempty"` | ||
|
|
||
| resources.Resource | ||
| } | ||
|
|
||
| // DashboardTenant is the subset of a tenant the dashboard returns to accompany | ||
| // its items. | ||
| type DashboardTenant struct { | ||
| Name string `json:"Name,omitempty"` | ||
| TenantTags []string `json:"TenantTags,omitempty"` | ||
| ProjectEnvironments map[string][]string `json:"ProjectEnvironments,omitempty"` | ||
| IsDisabled bool `json:"IsDisabled"` | ||
|
|
||
| resources.Resource | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,12 @@ | ||
| package dashboard | ||
|
|
||
| type DashboardDynamicQuery struct { | ||
| // Environments narrows the dashboard to these environments. The server | ||
| // matches on ID only: an environment name matches nothing and yields an | ||
| // empty dashboard rather than an error. | ||
| Environments []string `uri:"environments,omitempty" url:"environments,omitempty"` | ||
| IncludePrevious bool `uri:"includePrevious,omitempty" url:"includePrevious,omitempty"` | ||
| Projects []string `uri:"projects,omitempty" url:"projects,omitempty"` | ||
| // Projects narrows the dashboard to these projects. As with Environments, | ||
| // the server matches on ID only. | ||
| Projects []string `uri:"projects,omitempty" url:"projects,omitempty"` | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,43 @@ | ||
| package dashboard | ||
|
|
||
| import "time" | ||
| import ( | ||
| "time" | ||
|
|
||
| "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/interruptions" | ||
| "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/resources" | ||
| ) | ||
|
|
||
| type DashboardItem struct { | ||
| ChannelID string `json:"ChannelId,omitempty"` | ||
| CompletedTime *time.Time `json:"CompletedTime,omitempty"` | ||
| Created *time.Time `json:"Created,omitempty"` | ||
| DeploymentID string `json:"DeploymentId,omitempty"` | ||
| Duration string `json:"Duration,omitempty"` | ||
| EnvironmentID string `json:"EnvironmentId,omitempty"` | ||
| ErrorMessage string `json:"ErrorMessage,omitempty"` | ||
| HasPendingInterruptions bool `json:"HasPendingInterruptions"` | ||
| HasWarningsOrErrors bool `json:"HasWarningsOrErrors"` | ||
| IsCompleted bool `json:"IsCompleted"` | ||
| IsCurrent bool `json:"IsCurrent"` | ||
| IsPrevious bool `json:"IsPrevious"` | ||
| ProjectID string `json:"ProjectId,omitempty"` | ||
| QueueTime *time.Time `json:"QueueTime,omitempty"` | ||
| ReleaseID string `json:"ReleaseId,omitempty"` | ||
| ReleaseVersion string `json:"ReleaseVersion,omitempty"` | ||
| StartTime *time.Time `json:"StartTime,omitempty"` | ||
| ChannelID string `json:"ChannelId,omitempty"` | ||
| CompletedTime *time.Time `json:"CompletedTime,omitempty"` | ||
| Created *time.Time `json:"Created,omitempty"` | ||
| DeploymentID string `json:"DeploymentId,omitempty"` | ||
| Duration string `json:"Duration,omitempty"` | ||
| EnvironmentID string `json:"EnvironmentId,omitempty"` | ||
| ErrorMessage string `json:"ErrorMessage,omitempty"` | ||
| HasPendingInterruptions bool `json:"HasPendingInterruptions"` | ||
| HasPendingPreconditions bool `json:"HasPendingPreconditions"` | ||
| HasWarningsOrErrors bool `json:"HasWarningsOrErrors"` | ||
| IsCompleted bool `json:"IsCompleted"` | ||
| IsCurrent bool `json:"IsCurrent"` | ||
| IsPrevious bool `json:"IsPrevious"` | ||
| PendingInterruptionTypes []interruptions.InterruptionType `json:"PendingInterruptionTypes,omitempty"` | ||
| // PendingPreconditionTypes is an open set of strings server side rather than | ||
| // a fixed enum, so it is not typed. | ||
| PendingPreconditionTypes []string `json:"PendingPreconditionTypes,omitempty"` | ||
| ProjectID string `json:"ProjectId,omitempty"` | ||
| QueueTime *time.Time `json:"QueueTime,omitempty"` | ||
| ReleaseID string `json:"ReleaseId,omitempty"` | ||
| ReleaseVersion string `json:"ReleaseVersion,omitempty"` | ||
| StartTime *time.Time `json:"StartTime,omitempty"` | ||
|
|
||
| // Enum: [Canceled Cancelling Executing Failed Queued Success TimedOut] | ||
| State string `json:"State,omitempty"` | ||
| TaskID string `json:"TaskId,omitempty"` | ||
| TenantID string `json:"TenantId,omitempty"` | ||
|
|
||
| // Resource carries the item's own Id and Links, which the dashboard returns | ||
| // for each item and which callers need to reach the deployment, release and | ||
| // task without reassembling paths from the IDs above. | ||
| resources.Resource | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.