MM-51792 Replace Boards feature flag with env var (#22739)
* remove Boards feature flag from server, makefile, and docker * Update server/boards/server/boards_service_util.go Co-authored-by: Miguel de la Cruz <miguel@mcrx.me> --------- Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Этот коммит содержится в:
@@ -51,9 +51,6 @@ type FeatureFlags struct {
|
|||||||
|
|
||||||
CommandPalette bool
|
CommandPalette bool
|
||||||
|
|
||||||
// Enable Boards as a product (multi-product architecture)
|
|
||||||
BoardsProduct bool
|
|
||||||
|
|
||||||
// A/B Test on posting a welcome message
|
// A/B Test on posting a welcome message
|
||||||
SendWelcomePost bool
|
SendWelcomePost bool
|
||||||
|
|
||||||
@@ -95,7 +92,6 @@ func (f *FeatureFlags) SetDefaults() {
|
|||||||
f.InsightsEnabled = true
|
f.InsightsEnabled = true
|
||||||
f.CommandPalette = false
|
f.CommandPalette = false
|
||||||
f.CallsEnabled = true
|
f.CallsEnabled = true
|
||||||
f.BoardsProduct = false
|
|
||||||
f.SendWelcomePost = true
|
f.SendWelcomePost = true
|
||||||
f.PostPriority = true
|
f.PostPriority = true
|
||||||
f.PeopleProduct = false
|
f.PeopleProduct = false
|
||||||
|
|||||||
@@ -86,9 +86,6 @@ else
|
|||||||
BUILD_CLIENT = false
|
BUILD_CLIENT = false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Boards
|
|
||||||
export MM_FEATUREFLAGS_BoardsProduct=true
|
|
||||||
|
|
||||||
# We need current user's UID for `run-haserver` so docker compose does not run server
|
# We need current user's UID for `run-haserver` so docker compose does not run server
|
||||||
# as root and mess up file permissions for devs. When running like this HOME will be blank
|
# as root and mess up file permissions for devs. When running like this HOME will be blank
|
||||||
# and docker will add '/', so we need to set the go-build cache location or we'll get
|
# and docker will add '/', so we need to set the go-build cache location or we'll get
|
||||||
@@ -453,9 +450,9 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test-server-race: test-server-pre
|
test-server-race: test-server-pre
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=false ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=true ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_FEATUREFLAGS_BoardsProduct=false ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "-race $(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "90m" "atomic"
|
||||||
ifneq ($(IS_CI),true)
|
ifneq ($(IS_CI),true)
|
||||||
ifneq ($(MM_NO_DOCKER),true)
|
ifneq ($(MM_NO_DOCKER),true)
|
||||||
ifneq ($(TEMP_DOCKER_SERVICES),)
|
ifneq ($(TEMP_DOCKER_SERVICES),)
|
||||||
@@ -466,9 +463,9 @@ ifneq ($(IS_CI),true)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test-server: test-server-pre
|
test-server: test-server-pre
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=false ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(TE_PACKAGES) $(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=true ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(BOARDS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_FEATUREFLAGS_BoardsProduct=false ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(PLAYBOOKS_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "45m" "count"
|
||||||
ifneq ($(IS_CI),true)
|
ifneq ($(IS_CI),true)
|
||||||
ifneq ($(MM_NO_DOCKER),true)
|
ifneq ($(MM_NO_DOCKER),true)
|
||||||
ifneq ($(TEMP_DOCKER_SERVICES),)
|
ifneq ($(TEMP_DOCKER_SERVICES),)
|
||||||
@@ -480,19 +477,19 @@ endif
|
|||||||
|
|
||||||
test-server-ee: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs EE tests.
|
test-server-ee: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs EE tests.
|
||||||
@echo Running only EE tests
|
@echo Running only EE tests
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=false ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "20m" "count"
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true ./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)" "20m" "count"
|
||||||
|
|
||||||
test-server-quick: check-prereqs-enterprise ## Runs only quick tests.
|
test-server-quick: check-prereqs-enterprise ## Runs only quick tests.
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@echo Running all tests
|
@echo Running all tests
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=false $(GO) test $(GOFLAGS) -short $(TE_PACKAGES) $(EE_PACKAGES)
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(TE_PACKAGES) $(EE_PACKAGES)
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=true $(GO) test $(GOFLAGS) -short $(BOARDS_PACKAGES)
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false $(GO) test $(GOFLAGS) -short $(BOARDS_PACKAGES)
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_FEATUREFLAGS_BoardsProduct=false $(GO) test $(GOFLAGS) -short $(PLAYBOOKS_PACKAGES)
|
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(PLAYBOOKS_PACKAGES)
|
||||||
else
|
else
|
||||||
@echo Running only TE tests
|
@echo Running only TE tests
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=false $(GO) test $(GOFLAGS) -short $(TE_PACKAGES)
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(TE_PACKAGES)
|
||||||
MM_DISABLE_PLAYBOOKS=true MM_FEATUREFLAGS_BoardsProduct=true $(GO) test $(GOFLAGS) -short $(BOARDS_PACKAGES)
|
MM_DISABLE_PLAYBOOKS=true MM_DISABLE_BOARDS=false $(GO) test $(GOFLAGS) -short $(BOARDS_PACKAGES)
|
||||||
MM_DISABLE_PLAYBOOKS=false MM_FEATUREFLAGS_BoardsProduct=false $(GO) test $(GOFLAGS) -short $(PLAYBOOKS_PACKAGES)
|
MM_DISABLE_PLAYBOOKS=false MM_DISABLE_BOARDS=true $(GO) test $(GOFLAGS) -short $(PLAYBOOKS_PACKAGES)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
internal-test-web-client: ## Runs web client tests.
|
internal-test-web-client: ## Runs web client tests.
|
||||||
|
|||||||
@@ -222,11 +222,6 @@ func populateServices(boardsProd *boardsProduct, services map[product.ServiceKey
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (bp *boardsProduct) Start() error {
|
func (bp *boardsProduct) Start() error {
|
||||||
if !bp.configService.Config().FeatureFlags.BoardsProduct {
|
|
||||||
bp.logger.Info("Boards product disabled via feature flag")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
bp.logger.Info("Starting boards service")
|
bp.logger.Info("Starting boards service")
|
||||||
|
|
||||||
adapter := newServiceAPIAdapter(bp)
|
adapter := newServiceAPIAdapter(bp)
|
||||||
|
|||||||
@@ -80,12 +80,8 @@ func CreateBoardsConfig(mmconfig mm_model.Config, baseURL string, serverID strin
|
|||||||
showFullName = *mmconfig.PrivacySettings.ShowFullName
|
showFullName = *mmconfig.PrivacySettings.ShowFullName
|
||||||
}
|
}
|
||||||
|
|
||||||
serverRoot := baseURL + "/plugins/focalboard"
|
|
||||||
if mmconfig.FeatureFlags.BoardsProduct {
|
|
||||||
serverRoot = baseURL + "/boards"
|
|
||||||
}
|
|
||||||
return &config.Configuration{
|
return &config.Configuration{
|
||||||
ServerRoot: serverRoot,
|
ServerRoot: baseURL + "/boards",
|
||||||
Port: -1,
|
Port: -1,
|
||||||
DBType: *mmconfig.SqlSettings.DriverName,
|
DBType: *mmconfig.SqlSettings.DriverName,
|
||||||
DBConfigString: *mmconfig.SqlSettings.DataSource,
|
DBConfigString: *mmconfig.SqlSettings.DataSource,
|
||||||
|
|||||||
@@ -72,14 +72,14 @@ func (s *Server) initializeProducts(
|
|||||||
|
|
||||||
func (s *Server) shouldStart(product string) bool {
|
func (s *Server) shouldStart(product string) bool {
|
||||||
if product == "boards" {
|
if product == "boards" {
|
||||||
if !s.Config().FeatureFlags.BoardsProduct {
|
if os.Getenv("MM_DISABLE_BOARDS") == "true" {
|
||||||
s.Log().Warn("Skipping boards start: not enabled via feature flag")
|
s.Log().Warn("Skipping Boards start: disabled via env var")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if product == "playbooks" {
|
if product == "playbooks" {
|
||||||
if os.Getenv("MM_DISABLE_PLAYBOOKS") == "true" {
|
if os.Getenv("MM_DISABLE_PLAYBOOKS") == "true" {
|
||||||
s.Log().Warn("Skipping playbooks start: disabled via env var")
|
s.Log().Warn("Skipping Playbooks start: disabled via env var")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ services:
|
|||||||
- "RUN_SERVER_IN_BACKGROUND=false"
|
- "RUN_SERVER_IN_BACKGROUND=false"
|
||||||
- "MM_CLUSTERSETTINGS_ENABLE=true"
|
- "MM_CLUSTERSETTINGS_ENABLE=true"
|
||||||
- "MM_CLUSTERSETTINGS_CLUSTERNAME=mm_dev_cluster"
|
- "MM_CLUSTERSETTINGS_CLUSTERNAME=mm_dev_cluster"
|
||||||
- "MM_FEATUREFLAGS_BoardsProduct=true"
|
|
||||||
networks:
|
networks:
|
||||||
- mm-test
|
- mm-test
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -147,7 +146,6 @@ services:
|
|||||||
- "RUN_SERVER_IN_BACKGROUND=false"
|
- "RUN_SERVER_IN_BACKGROUND=false"
|
||||||
- "MM_CLUSTERSETTINGS_ENABLE=true"
|
- "MM_CLUSTERSETTINGS_ENABLE=true"
|
||||||
- "MM_CLUSTERSETTINGS_CLUSTERNAME=mm_dev_cluster"
|
- "MM_CLUSTERSETTINGS_CLUSTERNAME=mm_dev_cluster"
|
||||||
- "MM_FEATUREFLAGS_BoardsProduct=true"
|
|
||||||
networks:
|
networks:
|
||||||
- mm-test
|
- mm-test
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -185,7 +183,6 @@ services:
|
|||||||
- "RUN_SERVER_IN_BACKGROUND=false"
|
- "RUN_SERVER_IN_BACKGROUND=false"
|
||||||
- "MM_CLUSTERSETTINGS_ENABLE=true"
|
- "MM_CLUSTERSETTINGS_ENABLE=true"
|
||||||
- "MM_CLUSTERSETTINGS_CLUSTERNAME=mm_dev_cluster"
|
- "MM_CLUSTERSETTINGS_CLUSTERNAME=mm_dev_cluster"
|
||||||
- "MM_FEATUREFLAGS_BoardsProduct=true"
|
|
||||||
networks:
|
networks:
|
||||||
- mm-test
|
- mm-test
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user