Exemplo n.º 1
0
        public async Task HandleWebhookEventAsync(PullRequestContext context)
        {
            context.Logger.LogDebug("Getting details for pull request #{PullRequestNumber}...", context.Payload.Number);
            context.PullRequestInfo = await _prInfoProvider.GetPullRequestInfoAsync(context);

            context.Logger.LogDebug("Getting repository settings for pull request #{PullRequestNumber}", context.Payload.Number);
            context.RepositorySettings = await _repositorySettingsProvider.GetRepositorySettingsAsync(context);

            context.Logger.LogDebug("Evaluating status for pull request #{PullRequestNumber}...", context.Payload.Number);
            var(state, description) = _pullRequestPolicy.GetStatus(context);
            context.Logger.LogInformation("Status for pull request #{PullRequestNumber} is '{PullRequestState}' ({PullRequestDescription})", context.Payload.Number, state, description);

            context.Logger.LogDebug("Writing commit status for pull request #{PullRequestNumber}...", context.Payload.Number);
            await _statusWriter.WriteCommitStatusAsync(context, state, description);
        }
        public async Task HandleWebhookEventAsync(PullRequestContext context)
        {
            context.Log.Verbose($"Getting details for pull request #{context.Payload.Number}...");
            context.PullRequestInfo = await _prInfoProvider.GetPullRequestInfoAsync(context);

            context.Log.Verbose($"Getting repository settings for pull request #{context.Payload.Number}");
            context.RepositorySettings = await _repositorySettingsProvider.GetRepositorySettingsAsync(context);

            context.Log.Verbose($"Evaluating status for pull request #{context.Payload.Number}...");
            var(state, description) = _pullRequestPolicy.GetStatus(context);
            context.Log.Info($"Status for pull request #{context.Payload.Number} is '{state}' ({description})");

            context.Log.Verbose($"Writing commit status for pull request #{context.Payload.Number}...");
            await _statusWriter.WriteCommitStatusAsync(context, state, description);
        }