Exemplo n.º 1
0
        private async Task <List <RoachIssueEntity> > GetIssuesInMilestone(RoachRepoId repoId, int milestone, CancellationToken cancellationToken)
        {
            var filter = FilterUtil
                         .PartitionKey(RoachIssueEntity.GetPartitionKey(repoId))
                         .And(FilterUtil.Column(nameof(RoachIssueEntity.MilestoneNumber), milestone));

            return(await AzureUtil.QueryAsync <RoachIssueEntity>(_issueTable, filter, cancellationToken));
        }
Exemplo n.º 2
0
        private async Task PopulateIssues(TextWriter logger)
        {
            var util    = new GitHubQueryUtil(_client);
            var request = new RepositoryIssueRequest()
            {
                State = ItemStateFilter.All
            };

            logger.WriteLine($"Getting issues");
            var issues = await util.GetIssues(_repoId, request);

            var list = new List <RoachIssueEntity>();

            foreach (var issue in issues)
            {
                var entity = new RoachIssueEntity(new RoachIssue(_repoId, issue));
                list.Add(entity);
            }

            logger.WriteLine("Populating issues table storage");
            await AzureUtil.InsertBatchUnordered(_issueTable, list);
        }
Exemplo n.º 3
0
        private async Task <List <RoachIssueEntity> > GetIssuesInMilestones(RoachRepoId repoId, List <int> milestones, CancellationToken cancellationToken)
        {
            if (milestones == null || milestones.Count == 0)
            {
                // Return all of the issues
                return(await AzureUtil.QueryAsync <RoachIssueEntity>(_issueTable, FilterUtil.PartitionKey(RoachIssueEntity.GetPartitionKey(repoId)), cancellationToken));
            }

            var list = new List <RoachIssueEntity>();

            foreach (var milestone in milestones)
            {
                list.AddRange(await GetIssuesInMilestone(repoId, milestone, cancellationToken));
            }

            return(list);
        }