Exemple #1
0
 static bool CheckValidStatusPropertyFieldsForIssueTracker(
     TrunkBotConfiguration.StatusProperty botConfig,
     string groupNameMessage,
     out string errorMessage)
 {
     return(CheckValidStatusPropertyFieldsForPlasticAttr(
                false, botConfig, groupNameMessage, out errorMessage));
 }
Exemple #2
0
 static bool CheckValidStatusPropertyFieldsForPlasticAttr(
     bool bIsApprovedCodeReviewFilterEnabled,
     TrunkBotConfiguration.StatusProperty botConfig,
     string groupNameMessage,
     out string errorMessage)
 {
     return(CheckValidStatusPropertyFields(
                bIsApprovedCodeReviewFilterEnabled, botConfig, groupNameMessage, out errorMessage));
 }
Exemple #3
0
        static bool CheckValidStatusPropertyFields(
            bool bIsApprovedCodeReviewFilterEnabled,
            TrunkBotConfiguration.StatusProperty botConfig,
            string groupNameMessage,
            out string errorMessage)
        {
            errorMessage = string.Empty;

            if (string.IsNullOrEmpty(botConfig.Name))
            {
                errorMessage += BuildFieldError("name " + groupNameMessage);
            }

            if (string.IsNullOrEmpty(botConfig.ResolvedValue) && !bIsApprovedCodeReviewFilterEnabled)
            {
                errorMessage += BuildFieldError("resolved value " + groupNameMessage);
            }

            if (string.IsNullOrEmpty(botConfig.FailedValue) && !bIsApprovedCodeReviewFilterEnabled)
            {
                errorMessage += BuildFieldError("failed value " + groupNameMessage);
            }

            if (string.IsNullOrEmpty(botConfig.MergedValue))
            {
                errorMessage += BuildFieldError("merged value " + groupNameMessage);
            }

            if (!string.IsNullOrEmpty(botConfig.ResolvedValue) &&
                !string.IsNullOrEmpty(botConfig.MergedValue) &&
                botConfig.ResolvedValue.Equals(
                    botConfig.MergedValue, StringComparison.InvariantCultureIgnoreCase))
            {
                errorMessage += string.Format(
                    "The 'merged' attribute value: [{0}] must " +
                    "be different than 'resolved' attribute value: [{1}] (case insensitive)\n",
                    botConfig.ResolvedValue, botConfig.MergedValue);
            }

            if (!string.IsNullOrEmpty(botConfig.ResolvedValue) &&
                !string.IsNullOrEmpty(botConfig.FailedValue) &&
                botConfig.ResolvedValue.Equals(
                    botConfig.FailedValue, StringComparison.InvariantCultureIgnoreCase))
            {
                errorMessage += string.Format(
                    "The 'failed' attribute value: [{0}] must " +
                    "be different than 'resolved' attribute value: [{1}] (case insensitive)\n",
                    botConfig.ResolvedValue, botConfig.FailedValue);
            }

            return(string.IsNullOrEmpty(errorMessage));
        }