Interface VersionedSettingsManager

    • 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 interest
        consumer - 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 interest
        settingsRoot - 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 interest
        settingsRoot - 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
      • 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 representation
        buildTypes - 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 the CredentialsStorage 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
      • 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 buildType
        promotion - 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
      • 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 interest
        dst - destination zip archive file
        format - format
        config - 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