private async Task <string> GetReleaseId() { string[] repoParts = Options.Repo.Split('/'); Repository repo = await GitHubClient.Repository.Get(repoParts[0], repoParts[1]); ZenHubRepositoryClient repoClient = ZenHubClient.GetRepositoryClient(repo.Id); Response <ReleaseReport[]> releases = await repoClient.GetReleaseReportsAsync(); string releaseId = string.Empty; foreach (var release in releases.Value) { if (release.Title == Options.Release) { releaseId = release.ReleaseId; break; } } if (releaseId == string.Empty) { throw new Exception($"No such release: {Options.Release}"); } return(releaseId); }
private async Task <Dictionary <int, string> > GernerateIssueLabelMap() { Dictionary <int, string> issueLabelMap = new Dictionary <int, string>(); string[] repoParts = RepoName.Split('/'); Repository repo = await GitHubClient.Repository.Get(repoParts[0], repoParts[1]); ZenHubRepositoryClient repoClient = ZenHubClient.GetRepositoryClient(repo.Id); { Response <Workspace[]> workSpace = await repoClient.GetWorkspacesAsync(); foreach (var workspace in workSpace.Value) { if (workspace.Name.Equals(WorkspaceName)) { try { Response <ZenHubBoard> zenHubBoard = await repoClient.GetZenHubBoardAsync(workspace.Id); foreach (var pipeline in zenHubBoard.Value.Pipelines) { string pipelineLabel = $"Pipeline:{pipeline.Name}"; foreach (IssueDetails issue in pipeline.Issues) { issueLabelMap.Add(issue.IssueNumber, pipelineLabel); } } } catch (Exception e) { Console.WriteLine("If the below exception is about parsing, there may be a float estimation in some issues. \n" + "Find the one and change it to an int"); throw; } } } } return(issueLabelMap); }