示例#1
0
        private async Task TryToUpdateBranch(string owner, string repo, int prId, string branch)
        {
            var extraLogData = new { owner, repo, branch };

            try
            {
                await prUpdater.UpdateBranch(owner, repo, branch);
            }
            catch (Exception er)
            {
                logger.WithExtraData(extraLogData).Error(er, $"Could not update branch for PR due to exception from the github api");
                await commentCreator.CreateComment(owner, repo, prId, CommentsConsts.CantUpdateBranchHeader, er.Message, CommentsConsts.CantUpdateBranchBody);
            }
        }
示例#2
0
        private async Task <bool> UpdateSinglePr(MergeRequest pullRequest, RepoConfig config)
        {
            var branch = pullRequest.Branch;
            var prId   = pullRequest.PrId;

            logger.WithMergeRequestData(pullRequest).Information($"updating branch on next PullRequest");

            try
            {
                await prUpdater.UpdateBranch(pullRequest.Owner, pullRequest.Repo, branch);

                return(true);
            }
            catch (Exception e)
            {
                logger.WithMergeRequestData(pullRequest).Warning(e, "Unable to update branch on next PR");
                return(false);
            }
        }