diff --git a/src/.grace/graceconfig.json b/src/.grace/graceconfig.json index bbe258d..ac6649a 100644 --- a/src/.grace/graceconfig.json +++ b/src/.grace/graceconfig.json @@ -1,6 +1,6 @@ { - "OwnerId": "c911bc8a-8ba8-47a7-a694-1fbd8f80ab32", - "OwnerName": "Owner001", + "OwnerId": "f37d3fcd-5f76-4187-942d-890f21656ebe", + "OwnerName": "Owner9FED", "OrganizationId": "df1e97e4-5ee9-4e37-b095-4a677b44ef57", "OrganizationName": "Organization001", "RepositoryId": "8c4eae5f-f734-4067-a39f-ce2d9c9fabbc", @@ -27,14 +27,14 @@ "Prefetch": [ "" ], - "RootDirectory": "C:\\Source\\Grace\\src", + "RootDirectory": "D:\\Source\\Grace\\src", "StandardizedRootDirectory": "C:/Source/Grace/src/Grace.CLI", - "GraceDirectory": "C:\\Source\\Grace\\src\\.grace", - "ObjectDirectory": "C:\\Source\\Grace\\src\\.grace\\objects", - "GraceStatusFile": "C:\\Source\\Grace\\src\\.grace\\gracestatus.json.gz", - "GraceObjectCacheFile": "C:\\Source\\Grace\\src\\.grace\\objects\\graceObjectCache.json.gz", - "DirectoryVersionCache": "C:\\Source\\Grace\\src\\.grace\\directoryVersions", - "ConfigurationDirectory": "C:\\Source\\Grace\\src\\.grace", + "GraceDirectory": "D:\\Source\\Grace\\src\\.grace", + "ObjectDirectory": "D:\\Source\\Grace\\src\\.grace\\objects", + "GraceStatusFile": "D:\\Source\\Grace\\src\\.grace\\gracestatus.json.gz", + "GraceObjectCacheFile": "D:\\Source\\Grace\\src\\.grace\\objects\\graceObjectCache.json.gz", + "DirectoryVersionCache": "D:\\Source\\Grace\\src\\.grace\\directoryVersions", + "ConfigurationDirectory": "D:\\Source\\Grace\\src\\.grace", "ObjectStorageProvider": "azureBlobStorage", "ServerUri": "http://127.0.0.1:5000", "ProgramVersion": "0.1", diff --git a/src/Create-Grace-Objects.ps1 b/src/Create-Grace-Objects.ps1 index f33c508..5dfd2e5 100644 --- a/src/Create-Grace-Objects.ps1 +++ b/src/Create-Grace-Objects.ps1 @@ -5,20 +5,26 @@ $startTime = Get-Date $suffix = (Get-Random -Maximum 65536).ToString("X4") $ownerId = (New-Guid).ToString() - $ownerName = 'Owner' + $suffix + $ownerNameOriginal = 'Owner' + $suffix + $ownerName = 'Owner' + $suffix + 'A' $organizationId = (New-Guid).ToString() - $orgName = 'Org' + $suffix + $orgNameOriginal = 'Org' + $suffix + $orgName = 'Org' + $suffix + 'A' $repoId = (New-Guid).ToString() - $repoName = 'Repo' + $suffix + $repoNameOriginal = 'Repo' + $suffix + $repoName = 'Repo' + $suffix + 'A' $branchId = (New-Guid).ToString() $branchName = 'Branch' + $suffix - C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe owner create --output Json --ownerName $ownerName - C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe org create --output Json --ownerName $ownerName --organizationName $orgName - C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe repo create --output Json --ownerName $ownerName --organizationName $orgName --repositoryName $repoName - C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe branch create --output Json --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName + "D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe owner create --output Verbose --ownerName $ownerNameOriginal --ownerId $ownerId" + "D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe owner set-name --output Verbose --ownerName $ownerNameOriginal --newName $ownerName" + "D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe org create --output Verbose --ownerName $ownerName --organizationName $orgNameOriginal --organizationId $organizationId" + "D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe org set-name --output Verbose --ownerName $ownerName --organizationName $orgNameOriginal --newName $orgName" + "D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe repo create --output Verbose --ownerName $ownerName --organizationName $orgName --repositoryName $repoNameOriginal --repositoryId $repoId" + "D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe repo set-name --output Verbose --ownerName $ownerName --organizationName $orgName --repositoryName $repoNameOriginal --newName $repoName" + "D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe branch create --output Verbose --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName" - 1..50 | ForEach-Object { + 1..0 | ForEach-Object { $numberOfWords = Get-Random -Minimum 3 -Maximum 9 $start = Get-Random -Minimum 0 -Maximum ($words.Count - $numberOfWords) $message = '' @@ -27,10 +33,10 @@ $startTime = Get-Date } switch (Get-Random -Maximum 4) { - 0 {C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe branch save --output Json --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName} - 1 {C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe branch checkpoint --output Json --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName -m $message} - 2 {C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe branch commit --output Json --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName -m $message} - 3 {C:\Source\Grace\src\Grace.CLI\bin\Debug\net7.0\win10-x64\Grace.CLI.exe branch tag --output Json --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName -m $message} + 0 {D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe branch save --output Verbose --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName} + 1 {D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe branch checkpoint --output Verbose --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName -m $message} + 2 {D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe branch commit --output Verbose --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName -m $message} + 3 {D:\Source\Grace\src\Grace.CLI\bin\Debug\net8.0\Grace.CLI.exe branch tag --output Verbose --ownerName $ownerName --organizationName $orgName --repositoryName $repoName --branchName $branchName -m $message} } } } -ThrottleLimit 8 diff --git a/src/Grace.Actors/Repository.Actor.fs b/src/Grace.Actors/Repository.Actor.fs index 75b4122..0e48de7 100644 --- a/src/Grace.Actors/Repository.Actor.fs +++ b/src/Grace.Actors/Repository.Actor.fs @@ -199,7 +199,7 @@ module Repository = return processGraceError FailedCreatingInitialBranch repositoryEvent graceError | _ -> return Ok (BranchId.Empty, ReferenceId.Empty) } - + match! handleEvent with | Ok (branchId, referenceId) -> // Publish the event to the rest of the world. diff --git a/src/Grace.CLI/Properties/launchSettings.json b/src/Grace.CLI/Properties/launchSettings.json index ca960ce..be5d7ca 100644 --- a/src/Grace.CLI/Properties/launchSettings.json +++ b/src/Grace.CLI/Properties/launchSettings.json @@ -31,8 +31,8 @@ }, "grace owner create": { "commandName": "Project", - "commandLineArgs": "owner create --ownerName GraceDemo", - "workingDirectory": "D:\\Source\\gracedemo\\Mika" + "commandLineArgs": "owner create --output Verbose --ownerName Owner9FED --ownerId f37d3fcd-5f76-4187-942d-890f21656ebe", + "workingDirectory": "D:\\Source\\GraceDemo\\Ryan" }, "grace refs -b main": { "commandName": "Project", diff --git a/src/Grace.SDK/Common.SDK.fs b/src/Grace.SDK/Common.SDK.fs index eb68ccc..51bdd12 100644 --- a/src/Grace.SDK/Common.SDK.fs +++ b/src/Grace.SDK/Common.SDK.fs @@ -122,9 +122,9 @@ module Common = let! response = Constants.DefaultAsyncRetryPolicy.ExecuteAsync(fun _ -> httpClient.PostAsync(serverUriWithRoute, jsonContent parameters)) let endTime = getCurrentInstant() if response.IsSuccessStatusCode then - let! graceReturnValue = response.Content.ReadFromJsonAsync>(Constants.JsonSerializerOptions) - //let! blah = response.Content.ReadAsStringAsync() - //let graceReturnValue = JsonSerializer.Deserialize>(blah, Constants.JsonSerializerOptions) + //let! graceReturnValue = response.Content.ReadFromJsonAsync>(Constants.JsonSerializerOptions) + let! blah = response.Content.ReadAsStringAsync() + let graceReturnValue = JsonSerializer.Deserialize>(blah, Constants.JsonSerializerOptions) return Ok graceReturnValue |> enhance ("ServerElapsedTime", $"{(endTime - startTime).TotalMilliseconds:F3} ms") else if response.StatusCode = HttpStatusCode.NotFound then diff --git a/src/Grace.Server/Middleware/ValidateIds.Middleware.fs b/src/Grace.Server/Middleware/ValidateIds.Middleware.fs index e40d606..1d11afd 100644 --- a/src/Grace.Server/Middleware/ValidateIds.Middleware.fs +++ b/src/Grace.Server/Middleware/ValidateIds.Middleware.fs @@ -71,7 +71,7 @@ type ValidateIdsMiddleware(next: RequestDelegate) = if not <| path.StartsWith("/healthz") && not <| path.StartsWith("/actors") && not <| path.StartsWith("/dapr") then let endpoint = context.GetEndpoint() if isNull(endpoint) then - log.LogDebug("Path: {context.Request.Path}; Endpoint: null.", context.Request.Path) + log.LogDebug("{currentInstant}: Path: {context.Request.Path}; Endpoint: null.", getCurrentInstantExtended(), context.Request.Path) None elif endpoint.Metadata.Count > 0 then //logToConsole $"Path: {context.Request.Path}; endpoint.Metadata.Count: {endpoint.Metadata.Count}." @@ -79,10 +79,10 @@ type ValidateIdsMiddleware(next: RequestDelegate) = let requestBodyType = endpoint.Metadata |> Seq.tryFind (fun m -> m.GetType().FullName = "System.RuntimeType") |> Option.map (fun m -> m :?> Type) - if requestBodyType |> Option.isSome then log.LogDebug("Path: {context.Request.Path}; Endpoint: {endpoint.DisplayName}; RequestBodyType: {requestBodyType.Value.Name}.", context.Request.Path, endpoint.DisplayName, requestBodyType.Value.Name) + if requestBodyType |> Option.isSome then log.LogDebug("{currentInstant}: Path: {context.Request.Path}; Endpoint: {endpoint.DisplayName}; RequestBodyType: {requestBodyType.Value.Name}.", getCurrentInstantExtended(), context.Request.Path, endpoint.DisplayName, requestBodyType.Value.Name) requestBodyType else - log.LogDebug("Path: {context.Request.Path}; endpoint.Metadata.Count = 0.", context.Request.Path) + log.LogDebug("{currentInstant}: Path: {context.Request.Path}; endpoint.Metadata.Count = 0.", getCurrentInstantExtended(), context.Request.Path) None else None @@ -162,7 +162,7 @@ type ValidateIdsMiddleware(next: RequestDelegate) = let serializedRequestBody = serialize requestBody context.Items.Add("Request.Body", serializedRequestBody) - log.LogDebug("Request body: {requestBody}", serializedRequestBody) + log.LogDebug("{currentInstant}: Request body: {requestBody}", getCurrentInstantExtended(), serializedRequestBody) // Get Owner information. if Option.isSome entityProperties.OwnerId && Option.isSome entityProperties.OwnerName then @@ -170,17 +170,21 @@ type ValidateIdsMiddleware(next: RequestDelegate) = ownerId <- entityProperties.OwnerId.Value.GetValue(requestBody) :?> string ownerName <- entityProperties.OwnerName.Value.GetValue(requestBody) :?> string - // Resolve the OwnerId based on the provided Id and Name. - match! resolveOwnerId ownerId ownerName with - | Some resolvedOwnerId -> - // Check to see if the Owner exists. - match! Owner.ownerExists resolvedOwnerId ownerName Owner.OwnerError.OwnerDoesNotExist with - | Ok _ -> - graceIds <- {graceIds with OwnerId = resolvedOwnerId; HasOwner = true} - | Error error -> - notFound <- true - | None -> - badRequest <- true + if path.EndsWith("/create", StringComparison.InvariantCultureIgnoreCase) then + // If we're creating a new Owner, we don't need to resolve the Id. + graceIds <- {graceIds with OwnerId = ownerId; HasOwner = true} + else + // Resolve the OwnerId based on the provided Id and Name. + match! resolveOwnerId ownerId ownerName with + | Some resolvedOwnerId -> + // Check to see if the Owner exists. + match! Owner.ownerExists resolvedOwnerId ownerName Owner.OwnerError.OwnerDoesNotExist with + | Ok _ -> + graceIds <- {graceIds with OwnerId = resolvedOwnerId; HasOwner = true} + | Error error -> + notFound <- true + | None -> + badRequest <- true // Get Organization information. if Option.isSome entityProperties.OrganizationId && Option.isSome entityProperties.OrganizationName then @@ -188,17 +192,21 @@ type ValidateIdsMiddleware(next: RequestDelegate) = organizationId <- entityProperties.OrganizationId.Value.GetValue(requestBody) :?> string organizationName <- entityProperties.OrganizationName.Value.GetValue(requestBody) :?> string - // Resolve the OrganizationId based on the provided Id and Name. - match! resolveOrganizationId ownerId ownerName organizationId organizationName with - | Some resolvedOrganizationId -> - // Check to see if the Organization exists. - match! Organization.organizationExists ownerId ownerName resolvedOrganizationId organizationName Organization.OrganizationError.OrganizationDoesNotExist with - | Ok _ -> - graceIds <- {graceIds with OrganizationId = resolvedOrganizationId; HasOrganization = true} - | Error error -> - notFound <- true - | None -> - badRequest <- true + if path.EndsWith("/create", StringComparison.InvariantCultureIgnoreCase) then + // If we're creating a new Organization, we don't need to resolve the Id. + graceIds <- {graceIds with OrganizationId = organizationId; HasOrganization = true} + else + // Resolve the OrganizationId based on the provided Id and Name. + match! resolveOrganizationId ownerId ownerName organizationId organizationName with + | Some resolvedOrganizationId -> + // Check to see if the Organization exists. + match! Organization.organizationExists ownerId ownerName resolvedOrganizationId organizationName Organization.OrganizationError.OrganizationDoesNotExist with + | Ok _ -> + graceIds <- {graceIds with OrganizationId = resolvedOrganizationId; HasOrganization = true} + | Error error -> + notFound <- true + | None -> + badRequest <- true // Get repository information. if Option.isSome entityProperties.RepositoryId && Option.isSome entityProperties.RepositoryName then @@ -206,17 +214,21 @@ type ValidateIdsMiddleware(next: RequestDelegate) = repositoryId <- entityProperties.RepositoryId.Value.GetValue(requestBody) :?> string repositoryName <- entityProperties.RepositoryName.Value.GetValue(requestBody) :?> string - // Resolve the RepositoryId based on the provided Id and Name. - match! resolveRepositoryId ownerId ownerName organizationId organizationName repositoryId repositoryName with - | Some resolvedRepositoryId -> - // Check to see if the Repository exists. - match! Repository.repositoryExists ownerId ownerName organizationId organizationName resolvedRepositoryId repositoryName Repository.RepositoryError.RepositoryDoesNotExist with - | Ok _ -> - graceIds <- {graceIds with RepositoryId = resolvedRepositoryId; HasRepository = true} - | Error error -> - notFound <- true - | None -> - badRequest <- true + if path.EndsWith("/create", StringComparison.InvariantCultureIgnoreCase) then + // If we're creating a new Repository, we don't need to resolve the Id. + graceIds <- {graceIds with RepositoryId = repositoryId; HasRepository = true} + else + // Resolve the RepositoryId based on the provided Id and Name. + match! resolveRepositoryId ownerId ownerName organizationId organizationName repositoryId repositoryName with + | Some resolvedRepositoryId -> + // Check to see if the Repository exists. + match! Repository.repositoryExists ownerId ownerName organizationId organizationName resolvedRepositoryId repositoryName Repository.RepositoryError.RepositoryDoesNotExist with + | Ok _ -> + graceIds <- {graceIds with RepositoryId = resolvedRepositoryId; HasRepository = true} + | Error error -> + notFound <- true + | None -> + badRequest <- true // Get branch information. if Option.isSome entityProperties.BranchId && Option.isSome entityProperties.BranchName then @@ -224,57 +236,58 @@ type ValidateIdsMiddleware(next: RequestDelegate) = branchId <- entityProperties.BranchId.Value.GetValue(requestBody) :?> string branchName <- entityProperties.BranchName.Value.GetValue(requestBody) :?> string - // Resolve the BranchId based on the provided Id and Name. - match! resolveBranchId graceIds.RepositoryId branchId branchName with - | Some resolvedBranchId -> - // Check to see if the Branch exists. - match! Branch.branchExists ownerId ownerName organizationId organizationName repositoryId repositoryName resolvedBranchId branchName Branch.BranchError.BranchDoesNotExist with - | Ok _ -> - graceIds <- {graceIds with BranchId = resolvedBranchId; HasBranch = true} - | Error error -> - notFound <- true - | None -> - badRequest <- true - - context.Items.Add(nameof(GraceIds), graceIds) + if path.EndsWith("/create", StringComparison.InvariantCultureIgnoreCase) then + // If we're creating a new Branch, we don't need to resolve the Id. + graceIds <- {graceIds with BranchId = branchId; HasBranch = true} + else + // Resolve the BranchId based on the provided Id and Name. + match! resolveBranchId graceIds.RepositoryId branchId branchName with + | Some resolvedBranchId -> + // Check to see if the Branch exists. + match! Branch.branchExists ownerId ownerName organizationId organizationName repositoryId repositoryName resolvedBranchId branchName Branch.BranchError.BranchDoesNotExist with + | Ok _ -> + graceIds <- {graceIds with BranchId = resolvedBranchId; HasBranch = true} + | Error error -> + notFound <- true + | None -> + badRequest <- true + | None -> () + // Add the parsed Id's and Names to the HttpContext. + context.Items.Add(nameof(GraceIds), graceIds) + // Reset the Body to the beginning so that it can be read again later in the pipeline. context.Request.Body.Seek(0L, IO.SeekOrigin.Begin) |> ignore if badRequest then - log.LogDebug("Bad request: {requestBody}", context.Items["Request.Body"]) - context.Response.StatusCode <- 400 - do! context.Response.WriteAsync("The provided entity Id's and/or Names are invalid.") - do! Task.CompletedTask + log.LogDebug("{currentInstant}: Bad request. Request body: {requestBody}", getCurrentInstantExtended(), context.Items["Request.Body"]) + context.Items.Add("BadRequest", true) elif notFound then - log.LogDebug("The provided entity Id's and/or Names were not found in the database. {requestBody}", context.Items["Request.Body"]) - context.Response.StatusCode <- 400 - do! context.Response.WriteAsync("The provided entity Id's and/or Names were not found in the database.") - do! Task.CompletedTask - else + log.LogDebug("{currentInstant}: The provided entity Id's and/or Names were not found in the database. This is normal for Create commands. RequestBody: {requestBody}", getCurrentInstantExtended(), context.Items["Request.Body"]) + context.Items.Add("EntitiesNotFound", true) // ----------------------------------------------------------------------------------------------------- - // Pass control to next middleware instance... - let nextTask = next.Invoke(context); + // Pass control to next middleware instance... + let nextTask = next.Invoke(context); // ----------------------------------------------------------------------------------------------------- // On the way out... #if DEBUG - let middlewareTraceOutHeader = context.Request.Headers["X-MiddlewareTraceOut"]; - context.Request.Headers["X-MiddlewareTraceOut"] <- $"{middlewareTraceOutHeader}{nameof(ValidateIdsMiddleware)} --> "; - - let elapsed = getCurrentInstant().Minus(startTime).TotalMilliseconds - if not <| path.StartsWith("/healthz") && not <| path.StartsWith("/actors") && not <| path.StartsWith("/dapr") then - log.LogDebug("{currentInstant}: Path: {path}; Elapsed: {elapsed}ms; Status code: {statusCode}; graceIds: {graceIds}", - getCurrentInstantExtended(), context.Request.Path, elapsed, context.Response.StatusCode, serialize graceIds) - #endif - do! nextTask + let middlewareTraceOutHeader = context.Request.Headers["X-MiddlewareTraceOut"]; + context.Request.Headers["X-MiddlewareTraceOut"] <- $"{middlewareTraceOutHeader}{nameof(ValidateIdsMiddleware)} --> "; + + let elapsed = getCurrentInstant().Minus(startTime).TotalMilliseconds + if not <| path.StartsWith("/healthz") && not <| path.StartsWith("/actors") && not <| path.StartsWith("/dapr") then + log.LogDebug("{currentInstant}: Path: {path}; Elapsed: {elapsed}ms; Status code: {statusCode}; graceIds: {graceIds}", + getCurrentInstantExtended(), context.Request.Path, elapsed, context.Response.StatusCode, serialize graceIds) +#endif + do! nextTask with ex -> - log.LogError(ex, "An unhandled exception occurred in the {middlewareName} middleware.", nameof(ValidateIdsMiddleware)) + log.LogError(ex, "{currentInstant}: An unhandled exception occurred in the {middlewareName} middleware.", getCurrentInstantExtended(), nameof(ValidateIdsMiddleware)) context.Response.StatusCode <- 500 - do! context.Response.WriteAsync("An unhandled exception occurred in the ValidateIdsMiddleware middleware.") + do! context.Response.WriteAsync($"{getCurrentInstantExtended()}: An unhandled exception occurred in the ValidateIdsMiddleware middleware.") do! Task.CompletedTask } :> Task diff --git a/src/Grace.Server/Organization.Server.fs b/src/Grace.Server/Organization.Server.fs index b08049f..d8c139a 100644 --- a/src/Grace.Server/Organization.Server.fs +++ b/src/Grace.Server/Organization.Server.fs @@ -101,7 +101,7 @@ module Organization = String.isNotEmpty parameters.OrganizationName OrganizationNameIsRequired String.isValidGraceName parameters.OrganizationName InvalidOrganizationName Owner.ownerExists parameters.OwnerId parameters.OwnerName OwnerDoesNotExist - Organization.organizationExists parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationDoesNotExist + Organization.organizationDoesNotExist parameters.OwnerId parameters.OwnerName parameters.OrganizationId parameters.OrganizationName OrganizationIdAlreadyExists Organization.organizationNameIsUnique parameters.OwnerId parameters.OwnerName parameters.OrganizationName OrganizationNameAlreadyExists |] let command (parameters: CreateOrganizationParameters) = diff --git a/src/Grace.Server/Validations.Server.fs b/src/Grace.Server/Validations.Server.fs index a74484e..596ffde 100644 --- a/src/Grace.Server/Validations.Server.fs +++ b/src/Grace.Server/Validations.Server.fs @@ -225,7 +225,6 @@ module Validations = /// Validates that the organization does not exist. let organizationDoesNotExist<'T> ownerId ownerName organizationId organizationName (error: 'T) = task { - let mutable organizationGuid = Guid.Empty match! resolveOrganizationId ownerId ownerName organizationId organizationName with | Some organizationId -> return Error error diff --git a/src/Restart-GraceContainer.ps1 b/src/Restart-GraceContainer.ps1 index b3f6678..e5d997c 100644 --- a/src/Restart-GraceContainer.ps1 +++ b/src/Restart-GraceContainer.ps1 @@ -2,10 +2,14 @@ $startTime = Get-Date Start-Process -FilePath 'C:\Program Files\Docker\Docker\resources\bin\kubectl.exe' -ArgumentList 'delete -f .\kubernetes-deployment.yaml' #docker build -t "scottarbeit/grace-server:latest" . $startBulidTime = Get-Date -dotnet publish .\Grace.Server\Grace.Server.fsproj -c Debug -p:PublishProfile=DefaultContainer +dotnet build .\Grace.Server\Grace.Server.fsproj -c Debug +Write-Host +dotnet publish .\Grace.Server\Grace.Server.fsproj --no-build -c Debug -p:PublishProfile=DefaultContainer +Write-Host $finishBuildTime = Get-Date -Write-Host "Build Time: $([math]::Round(($finishBuildTime - $startBulidTime).TotalSeconds, 2)) seconds" +Write-Host "Build and publish time: $([math]::Round(($finishBuildTime - $startBulidTime).TotalSeconds, 2)) seconds" Write-Host k apply -f .\kubernetes-deployment.yaml $finishTime = Get-Date +Write-Host Write-Host "Total Time: $([math]::Round(($finishTime - $startTime).TotalSeconds, 2)) seconds" diff --git a/src/kubernetes-deployment.yaml b/src/kubernetes-deployment.yaml index 25bebd5..57b697b 100644 --- a/src/kubernetes-deployment.yaml +++ b/src/kubernetes-deployment.yaml @@ -22,8 +22,8 @@ data: DAPR_HTTP_PORT: "3500" DAPR_GRPC_PORT: "50001" DAPR_SERVER_URI: http://127.0.0.1 - Logging__LogLevel__Default: "Information" - #Logging__LogLevel__Default: "Debug" + #Logging__LogLevel__Default: "Information" + Logging__LogLevel__Default: "Debug" TEMP: /tmp ---