Skip to content

Commit 7d96932

Browse files
Andrew Farriesroboquat
authored andcommitted
Make server githubApp configurable
Default to the existing default value, but allow the value to be overriden by a new experimental config value.
1 parent e05f015 commit 7d96932

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

install/installer/pkg/components/server/configmap.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
4848
return nil
4949
})
5050

51+
githubApp := GitHubApp{}
52+
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
53+
if cfg.WebApp != nil && cfg.WebApp.GithubApp != nil {
54+
githubApp.AppId = cfg.WebApp.GithubApp.AppId
55+
githubApp.AuthProviderId = cfg.WebApp.GithubApp.AuthProviderId
56+
githubApp.BaseUrl = cfg.WebApp.GithubApp.BaseUrl
57+
githubApp.CertPath = cfg.WebApp.GithubApp.CertPath
58+
githubApp.Enabled = cfg.WebApp.GithubApp.Enabled
59+
githubApp.LogLevel = cfg.WebApp.GithubApp.LogLevel
60+
githubApp.MarketplaceName = cfg.WebApp.GithubApp.MarketplaceName
61+
githubApp.WebhookSecret = cfg.WebApp.GithubApp.WebhookSecret
62+
}
63+
return nil
64+
})
65+
5166
// todo(sje): all these values are configurable
5267
scfg := ConfigSerialized{
5368
Version: ctx.VersionManifest.Version,
@@ -71,6 +86,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
7186
Secret: sessionSecret,
7287
},
7388
DefinitelyGpDisabled: ctx.Config.DisableDefinitelyGP,
89+
GitHubApp: githubApp,
7490
WorkspaceGarbageCollection: WorkspaceGarbageCollection{
7591
ChunkLimit: 1000,
7692
ContentChunkLimit: 1000,

install/installer/pkg/config/v1/experimental/experimental.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ type WebAppConfig struct {
6262
Session struct {
6363
Secret string `json:"secret"`
6464
} `json:"session"`
65+
GithubApp *struct {
66+
AppId int32 `json:"appId"`
67+
AuthProviderId string `json:"authProviderId"`
68+
BaseUrl string `json:"baseUrl"`
69+
CertPath string `json:"certPath"`
70+
Enabled bool `json:"enabled"`
71+
LogLevel string `json:"logLevel"`
72+
MarketplaceName string `json:"marketplaceName"`
73+
WebhookSecret string `json:"webhookSecret"`
74+
CertSecretName string `json:"certSecretName"`
75+
} `json:"githubApp"`
6576
}
6677

6778
type PublicAPIConfig struct {

0 commit comments

Comments
 (0)