Manager: allow setup to finish without Blender #104306

Manually merged
Sybren A. Stüvel merged 34 commits from abelli/flamenco:issue100195 into main 2024-09-09 11:22:42 +02:00
Showing only changes of commit 7cac860d4a - Show all commits

View File

@ -15,6 +15,7 @@ import (
"strings" "strings"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"
"github.com/rs/zerolog"
"projects.blender.org/studio/flamenco/internal/appinfo" "projects.blender.org/studio/flamenco/internal/appinfo"
"projects.blender.org/studio/flamenco/internal/find_blender" "projects.blender.org/studio/flamenco/internal/find_blender"
"projects.blender.org/studio/flamenco/internal/manager/config" "projects.blender.org/studio/flamenco/internal/manager/config"
@ -266,9 +267,9 @@ func (f *Flamenco) SaveSetupAssistantConfig(e echo.Context) error {
logger = logger.With().Interface("config", setupAssistantCfg).Logger() logger = logger.With().Interface("config", setupAssistantCfg).Logger()
if setupAssistantCfg.StorageLocation == "" || if setupAssistantCfg.StorageLocation == "" ||
isBlenderPathCheckResultIncomplete(setupAssistantCfg.BlenderExecutable) { isBlenderPathCheckResultIncomplete(setupAssistantCfg.BlenderExecutable, logger) {
logger.Warn().Msg("setup assistant: configuration is invalid or incomplete, unable to accept") logger.Warn().Msg("setup assistant: configuration is incomplete, unable to accept")
return sendAPIError(e, http.StatusBadRequest, "configuration is invalid or incomplete") return sendAPIError(e, http.StatusBadRequest, "configuration is incomplete")
} }
conf := f.config.Get() conf := f.config.Get()
@ -336,7 +337,7 @@ func commandNeedsQuoting(cmd string) bool {
return strings.ContainsAny(cmd, "\n\t;()") return strings.ContainsAny(cmd, "\n\t;()")
} }
func isBlenderPathCheckResultIncomplete(checkResult api.BlenderPathCheckResult) bool { func isBlenderPathCheckResultIncomplete(checkResult api.BlenderPathCheckResult, logger zerolog.Logger) bool {
switch checkResult.Source { switch checkResult.Source {
case api.BlenderPathSourceDefault: case api.BlenderPathSourceDefault:
if !checkResult.IsUsable { if !checkResult.IsUsable {
@ -357,5 +358,7 @@ func isBlenderPathCheckResultIncomplete(checkResult api.BlenderPathCheckResult)
} }
return false return false
} }
logger.Warn().Msg("received an unexpected blender path source")
return true return true
} }