Search in sources :

Example 1 with ChangesBean

use of jetbrains.buildServer.controllers.changes.ChangesBean in project teamcity-rest by JetBrains.

the class Build method getLimitedChangesCount.

/**
 * Experimental support only
 * This is meant to replicate the UI logic of calculating number of changes in a build. Returns the number of changes limited by the maximum number as calculated in UI.
 * Returns the limit+1 if there are more changes then the limit configured
 */
@XmlAttribute(name = "limitedChangesCount")
public Integer getLimitedChangesCount() {
    Supplier<Boolean> isCached = () -> ((BuildPromotionEx) myBuildPromotion).hasComputedChanges(SelectPrevBuildPolicy.SINCE_LAST_BUILD, // see ChangesBean.lazyChanges;
    new LimitingVcsModificationProcessor(ChangesPopupUtil.getBuildChangesPopupLimit()));
    return ValueWithDefault.decideDefault(myFields.isIncludedFull("limitedChangesCount", isCached, false, false), () -> {
        ChangesBean changesBean = ChangesBean.createForChangesLink(myBuildPromotion, null);
        int result = changesBean.getTotal();
        if (changesBean.isChangesLimitExceeded())
            result++;
        return result;
    });
}
Also used : ChangesBean(jetbrains.buildServer.controllers.changes.ChangesBean) XmlAttribute(javax.xml.bind.annotation.XmlAttribute)

Aggregations

XmlAttribute (javax.xml.bind.annotation.XmlAttribute)1 ChangesBean (jetbrains.buildServer.controllers.changes.ChangesBean)1