Skip to content

Commit

Permalink
Fix typos: degration -> degradation
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-g committed Nov 2, 2017
1 parent 7d9f783 commit 1cc416b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions src/Paket.Core/Dependencies/NuGet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ let rec private getPackageDetails alternativeProjectRoot root force (parameters:
return! tryV3 nugetSource force
with
| exn ->
eprintfn "Possible Performance degration, V3 was not working: %s" exn.Message
eprintfn "Possible Performance degradation, V3 was not working: %s" exn.Message

This comment has been minimized.

Copy link
@blumu

blumu Nov 22, 2017

@forki This line our code is causing our build task to fail in VSTS. Could this be printed as a warning on stdout instead?

This comment has been minimized.

Copy link
@forki

forki via email Nov 22, 2017

Member

This comment has been minimized.

Copy link
@matthid

matthid Nov 22, 2017

Member

It is a warning and should stay a warning. proper fix is to either use a proper nuget source, fix the bug in paket or setup vsts to ignore the warning instead of failing the build

This comment has been minimized.

Copy link
@blumu

blumu Nov 22, 2017

@matthid So if this is a warning, would it make sense to print it to stdout (like in Paket v3) instead of stderror (Paket v5)? How would you configure VSTS to ignore it otherwise? I still want VSTS to fail on actual errors.

This comment has been minimized.

Copy link
@matthid

matthid Nov 22, 2017

Member

@blumu No it does not because stdout should be parsable reproducable output. stderr is the correct place for warnings. It's just that "warnings as errors" is the default setting in vsts.

This comment has been minimized.

Copy link
@matthid

matthid Nov 22, 2017

Member

Btw. every reasonable command line tool behaves this way. Only Microsoft does things differently as usual.

This comment has been minimized.

Copy link
@forki

forki via email Nov 22, 2017

Member

This comment has been minimized.

Copy link
@agross

agross Nov 22, 2017

Contributor

Yes, especially it is useful to print to stderr if you want to consume the normal (successful) output from the command in scripts (e.g. shell completion). All usual *nix tools do this. For example, if you find / and find encounters files you cannot access these will be printed to stderr so the consuming party does not process Permission denied output as file names (which are outputted to stdout and forwarded to the consuming party).

It is beyond me why VS Team Build regards any stderr output as a general build failure. In other CI tools you must enable that option explicitly.

if verbose then
printfn "Error while using V3 API: %O" exn

Expand Down Expand Up @@ -622,19 +622,19 @@ let DownloadAndExtractPackage(alternativeProjectRoot, root, isLocalOverride:bool
let normalizedNupkgName = NuGetCache.GetPackageFileName packageName version
let configResolved = config.Resolve root groupName packageName version includeVersionInPath
let targetFileName =
if not isLocalOverride then
if not isLocalOverride then
NuGetCache.GetTargetUserNupkg packageName version
else
match configResolved.Path with
| Some p -> Path.Combine(p, nupkgName)
| None -> failwithf "paket.local in combination with storage:none is not supported"

if isLocalOverride && not force then
if isLocalOverride && not force then
failwithf "internal error: when isLocalOverride is specified then force needs to be specified as well"
let targetFile = FileInfo targetFileName
let licenseFileName = getLicenseFile packageName version

if force then
if force then
match configResolved.Path with
| Some p ->
if verbose then
Expand Down Expand Up @@ -746,7 +746,7 @@ let DownloadAndExtractPackage(alternativeProjectRoot, root, isLocalOverride:bool
let credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(username + ":" + password))
request.Headers.[HttpRequestHeader.Authorization] <- String.Format("Basic {0}", credentials)
| Some(Credentials(username, password, AuthType.NTLM)) ->
let cred = NetworkCredential(username,password)
let cred = NetworkCredential(username,password)
request.Credentials <- cred.GetCredential(downloadUri, "NTLM")
else
request.UseDefaultCredentials <- true
Expand Down
26 changes: 13 additions & 13 deletions src/Paket.Core/Dependencies/NuGetCache.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ type NuGetRequestGetVersions =
async {
try
return! r.DoRequest()
with e ->
with e ->
return FailedVersionRequest { Url = r.Url; Error = System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture e }
}


// An unparsed file in the NuGet package -> still need to inspect the path for further information. After parsing an entry will be part of a "LibFolder" for example.
type UnparsedPackageFile =
Expand All @@ -79,7 +79,7 @@ type UnparsedPackageFile =

module NuGetConfig =
open System.Text

let writeNuGetConfig directory sources =
let start = """<?xml version="1.0" encoding="utf-8"?>
<configuration>
Expand All @@ -103,7 +103,7 @@ module NuGetConfig =
else
if File.ReadAllText(fileName) <> text then
File.WriteAllText(fileName,text)

type FrameworkRestrictionsCache = string

type NuGetPackageCache =
Expand All @@ -125,7 +125,7 @@ type NuGetPackageCache =
SerializedDependencies =
l
|> List.map (fun (n,v, restrictions) ->
let restrictionString =
let restrictionString =
match restrictions with
| FrameworkRestrictions.AutoDetectFramework -> "AUTO"
| FrameworkRestrictions.ExplicitRestriction re -> re.ToString()
Expand Down Expand Up @@ -172,7 +172,7 @@ let tryGetDetailsFromCache force nugetURL (packageName:PackageName) (version:Sem
if not force && cacheFile.Exists then
try
let json = File.ReadAllText(cacheFile.FullName)

try
let cacheResult =
let cachedObject = JsonConvert.DeserializeObject<NuGetPackageCache> json
Expand Down Expand Up @@ -205,7 +205,7 @@ let tryGetDetailsFromCache force nugetURL (packageName:PackageName) (version:Sem

let getDetailsFromCacheOr force nugetURL (packageName:PackageName) (version:SemVerInfo) (get : unit -> ODataSearchResult Async) : ODataSearchResult Async =
let cacheFile, oldFiles = getCacheFiles NuGetPackageCache.CurrentCacheVersion nugetURL packageName version
for f in oldFiles do
for f in oldFiles do
File.Delete f
let get() =
async {
Expand Down Expand Up @@ -239,7 +239,7 @@ let fixDatesInArchive fileName =
| _ -> e.LastWriteTime <- maxTime
with
| exn -> traceWarnfn "Could not fix timestamps in %s. Error: %s" fileName exn.Message


let fixArchive fileName =
if isMonoRuntime then
Expand All @@ -256,8 +256,8 @@ let inline isExtracted (directory:DirectoryInfo) (packageName:PackageName) (vers
if not fi.Exists then false else
if not directory.Exists then false else
directory.EnumerateFileSystemInfos()
|> Seq.exists (fun f ->
(not (String.equalsIgnoreCase f.FullName fi.FullName)) &&
|> Seq.exists (fun f ->
(not (String.equalsIgnoreCase f.FullName fi.FullName)) &&
(not (String.equalsIgnoreCase f.FullName licenseFile)))

let IsPackageVersionExtracted(config:ResolvedPackagesFolder, packageName:PackageName, version:SemVerInfo) =
Expand Down Expand Up @@ -377,7 +377,7 @@ let ExtractPackage(fileName:string, targetFolder, packageName:PackageName, versi
let text = if detailed then sprintf "%s In rare cases a firewall might have blocked the download. Please look into the file and see if it contains text with further information." Environment.NewLine else ""
let path = try Path.GetFullPath fileName with :? PathTooLongException -> sprintf "%s (!too long!)" fileName
raise (Exception(sprintf "Error during extraction of %s.%s%s" path Environment.NewLine text, exn))

cleanup directory
if verbose then
verbosefn "%O %O unzipped to %s" packageName version targetFolder
Expand Down Expand Up @@ -506,7 +506,7 @@ let tryAndBlacklistUrl doBlackList doWarn (source:NugetSource) (tryAgain : 'a ->
let cached =
if doBlackList then
tryUrlOrBlacklist (fun () -> async { return! f url.InstanceUrl }) (tryAgain >> not) (source, url.UrlId)
else
else
async {
let! result = f url.InstanceUrl
return (tryAgain result |> not, result)
Expand All @@ -523,7 +523,7 @@ let tryAndBlacklistUrl doBlackList doWarn (source:NugetSource) (tryAgain : 'a ->
let! (isOk, res) = task |> Async.AwaitTask
if not isOk then
if doWarn then
eprintfn "Possible Performance degration, blacklist '%s'" url.InstanceUrl
eprintfn "Possible Performance degradation, blacklist '%s'" url.InstanceUrl
return Choice2Of3 res
else
return Choice1Of3 res
Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/Dependencies/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ let tryGetAllVersionsFromNugetODataWithFilter (auth, nugetURL, package:PackageNa
match tryGetAllVersionsFromNugetODataWithFilterWarnings.TryGetValue nugetURL with
| true, true -> ()
| _, _ ->
eprintfn "Possible Performance degration, could not retrieve '%s', ignoring further warnings for this source" url
eprintfn "Possible Performance degradation, could not retrieve '%s', ignoring further warnings for this source" url
tryGetAllVersionsFromNugetODataWithFilterWarnings.TryAdd(nugetURL, true) |> ignore
if verbose then
printfn "Error while retrieving data from '%s': %O" url exn
Expand Down
18 changes: 9 additions & 9 deletions src/Paket.Core/Dependencies/NuGetV3.fs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ type PackageIndex =
let private getPackageIndexRaw (source : NugetV3Source) (packageName:PackageName) =
async {
let! registrationUrl = getNuGetV3Resource source PackageIndex
let url = registrationUrl.Replace("{id-lower}", packageName.ToString().ToLower())
let url = registrationUrl.Replace("{id-lower}", packageName.ToString().ToLower())
let! rawData = safeGetFromUrl (source.Authentication |> Option.map toCredentials, url, acceptJson)
return
match rawData with
Expand Down Expand Up @@ -367,7 +367,7 @@ let getRelevantPage (source:NugetV3Source) (index:PackageIndex) (version:SemVerI
|> Seq.toList
match packages with
| [ package ] -> return Some package
| [] -> return None
| [] -> return None
| h :: _ ->
// Can happen in theory when multiple versions differ only in casing...
traceWarnfn "Multiple package versions matched with '%O' on page '%s'" version page.Id
Expand Down Expand Up @@ -409,7 +409,7 @@ let getPackageDetails (source:NugetV3Source) (packageName:PackageName) (version:
| None -> return EmptyResult
| Some relevantPage ->
let catalogData = relevantPage.PackageDetails
let dependencyGroups, dependencies =
let dependencyGroups, dependencies =
if catalogData.DependencyGroups = null then
[], []
else
Expand All @@ -422,7 +422,7 @@ let getPackageDetails (source:NugetV3Source) (packageName:PackageName) (version:
catalogData.DependencyGroups |> Seq.map (fun group -> detect group.TargetFramework) |> Seq.toList,

catalogData.DependencyGroups
|> Seq.map(fun group ->
|> Seq.map(fun group ->
if group.Dependencies = null then
Seq.empty
else
Expand All @@ -447,7 +447,7 @@ let getPackageDetails (source:NugetV3Source) (packageName:PackageName) (version:
for warning in warnings do
Logging.traceWarnfn "%s" (warning.Format packageName version)

return
return
{ SerializedDependencies = []
PackageName = packageName.ToString()
SourceUrl = source.Url
Expand All @@ -462,8 +462,8 @@ let getPackageDetails (source:NugetV3Source) (packageName:PackageName) (version:

let loadFromCacheOrGetDetails (force:bool)
(cacheFileName:string)
(source:NugetV3Source)
(packageName:PackageName)
(source:NugetV3Source)
(packageName:PackageName)
(version:SemVerInfo) =
async {
if not force && File.Exists cacheFileName then
Expand All @@ -477,9 +477,9 @@ let loadFromCacheOrGetDetails (force:bool)
return false,ODataSearchResult.Match cachedObject
with exn ->
if verboseWarnings then
eprintfn "Possible Performance degration, could not retrieve '%O' from cache: %O" packageName exn
eprintfn "Possible Performance degradation, could not retrieve '%O' from cache: %O" packageName exn
else
eprintfn "Possible Performance degration, could not retrieve '%O' from cache: %s" packageName exn.Message
eprintfn "Possible Performance degradation, could not retrieve '%O' from cache: %s" packageName exn.Message
let! details = getPackageDetails source packageName version
return true,details
else
Expand Down

0 comments on commit 1cc416b

Please sign in to comment.