Exemple #1
0
 public BuildInfo(
     BuildKey buildKey,
     BuildDefinitionInfo buildDefinitionInfo,
     GitHubInfo?gitHubInfo,
     DateTime?startTime,
     DateTime?finishTime)
 {
     Key               = buildKey;
     DefinitionInfo    = buildDefinitionInfo;
     GitHubInfo        = gitHubInfo;
     PullRequestNumber = null;
     StartTime         = startTime;
     FinishTime        = finishTime;
 }
Exemple #2
0
        public static bool TryParseBuildKey(Uri uri, out BuildKey buildKey)
        {
            var regex = new Regex(@"https://dev.azure.com/(\w+)/(\w+)/.*buildId=(\d+)");
            var match = regex.Match(uri.ToString());

            if (match.Success && int.TryParse(match.Groups[3].Value, out var buildId))
            {
                buildKey = new BuildKey(match.Groups[1].Value, match.Groups[2].Value, buildId);
                return(true);
            }

            buildKey = default;
            return(false);
        }
Exemple #3
0
 public BuildInfo(
     BuildKey buildKey,
     BuildDefinitionInfo buildDefinitionInfo,
     GitHubPullRequestKey pullRequestKey,
     DateTime?startTime,
     DateTime?finishTime)
 {
     Key               = buildKey;
     DefinitionInfo    = buildDefinitionInfo;
     GitHubInfo        = new GitHubInfo(pullRequestKey.Organization, pullRequestKey.Repository);
     PullRequestNumber = pullRequestKey.Number;
     StartTime         = startTime;
     FinishTime        = finishTime;
 }
Exemple #4
0
        public BuildInfo(
            BuildKey buildKey,
            BuildDefinitionInfo buildDefinitionInfo,
            string?gitHubOrganization,
            string?gitHubRepository,
            int?pullRequestNumber,
            DateTime?startTime,
            DateTime?finishTime)
        {
            Key            = buildKey;
            DefinitionInfo = buildDefinitionInfo;
            if (gitHubOrganization is object && gitHubRepository is object)
            {
                GitHubInfo        = new GitHubInfo(gitHubOrganization, gitHubRepository);
                PullRequestNumber = pullRequestNumber;
            }

            StartTime  = startTime;
            FinishTime = finishTime;
        }
Exemple #5
0
 public BuildAttemptKey(BuildKey buildKey, int attempt)
 {
     BuildKey = buildKey;
     Attempt  = attempt;
 }
Exemple #6
0
 public BuildAttemptKey(Build build, Timeline timeline)
 {
     BuildKey = new BuildKey(build);
     Attempt  = timeline.GetAttempt();
 }
Exemple #7
0
 public BuildAttemptKey(string organization, string project, int number, int attempt)
 {
     BuildKey = new BuildKey(organization, project, number);
     Attempt  = attempt;
 }