コード例 #1
0
        public PullRequestManager(
            IAuthorizationService authorizationService,
            ReviewManager reviewManager,
            CosmosReviewRepository reviewsRepository,
            CosmosPullRequestsRepository pullRequestsRepository,
            BlobCodeFileRepository codeFileRepository,
            DevopsArtifactRepository devopsArtifactRepository,
            IConfiguration configuration
            )
        {
            _reviewManager            = reviewManager;
            _pullRequestsRepository   = pullRequestsRepository;
            _configuration            = configuration;
            _reviewsRepository        = reviewsRepository;
            _codeFileRepository       = codeFileRepository;
            _devopsArtifactRepository = devopsArtifactRepository;
            _authorizationService     = authorizationService;
            var ghToken = _configuration["github-access-token"];

            if (ghToken != null)
            {
                _githubClient.Credentials = new Credentials(ghToken);
            }

            var pullRequestReviewCloseAfter = _configuration["pull-request-review-close-after-days"] ?? "30";

            _pullRequestCleanupDays = int.Parse(pullRequestReviewCloseAfter);
            _allowedListBotAccounts = new HashSet <string>();
            var botAllowedList = _configuration["allowedList-bot-github-accounts"];

            if (!string.IsNullOrEmpty(botAllowedList))
            {
                _allowedListBotAccounts.UnionWith(botAllowedList.Split(","));
            }
        }
コード例 #2
0
 public ReviewPageModel(
     ReviewManager manager,
     BlobCodeFileRepository codeFileRepository,
     CommentsManager commentsManager)
 {
     _manager            = manager;
     _codeFileRepository = codeFileRepository;
     _commentsManager    = commentsManager;
 }
コード例 #3
0
 public ConversationModel(
     IConfiguration configuration,
     BlobCodeFileRepository codeFileRepository,
     CommentsManager commentsManager,
     ReviewManager reviewManager)
 {
     _codeFileRepository = codeFileRepository;
     _commentsManager    = commentsManager;
     _reviewManager      = reviewManager;
     Endpoint            = configuration.GetValue <string>(ENDPOINT_SETTING);
 }
コード例 #4
0
 public ReviewPageModel(
     ReviewManager manager,
     BlobCodeFileRepository codeFileRepository,
     CommentsManager commentsManager,
     NotificationManager notificationManager,
     UserPreferenceCache preferenceCache)
 {
     _manager             = manager;
     _codeFileRepository  = codeFileRepository;
     _commentsManager     = commentsManager;
     _notificationManager = notificationManager;
     _preferenceCache     = preferenceCache;
 }
コード例 #5
0
 public ReviewManager(
     IAuthorizationService authorizationService,
     CosmosReviewRepository reviewsRepository,
     BlobCodeFileRepository codeFileRepository,
     BlobOriginalsRepository originalsRepository,
     CosmosCommentsRepository commentsRepository,
     IEnumerable <ILanguageService> languageServices)
 {
     _authorizationService = authorizationService;
     _reviewsRepository    = reviewsRepository;
     _codeFileRepository   = codeFileRepository;
     _originalsRepository  = originalsRepository;
     _commentsRepository   = commentsRepository;
     _languageServices     = languageServices;
 }
コード例 #6
0
 public ReviewManager(
     IAuthorizationService authorizationService,
     CosmosReviewRepository reviewsRepository,
     BlobCodeFileRepository codeFileRepository,
     BlobOriginalsRepository originalsRepository,
     CosmosCommentsRepository commentsRepository,
     IEnumerable <LanguageService> languageServices,
     NotificationManager notificationManager,
     DevopsArtifactRepository devopsArtifactRepository)
 {
     _authorizationService     = authorizationService;
     _reviewsRepository        = reviewsRepository;
     _codeFileRepository       = codeFileRepository;
     _originalsRepository      = originalsRepository;
     _commentsRepository       = commentsRepository;
     _languageServices         = languageServices;
     _notificationManager      = notificationManager;
     _devopsArtifactRepository = devopsArtifactRepository;
 }
コード例 #7
0
        public PullRequestManager(
            IAuthorizationService authorizationService,
            ReviewManager reviewManager,
            CosmosReviewRepository reviewsRepository,
            CosmosPullRequestsRepository pullRequestsRepository,
            BlobCodeFileRepository codeFileRepository,
            DevopsArtifactRepository devopsArtifactRepository,
            IConfiguration configuration
            )
        {
            _reviewManager            = reviewManager;
            _pullRequestsRepository   = pullRequestsRepository;
            _configuration            = configuration;
            _reviewsRepository        = reviewsRepository;
            _codeFileRepository       = codeFileRepository;
            _devopsArtifactRepository = devopsArtifactRepository;
            _authorizationService     = authorizationService;
            _githubClient.Credentials = new Credentials(_configuration["github-access-token"]);

            var pullRequestReviewCloseAfter = _configuration["pull-request-review-close-after-days"] ?? "30";

            _pullRequestCleanupDays = int.Parse(pullRequestReviewCloseAfter);
        }