gimlet-io / gimlet

Deployment tool built on Kubernetes to make the deploy, preview and rollback workflows accessible to everyone.
https://gimlet.io
Other
333 stars 27 forks source link

chore: split GitopsEnv DTO #807

Closed laszlocph closed 10 months ago

laszlocph commented 10 months ago

The /envs call is fundamental in loading the UI.

But it grew in responsibility to a degree that we spend 1.5 second per environment to collect all data.

1 second is loading the stack definition: https://github.com/gimlet-io/gimlet/blob/main/pkg/dashboard/server/api.go#L145

The goal of this task is to split the GitopsEnv DTO

type GitopsEnv struct {
    Name                        string                 `json:"name"`
    InfraRepo                   string                 `json:"infraRepo"`
    AppsRepo                    string                 `json:"appsRepo"`
    RepoPerEnv                  bool                   `json:"repoPerEnv"`
    KustomizationPerApp         bool                   `json:"kustomizationPerApp"`
    BuiltIn                     bool                   `json:"builtIn"`
    StackConfig                 *dx.StackConfig        `json:"stackConfig"`
    StackDefinition             map[string]interface{} `json:"stackDefinition"`
    DeploymentAutomationEnabled bool                   `json:"deploymentAutomationEnabled"`
}

and move the StackConfig and StackDefinition fields to a new api endpoint.

laszlocph commented 10 months ago

808