예제 #1
0
        public static bool CheckValidPlasticFields(
            MultilinerBotConfiguration.PlasticSCM botConfig,
            out string errorMessage)
        {
            errorMessage = string.Empty;

            string fieldNameBeingChecked = "Branch lifecycle";

            if (botConfig == null)
            {
                errorMessage = BuildFieldError(fieldNameBeingChecked);
                return(false);
            }

            if (!AreAnyFiltersDefined(botConfig))
            {
                errorMessage = BuildNoFiltersEnabledErrorMessage(fieldNameBeingChecked);
                return(false);
            }

            string propertyErrorMessage = null;

            if (!CheckValidStatusPropertyFieldsForPlasticAttr(
                    botConfig.IsApprovedCodeReviewFilterEnabled,
                    botConfig.StatusAttribute,
                    "of the status attribute for Plastic config",
                    out propertyErrorMessage))
            {
                errorMessage += propertyErrorMessage;
            }

            return(string.IsNullOrEmpty(errorMessage));
        }
예제 #2
0
        static bool AreAnyFiltersDefined(MultilinerBotConfiguration.PlasticSCM botConfig)
        {
            if (botConfig.IsApprovedCodeReviewFilterEnabled)
            {
                return(true);
            }

            if (string.IsNullOrWhiteSpace(botConfig.StatusAttribute.Name))
            {
                return(false);
            }

            if (string.IsNullOrWhiteSpace(botConfig.StatusAttribute.ResolvedValue))
            {
                return(false);
            }

            return(true);
        }