Esempio n. 1
0
        public async Task PredictAndApplyLabelAsync(int number, string title, string body, ILogger logger)
        {
            var corefxIssue = new GitHubIssue
            {
                ID          = number.ToString(),
                Title       = title,
                Description = body
            };

            string label = await Predictor.PredictAsync(corefxIssue, logger);

            if (label != null)
            {
                var issueUpdate = new IssueUpdate();
                issueUpdate.AddLabel(label);

                await _client.Issue.Update(_repoOwner, _repoName, number, issueUpdate);

                logger.LogInformation($"Issue {corefxIssue.ID} : \"{corefxIssue.Title}\" was labeled as: {label}");
            }
            else
            {
                logger.LogInformation($"The Model is not able to assign the label to the Issue {corefxIssue.ID} confidently.");
            }
        }
Esempio n. 2
0
        public async Task PredictAndApplyLabelAsync(int number, string title, string body, int?milestone, ILogger logger)
        {
            if (_client == null)
            {
                await GitSetupAsync();
            }

            var corefxIssue = new GitHubIssue
            {
                ID          = number.ToString(),
                Title       = title,
                Description = body
            };

            string label = await Predictor.PredictAsync(corefxIssue, logger, _threshold);

            if (label != null)
            {
                var issueUpdate = new IssueUpdate();
                issueUpdate.AddLabel(label);
                issueUpdate.Milestone = milestone; // The number of milestone associated with the issue.

                await _client.Issue.Update(_repoOwner, _repoName, number, issueUpdate);
            }
            else
            {
                logger.LogInformation($"! The Model is not able to assign the label to the Issue {corefxIssue.ID} confidently.");
            }
        }