Ejemplo n.º 1
0
 private static BuildStatus AddCommentsToBuildStatus(BuildStatus buildStatus, MyChangeset changeset)
 {
     if (changeset == null) return null;
     buildStatus.Comment = changeset.Comment;
     buildStatus.BuildId = changeset.ChangesetId.ToString(CultureInfo.InvariantCulture);
     return buildStatus;
 }
Ejemplo n.º 2
0
 private static BuildStatus AddCommentsToBuildStatus(BuildStatus buildStatus, MyChangeset changeset)
 {
     if (changeset == null)
     {
         return(null);
     }
     buildStatus.Comment = changeset.Comment;
     buildStatus.BuildId = changeset.ChangesetId.ToString(CultureInfo.InvariantCulture);
     return(buildStatus);
 }
Ejemplo n.º 3
0
        private MyChangeset GetCommentsForBuild(MyTfsBuildDefinition buildDefinition, BuildStatus buildStatus)
        {
            var            newBuildHash = buildStatus.GetBuildDataAsHash();
            CommentAndHash cachedChangeset;
            bool           haveEverGottenCommentsForThisBuildDef = CachedCommentsByBuildDefinition.TryGetValue(buildDefinition.Name, out cachedChangeset);
            bool           areCacheCommentsStale = false;

            if (haveEverGottenCommentsForThisBuildDef)
            {
                string oldBuildHash = cachedChangeset.BuildStatusHash;
                areCacheCommentsStale = oldBuildHash != newBuildHash;
            }
            if (!haveEverGottenCommentsForThisBuildDef || areCacheCommentsStale)
            {
                MyChangeset latestChangeset = buildDefinition.GetLatestChangeset();
                CachedCommentsByBuildDefinition[buildDefinition.Name] = new CommentAndHash(newBuildHash, latestChangeset);
            }
            return(CachedCommentsByBuildDefinition[buildDefinition.Name].Changeset);
        }
Ejemplo n.º 4
0
        public BuildStatus GetCommentsIntoBuildStatus(MyTfsBuildDefinition buildDefinition, BuildStatus buildStatus)
        {
            MyChangeset changeset = GetCommentsForBuild(buildDefinition, buildStatus);

            return(AddCommentsToBuildStatus(buildStatus, changeset));
        }
Ejemplo n.º 5
0
 public CommentAndHash(string newBuildHash, MyChangeset getLatestChangeset) : this()
 {
     BuildStatusHash = newBuildHash;
     Changeset       = getLatestChangeset;
 }
Ejemplo n.º 6
0
 public CommentAndHash(string newBuildHash, MyChangeset getLatestChangeset)
     : this()
 {
     BuildStatusHash = newBuildHash;
     Changeset = getLatestChangeset;
 }