You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Warn(fmt.Sprintf("Failed to get best common ancestor commit between source branch: %s and target branch: %s, defaulting to target branch commit. Error: %s", pullRequestDetails.Source.Name, target.Name, e.Error()))
log.Warn(fmt.Sprintf("Failed to get best common ancestor commit between source branch: %s and target branch: %s, defaulting to target branch commit. Error: %s", gitDetails.PullRequestDetails.Source.Name, target.Name, e.Error()))
// We apply the configProfile to all received repositories. This loop must be deleted when we will no longer accept multiple repositories in a single scan
// This function attempts to fetch a config profile if JF_USE_CONFIG_PROFILE is set to true.
797
+
// If we need to use a profile, we first try to get the profile by name that can be provided through JF_CONFIG_PROFILE. If name is provided but profile doesn't exist we return an error.
798
+
// If we need to use a profile, but name is not provided, we check if there is a config profile associated to the repo URL.
799
+
// When a profile is found we verify several conditions on it.
800
+
// If a profile was requested but not found by url nor by name we return an error.
log.Debug(fmt.Sprintf("Configuration Profile usage is disabled. All configurations will be derived from environment variables and files.\nTo enable a Configuration Profile, please set %s to TRUE", JfrogUseConfigProfileEnv))
805
+
return
806
+
}
807
+
808
+
// Attempt to get the config profile by profile's name
797
809
profileName:=getTrimmedEnv(JfrogConfigProfileEnv)
798
-
ifprofileName=="" {
799
-
log.Debug(fmt.Sprintf("No %s environment variable was provided. All configurations will be induced from Env vars and files", JfrogConfigProfileEnv))
810
+
ifprofileName!="" {
811
+
log.Debug(fmt.Sprintf("Configuration profile was requested. Searching profile by provided name '%s'", profileName))
// Currently, only a single Module that represents the entire project is supported
808
837
iflen(configProfile.Modules) !=1 {
809
838
err=fmt.Errorf("more than one module was found '%s' profile. Frogbot currently supports only one module per config profile", configProfile.ProfileName)
810
839
return
811
840
}
812
841
ifconfigProfile.Modules[0].PathFromRoot!="." {
813
-
err=fmt.Errorf("module '%s' in profile '%s' contains the following path from root: '%s'. Frogbot currently supports only a single module with a '.' path from root", configProfile.Modules[0].ModuleName, profileName, configProfile.Modules[0].PathFromRoot)
842
+
err=fmt.Errorf("module '%s' in profile '%s' contains the following path from root: '%s'. Frogbot currently supports only a single module with a '.' path from root", configProfile.Modules[0].ModuleName, configProfile.ProfileName, configProfile.Modules[0].PathFromRoot)
814
843
return
815
844
}
816
-
log.Info(fmt.Sprintf("Using Config profile '%s'. jfrog-apps-config will be ignored if exists", profileName))
845
+
log.Info(fmt.Sprintf("Using Config profile '%s'. jfrog-apps-config will be ignored if exists", configProfile.ProfileName))
0 commit comments