/// <summary> /// Only the package symbols that are in validating state will be sent to the symbols validation/ingestion. /// </summary> /// <param name="id">The id of the package.</param> /// <param name="version">The version of the package.</param> /// <returns></returns> public IValidatingEntity <SymbolPackage> FindPackageByIdAndVersionStrict(string id, string version) { var symbolPackage = _galleryEntityService .FindSymbolPackagesByIdAndVersion(id, version) .Where(s => s.StatusKey == PackageStatus.Validating) .FirstOrDefault(); return(symbolPackage == null ? null : new SymbolPackageValidatingEntity(symbolPackage)); }
private bool ShouldSkipScan(IValidationRequest request) { var symbolPackage = _symbolPackageService .FindSymbolPackagesByIdAndVersion(request.PackageId, request.PackageVersion) .FirstOrDefault(sp => sp.Key == request.PackageKey); if (symbolPackage == null) { throw new InvalidDataException($"The expected symbol package for {request.PackageId} {request.PackageVersion} not found!"); } if (!_criteriaEvaluator.IsMatch(_configuration.PackageCriteria, symbolPackage)) { _logger.LogInformation( "The scan for {ValidationId} ({PackageId} {PackageVersion}) was skipped due to package criteria configuration.", request.ValidationId, request.PackageId, request.PackageVersion); return(true); } return(false); }