Example #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;
 }
Example #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);
 }
Example #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);
        }
Example #4
0
        public BuildStatus GetCommentsIntoBuildStatus(MyTfsBuildDefinition buildDefinition, BuildStatus buildStatus)
        {
            MyChangeset changeset = GetCommentsForBuild(buildDefinition, buildStatus);

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