chocolatey / package-validator

Windows service to validate packages conform to package standards
Apache License 2.0
31 stars 29 forks source link

URL validation fails for some protocols #199

Closed pauby closed 4 years ago

pauby commented 4 years ago

The new validation rules don't take into account all protocols that could be in the URL's. As an example the mrViewer package fails as the projectSourceUrl is git://git.code.sf.net/p/mrviewer/code. This causes the validator service to stop and no more packages to be validated.

The exception thrown is:

2019-12-31 09:02:22,532 6 [INFO ] - ========== mrviewer v5.3.5 ==========
2019-12-31 09:02:22,532 6 [INFO ] - mrViewer (Install) v5.3.5 found for review.
2019-12-31 09:02:22,532 6 [INFO ] - Validating Package: mrviewer Version: 5.3.5
2019-12-31 09:02:22,969 6 [INFO ] - Running validation rules...
2019-12-31 09:02:30,235 6 [WARN ] - chocolatey-package-validator had an error on WIN-EDSKJJPAQ14 (with user SYSTEM):
System.NotSupportedException: The URI prefix is not recognized.
   at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
   at chocolatey.package.validator.infrastructure.app.utility.Utility.url_is_valid(Uri url) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure.app\utility\Utility.cs:line 114
   at chocolatey.package.validator.infrastructure.app.rules.PackageSourceUrlValidRequirement.is_valid(IPackage package) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure.app\rules\PackageSourceUrlValidRequirement.cs:line 35
   at chocolatey.package.validator.infrastructure.rules.BasePackageRule.validate(IPackage package) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure\rules\BasePackageRule.cs:line 55
   at chocolatey.package.validator.infrastructure.app.services.PackageValidationService.validate_package(IPackage package) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure.app\services\PackageValidationService.cs:line 68
   at chocolatey.package.validator.infrastructure.app.tasks.ValidatePackageTask.validate_package(PackageReadyForValidationMessage message) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure.app\tasks\ValidatePackageTask.cs:line 50
   at System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Where`1._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.OfType`2._.OnNext(TSource value)
   at System.Reactive.Observer`1.OnNext(T value)
   at Reactive.EventAggregator.EventAggregator.Publish[TEvent](TEvent sampleEvent)
   at chocolatey.package.validator.infrastructure.messaging.EventManager.publish[TMessage](TMessage message) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure\messaging\EventManager.cs:line 50
   at chocolatey.package.validator.infrastructure.app.tasks.DownloadSubmittedPackageTask.download_package(ValidatePackageMessage message) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure.app\tasks\DownloadSubmittedPackageTask.cs:line 61
   at System.Reactive.AnonymousSafeObserver`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.Where`1._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.OfType`2._.OnNext(TSource value)
   at System.Reactive.Observer`1.OnNext(T value)
   at Reactive.EventAggregator.EventAggregator.Publish[TEvent](TEvent sampleEvent)
   at chocolatey.package.validator.infrastructure.messaging.EventManager.publish[TMessage](TMessage message) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure\messaging\EventManager.cs:line 50
   at chocolatey.package.validator.infrastructure.app.tasks.CheckForPackagesTask.timer_elapsed(Object sender, ElapsedEventArgs e) in c:\code\package-validator\src\chocolatey.package.validator\infrastructure.app\tasks\CheckForPackagesTask.cs:line 92
2019-12-31 09:02:30,235 6 [INFO ] - Finished checking for packages to validate. Sleeping for 5 minute(s).
ferventcoder commented 4 years ago

@gep13 is Released the right label here?

gep13 commented 4 years ago

@ferventcoder yes, that makes sense.