Interface VersionedSettingsManager
-
- All Known Implementing Classes:
SecuredVersionedSettingsManager
,VersionedSettingsManagerImpl
public interface VersionedSettingsManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConfigAction
createEnableConfigActionAfterUpgrade(int prevVersion, int curVersion)
boolean
enableVersionedSettings()
Globally enable versioned settings on the server, if the enabling process is not running yet.TriggerRules
excludeSettingRoots(String rules, Collection<SBuildType> buildTypes)
Returns trigger rules which exclude unattached settings VCS roots used in given buildTypes.ProjectSettingsGenerator
findGenerator(String format)
Returns the project settings generator for the specified format or null if no such generator existList<String>
generateSettingsZip(SProject project, File dst, String format, ProjectSettingsGeneratorConfig config)
Generates zip with project settings in the specified format and writes it to the given dst file.String
getCredentialsStorageType(SProject project)
Returns type of theCredentialsStorage
which should be used for versioned settings of the specified project.VersionedSettingsConfig
getEffectiveBuildSettingsConfig(SBuildType buildType)
Returns build settings config of a project where versioned settings VCS root is configured for given buildType's project.VersionedSettingsConfig
getEffectiveBuildSettingsConfig(SProject project)
Returns settings config of a project where versioned settings VCS root is configured for the given project.VersionedSettingsConfig.BuildSettingsMode
getEffectiveBuildSettingsMode(SBuildType buildType)
Returns build settings mode of a project where versioned settings VCS root is configured for given buildType's project.VersionedSettingsConfig.BuildSettingsMode
getEffectiveBuildSettingsMode(SProject project)
Returns build settings mode for given project or null if versioned settings are not configured for given projectString
getEffectiveFormat(SProject project)
Returns effective settings format for the given project or null if versioned settings are not configured in the projectProjectSettingsGenerator
getEffectiveGenerator(SProject project)
Returns effective settings generator for given project or default generator if versioned settings are not configured for given projectProjectSettingsGenerator
getEffectiveGeneratorOrNull(SProject project)
Returns effective settings generator for given project or default generator if versioned settings are not configured for given project, returns null if the generator specified in project settings is not found.Pair<SProject,VersionedSettingsConfig>
getEffectiveProjectConfig(SProject project)
Returns project and settings config of a project where versioned settings VCS root is configured for the given project.ProjectSettingsPaths
getEffectiveProjectSettingsPaths(SProject project)
Returns effective Versioned Settings Files Paths for the given project.Collection<ProjectSettingsGenerator>
getGenerators()
Returns all registered project settings generatorsVersionedSettingsOptions
getOptions()
SVcsRoot
getOwnVersionedSettingsVcsRoot(SProject project)
Returns versioned settings root configured for given project ignoring settings inherited from parent project.Set<SProject>
getProjectsByOwnSettingsRoot(VcsRoot root)
Returns all projects which explicitly use the given VCS root for storing settings ignoring the settings inherited from parent projectSet<SProject>
getProjectsByOwnSettingsRootInstance(VcsRootInstance root)
Returns all projects which explicitly use the given VCS root instance for storing settings, ignoring the settings inherited from the parent projectSet<SProject>
getProjectsBySettingsRoot(VcsRoot root)
Returns all projects which use the given VCS root for storing settingsSet<SProject>
getProjectsBySettingsRootInstance(VcsRootInstance root)
Returns all projects which use the given VCS root instance for storing settingsSet<SProject>
getProjectsWithOwnVersionedSettings()
Returns set of projects where versioned settings are explicitly enabled (does not include projects with 'same as parent' settings).Map<SBuildType,CheckoutRules>
getSettingsRootCheckoutRules(Collection<SBuildType> buildTypes, VcsRootInstance settingsRoot)
Returns settings VCS root checkout rules for a collection of build types if versioned settings are not configured for the build type's project or if different root is used to store settings then returned map will not contain entry for this build typeCheckoutRules
getSettingsRootCheckoutRules(SBuildType buildType, VcsRootInstance settingsRoot)
Returns settings VCS root checkout rules for given build type or null if versioned settings are not configured for the build type's project or if different root is used to store settingsBuildRevision
getSettingsRootRevision(BuildPromotionEx buildPromotion)
Returns a revision of a settings VCS root for the given build promotion or null if build promotion does not have version settings enabled or checking for changes is not done yet.Set<SProject>
getSubProjectsWithSameSettings(SProject project)
Returns transitive sub-projects of the given project which use 'same as parent' versioned settingsSProject
getVersionedSettingsProject(SProject project)
Returns a project where versioned settings VCS root is configured for given project.SVcsRoot
getVersionedSettingsVcsRoot(SProject project)
For given project returns VCS root where project settings are stored.VcsRootInstance
getVersionedSettingsVcsRootInstance(SProject project)
For given project finds VCS root where project settings are stored, then resolves it's parameters using given project as a context.VcsRootInstanceEntry
getVersionedSettingsVcsRootInstanceEntry(SBuildType buildType)
Returns settings VCS root entry for the given build type or null if versioned settings are not configured for the build type's projectboolean
hasVersionedSettings(SProject project)
Returns true if the specified project stores settings in VCS, false otherwiseboolean
isEnableSettingsActionAfterUpgrade(ConfigAction configAction)
boolean
isProjectWithCustomSettingsFormat(SProject project)
Returns true if the specified project uses custom settings format, returns false otherwiseboolean
isProjectWithReadOnlySettingsFormat(SProject project)
Returns true if the specified project uses read-only settings format, returns false otherwise or when configured format is not foundboolean
isShowBranchesFromVersionedSettingsVcsRoot(SBuildType buildType)
Returns true if branches from the versioned settings VCS root should be shown in the context of the build configuration.boolean
isShowSettingsChanges(SProject project)
Returns true if settings changes should be shown in builds in the given projectVersionedSettingsConfig
readConfig(SProject project)
void
setContextParameters(SProject project, Map<String,String> parameters)
boolean
shouldTakeSettingsFromVcs(SBuildType buildType, BuildPromotionEx promotion)
Returns true if the given promotion should take settings from VCS, takes buildType's and promotion's options into account.void
visitProjectsInSettingsRootInstance(VcsRootInstance root, BiConsumer<SProject,VersionedSettingsConfig> consumer)
Visits projects storing settings in the given VCS root instancevoid
writeConfig(ConfigAction cause, SProject project, VersionedSettingsConfig config)
-
-
-
Method Detail
-
getVersionedSettingsVcsRoot
@Nullable SVcsRoot getVersionedSettingsVcsRoot(@NotNull SProject project)
For given project returns VCS root where project settings are stored. Returns null if versioned settings are not configured for given project.- Parameters:
project
-- Returns:
-
getOwnVersionedSettingsVcsRoot
@Nullable SVcsRoot getOwnVersionedSettingsVcsRoot(@NotNull SProject project)
Returns versioned settings root configured for given project ignoring settings inherited from parent project.- Parameters:
project
- project of interest- Returns:
- see above
-
getProjectsWithOwnVersionedSettings
@NotNull Set<SProject> getProjectsWithOwnVersionedSettings()
Returns set of projects where versioned settings are explicitly enabled (does not include projects with 'same as parent' settings).- Returns:
- see above
- Since:
- 9.0.2
-
getVersionedSettingsVcsRootInstance
@Nullable VcsRootInstance getVersionedSettingsVcsRootInstance(@NotNull SProject project)
For given project finds VCS root where project settings are stored, then resolves it's parameters using given project as a context. Returns null if versioned settings are not configured for given project.- Parameters:
project
-- Returns:
-
getProjectsBySettingsRoot
@NotNull Set<SProject> getProjectsBySettingsRoot(@NotNull VcsRoot root)
Returns all projects which use the given VCS root for storing settings- Parameters:
root
- VCS root of interest- Returns:
- see above
-
getProjectsByOwnSettingsRoot
@NotNull Set<SProject> getProjectsByOwnSettingsRoot(@NotNull VcsRoot root)
Returns all projects which explicitly use the given VCS root for storing settings ignoring the settings inherited from parent project- Parameters:
root
- VCS root of interest- Returns:
- see above
-
getProjectsByOwnSettingsRootInstance
@NotNull Set<SProject> getProjectsByOwnSettingsRootInstance(@NotNull VcsRootInstance root)
Returns all projects which explicitly use the given VCS root instance for storing settings, ignoring the settings inherited from the parent project- Parameters:
root
- VCS root instance of interest- Returns:
- see above
-
getProjectsBySettingsRootInstance
@NotNull Set<SProject> getProjectsBySettingsRootInstance(@NotNull VcsRootInstance root)
Returns all projects which use the given VCS root instance for storing settings- Parameters:
root
- VCS root instance of interest- Returns:
- see above
-
visitProjectsInSettingsRootInstance
void visitProjectsInSettingsRootInstance(@NotNull VcsRootInstance root, @NotNull BiConsumer<SProject,VersionedSettingsConfig> consumer)
Visits projects storing settings in the given VCS root instance- Parameters:
root
- VCS root instance of interestconsumer
- is called for every visited project and its config
-
getVersionedSettingsVcsRootInstanceEntry
@Nullable VcsRootInstanceEntry getVersionedSettingsVcsRootInstanceEntry(@NotNull SBuildType buildType)
Returns settings VCS root entry for the given build type or null if versioned settings are not configured for the build type's project- Parameters:
buildType
- build type of interest- Returns:
- see above
-
getSettingsRootCheckoutRules
@Nullable CheckoutRules getSettingsRootCheckoutRules(@NotNull SBuildType buildType, @NotNull VcsRootInstance settingsRoot)
Returns settings VCS root checkout rules for given build type or null if versioned settings are not configured for the build type's project or if different root is used to store settings- Parameters:
buildType
- build type of interestsettingsRoot
- settings root- Returns:
- see above
-
getSettingsRootCheckoutRules
@NotNull Map<SBuildType,CheckoutRules> getSettingsRootCheckoutRules(@NotNull Collection<SBuildType> buildTypes, @NotNull VcsRootInstance settingsRoot)
Returns settings VCS root checkout rules for a collection of build types if versioned settings are not configured for the build type's project or if different root is used to store settings then returned map will not contain entry for this build type- Parameters:
buildTypes
- build types of interestsettingsRoot
- settings root- Returns:
- see above
- Since:
- 2018.1.1
-
getVersionedSettingsProject
@Nullable SProject getVersionedSettingsProject(@NotNull SProject project)
Returns a project where versioned settings VCS root is configured for given project. Returns null if versioned settings are not configured for given project.- Parameters:
project
-- Returns:
-
hasVersionedSettings
boolean hasVersionedSettings(@NotNull SProject project)
Returns true if the specified project stores settings in VCS, false otherwise- Parameters:
project
- project of interest- Returns:
- see above
-
getEffectiveBuildSettingsMode
@Nullable VersionedSettingsConfig.BuildSettingsMode getEffectiveBuildSettingsMode(@NotNull SBuildType buildType)
Returns build settings mode of a project where versioned settings VCS root is configured for given buildType's project. Returns null if versioned settings are not configured for given buildType's project.- Parameters:
buildType
- buildType of interest- Returns:
- see above
-
getEffectiveBuildSettingsConfig
@Nullable VersionedSettingsConfig getEffectiveBuildSettingsConfig(@NotNull SBuildType buildType)
Returns build settings config of a project where versioned settings VCS root is configured for given buildType's project. Returns null if versioned settings are not configured for given buildType's project.- Parameters:
buildType
- buildType of interest- Returns:
- see above
-
getEffectiveBuildSettingsConfig
@Nullable VersionedSettingsConfig getEffectiveBuildSettingsConfig(@NotNull SProject project)
Returns settings config of a project where versioned settings VCS root is configured for the given project. Returns null if versioned settings are not configured for the given project.- Parameters:
buildType
- buildType of interest- Returns:
- see above
-
getEffectiveProjectConfig
@Nullable Pair<SProject,VersionedSettingsConfig> getEffectiveProjectConfig(@NotNull SProject project)
Returns project and settings config of a project where versioned settings VCS root is configured for the given project. Returns null if versioned settings are not configured for the given project- Parameters:
project
- project of interest- Returns:
- see above
-
getEffectiveBuildSettingsMode
@Nullable VersionedSettingsConfig.BuildSettingsMode getEffectiveBuildSettingsMode(@NotNull SProject project)
Returns build settings mode for given project or null if versioned settings are not configured for given project- Parameters:
project
- project of interest- Returns:
- see above
-
readConfig
@NotNull VersionedSettingsConfig readConfig(@NotNull SProject project)
-
writeConfig
void writeConfig(@NotNull ConfigAction cause, @NotNull SProject project, @NotNull VersionedSettingsConfig config)
-
setContextParameters
void setContextParameters(@NotNull SProject project, @NotNull Map<String,String> parameters)
-
excludeSettingRoots
@NotNull TriggerRules excludeSettingRoots(@Nullable String rules, @NotNull Collection<SBuildType> buildTypes)
Returns trigger rules which exclude unattached settings VCS roots used in given buildTypes. If the rules contain a rule for a settings VCS root, then this rule is not modified and no new rules for this root are added- Parameters:
rules
- trigger rules string representationbuildTypes
- buildTypes to process- Returns:
- see above
-
isShowSettingsChanges
boolean isShowSettingsChanges(@NotNull SProject project)
Returns true if settings changes should be shown in builds in the given project- Parameters:
project
- project of interest- Returns:
- see above
-
isShowBranchesFromVersionedSettingsVcsRoot
boolean isShowBranchesFromVersionedSettingsVcsRoot(@NotNull SBuildType buildType)
Returns true if branches from the versioned settings VCS root should be shown in the context of the build configuration. Currently, these branches are shown if versioned settings are enabled in the build configuration project and the "Build settings mode" is either "use VCS" or "prefer VCS".- Parameters:
buildType
-- Returns:
- see above
- Since:
- 2023.11.1
-
getCredentialsStorageType
@Nullable String getCredentialsStorageType(@NotNull SProject project)
Returns type of theCredentialsStorage
which should be used for versioned settings of the specified project. Returns null, if credentials should be stored in scrambled form in project configuration files.- Parameters:
project
- project of interest- Returns:
- see above
- Since:
- 2017.1
-
getSubProjectsWithSameSettings
@NotNull Set<SProject> getSubProjectsWithSameSettings(@NotNull SProject project)
Returns transitive sub-projects of the given project which use 'same as parent' versioned settings- Parameters:
project
- project of interest- Returns:
- see above
-
getOptions
@NotNull VersionedSettingsOptions getOptions()
-
shouldTakeSettingsFromVcs
boolean shouldTakeSettingsFromVcs(@NotNull SBuildType buildType, @NotNull BuildPromotionEx promotion)
Returns true if the given promotion should take settings from VCS, takes buildType's and promotion's options into account.- Parameters:
buildType
- build's buildTypepromotion
- build promotion of interest- Returns:
- see above
-
getEffectiveGenerator
@NotNull ProjectSettingsGenerator getEffectiveGenerator(@NotNull SProject project) throws IllegalArgumentException
Returns effective settings generator for given project or default generator if versioned settings are not configured for given project- Parameters:
project
- project of interest- Returns:
- see above
- Throws:
IllegalArgumentException
- if generator is not found for settings format used in project
-
getEffectiveGeneratorOrNull
@Nullable ProjectSettingsGenerator getEffectiveGeneratorOrNull(@NotNull SProject project)
Returns effective settings generator for given project or default generator if versioned settings are not configured for given project, returns null if the generator specified in project settings is not found.- Parameters:
project
- project of interest- Returns:
- see above
-
getEffectiveFormat
@Nullable String getEffectiveFormat(@NotNull SProject project)
Returns effective settings format for the given project or null if versioned settings are not configured in the project- Parameters:
project
- project of interest- Returns:
- see above
-
isProjectWithCustomSettingsFormat
boolean isProjectWithCustomSettingsFormat(@NotNull SProject project)
Returns true if the specified project uses custom settings format, returns false otherwise- Parameters:
project
- project of interest- Returns:
- see above
-
isProjectWithReadOnlySettingsFormat
boolean isProjectWithReadOnlySettingsFormat(@NotNull SProject project)
Returns true if the specified project uses read-only settings format, returns false otherwise or when configured format is not found- Parameters:
project
- project of interest- Returns:
- see above
-
getGenerators
@NotNull Collection<ProjectSettingsGenerator> getGenerators()
Returns all registered project settings generators- Returns:
- see above
-
findGenerator
@Nullable ProjectSettingsGenerator findGenerator(@NotNull String format)
Returns the project settings generator for the specified format or null if no such generator exist- Parameters:
format
- format of interest- Returns:
- see above
-
generateSettingsZip
@NotNull List<String> generateSettingsZip(@NotNull SProject project, @NotNull File dst, @NotNull String format, @NotNull ProjectSettingsGeneratorConfig config) throws IOException
Generates zip with project settings in the specified format and writes it to the given dst file. Includes settings of the project and all its subprojects with same versioned settings as in parent recursively.- Parameters:
project
- project of interestdst
- destination zip archive fileformat
- formatconfig
- config for generation- Returns:
- list of errors detected during generation
- Throws:
IOException
-
createEnableConfigActionAfterUpgrade
@NotNull ConfigAction createEnableConfigActionAfterUpgrade(int prevVersion, int curVersion)
-
isEnableSettingsActionAfterUpgrade
boolean isEnableSettingsActionAfterUpgrade(@NotNull ConfigAction configAction)
-
enableVersionedSettings
boolean enableVersionedSettings()
Globally enable versioned settings on the server, if the enabling process is not running yet.- Returns:
- true if versioned settings were enabled as a result of this call
-
getEffectiveProjectSettingsPaths
@NotNull ProjectSettingsPaths getEffectiveProjectSettingsPaths(@NotNull SProject project)
Returns effective Versioned Settings Files Paths for the given project.- Returns:
- see above
-
getSettingsRootRevision
@Nullable BuildRevision getSettingsRootRevision(@NotNull BuildPromotionEx buildPromotion)
Returns a revision of a settings VCS root for the given build promotion or null if build promotion does not have version settings enabled or checking for changes is not done yet.- Parameters:
buildPromotion
-- Returns:
- see above
- Since:
- 2024.07
-
-