Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.23.12

require (
github.com/aws/aws-sdk-go v1.44.100
github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd
github.com/codeready-toolchain/api v0.0.0-20251111133521-6e510c9bd2ee
github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1
github.com/go-logr/logr v1.4.2
github.com/gofrs/uuid v4.2.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtM
github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd h1:A6WOUwlUdgOf4PDzzgKvycRj4Pk+1F6npWV4YoPVFcM=
github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd/go.mod h1:TiQ/yNv3cGL4nxo3fgRtcHyYYuRf+nAgs6B1IAqvxOU=
github.com/codeready-toolchain/api v0.0.0-20251111133521-6e510c9bd2ee h1:xuUh5aTG6NEG+HDs9e6QomAmHd/5gff7KtLJbbAR9y8=
github.com/codeready-toolchain/api v0.0.0-20251111133521-6e510c9bd2ee/go.mod h1:TiQ/yNv3cGL4nxo3fgRtcHyYYuRf+nAgs6B1IAqvxOU=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1 h1:jqs4yOuJbfW3CKe1EMJkkDo47wTKQ4M1OKox4DYWsKg=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1/go.mod h1:eySMK8JR/Py9eoUJlAkOXqvfPp1vjl39scgrECr99XM=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
Expand Down
4 changes: 4 additions & 0 deletions pkg/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ func (r RegistrationServiceConfig) UICanaryDeploymentWeight() int {
return commonconfig.GetInt(r.cfg.Host.RegistrationService.UICanaryDeploymentWeight, 20)
}

func (r RegistrationServiceConfig) WorkatoWebHookURL() string {
return commonconfig.GetString(r.cfg.Host.RegistrationService.WorkatoWebHookURL, "")
}

type AnalyticsConfig struct {
c toolchainv1alpha1.RegistrationServiceAnalyticsConfig
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/uiconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ type UIConfigResponse struct {
// Holds to weight specifying up to how many users ( in percentage ) should use the new UI.
// NOTE: this is a temporary parameter, it will be removed once we switch all the users to the new UI.
UICanaryDeploymentWeight int `json:"uiCanaryDeploymentWeight"`

WorkatoWebHookURL string `json:"workatoWebHookURL"`
}

// UIConfig implements the ui config endpoint, which is invoked to
Expand All @@ -28,6 +30,7 @@ func (uic *UIConfig) GetHandler(ctx *gin.Context) {
cfg := configuration.GetRegistrationServiceConfig()
configRespData := UIConfigResponse{
UICanaryDeploymentWeight: cfg.UICanaryDeploymentWeight(),
WorkatoWebHookURL: cfg.WorkatoWebHookURL(),
}
ctx.JSON(http.StatusOK, configRespData)
}
7 changes: 6 additions & 1 deletion pkg/controller/uiconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ func (s *TestUIConfigSuite) TestUIConfigHandler() {
// Check if the config is set to testing mode, so the handler may use this.
assert.True(s.T(), configuration.IsTestingMode(), "testing mode not set correctly to true")
s.OverrideApplicationDefault(testconfig.RegistrationService().
RegistrationServiceURL("https://signup.domain.com"))
RegistrationServiceURL("https://signup.domain.com"),
)
defer s.DefaultConfig()
cfg := configuration.GetRegistrationServiceConfig()

Expand Down Expand Up @@ -63,5 +64,9 @@ func (s *TestUIConfigSuite) TestUIConfigHandler() {
s.Run("uiCanaryDeploymentWeight", func() {
assert.Equal(s.T(), cfg.UICanaryDeploymentWeight(), data.UICanaryDeploymentWeight, "wrong 'UICanaryDeploymentWeight' in uiconfig response")
})

s.Run("workatoWebHookURL", func() {
assert.Equal(s.T(), cfg.WorkatoWebHookURL(), data.WorkatoWebHookURL, "wrong 'WorkatoWebHookURL' in uiconfig response")
})
})
}
Loading