Skip to content

Commit

Permalink
Bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottArbeit committed Nov 20, 2023
1 parent 8bf18e7 commit b52a8fa
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 105 deletions.
18 changes: 9 additions & 9 deletions src/.grace/graceconfig.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
30 changes: 18 additions & 12 deletions src/Create-Grace-Objects.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Grace.Actors/Repository.Actor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/Grace.CLI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/Grace.SDK/Common.SDK.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GraceReturnValue<'U>>(Constants.JsonSerializerOptions)
//let! blah = response.Content.ReadAsStringAsync()
//let graceReturnValue = JsonSerializer.Deserialize<GraceReturnValue<'U>>(blah, Constants.JsonSerializerOptions)
//let! graceReturnValue = response.Content.ReadFromJsonAsync<GraceReturnValue<'U>>(Constants.JsonSerializerOptions)
let! blah = response.Content.ReadAsStringAsync()
let graceReturnValue = JsonSerializer.Deserialize<GraceReturnValue<'U>>(blah, Constants.JsonSerializerOptions)
return Ok graceReturnValue |> enhance ("ServerElapsedTime", $"{(endTime - startTime).TotalMilliseconds:F3} ms")
else
if response.StatusCode = HttpStatusCode.NotFound then
Expand Down
Loading

0 comments on commit b52a8fa

Please sign in to comment.