Skip to content

Commit e5a8603

Browse files
authored
Merge pull request #70 from dacharyc/DOCSP-53367
(DOCSP-53367): Update version handling for Snooty Data API fetch documents endpoint
2 parents 6acd4cd + da53ef5 commit e5a8603

24 files changed

+81
-53
lines changed

audit/gdcd/HandleCollectionSummariesDocument.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ func HandleCollectionSummariesDocument(project types.ProjectDetails, report type
4040
}
4141
}
4242
}
43-
if project.ActiveBranch != collectionVersionKey {
43+
if project.Version != collectionVersionKey {
4444
// If the active branch doesn't match the most recent version, need to make a new CollectionInfoView for this document
4545
updatedSummaryDoc := db.MakeNewCollectionVersionDocument(*summaryDoc, project, report)
4646
summaryDoc = &updatedSummaryDoc
4747
} else {
4848
// If the active branch does match the most recent version, just need to update this version document's last updated date and counts
49-
pageCountBeforeUpdating := summaryDoc.Version[project.ActiveBranch].TotalPageCount
49+
pageCountBeforeUpdating := summaryDoc.Version[project.Version].TotalPageCount
5050
updatedSummaryDoc := db.UpdateCollectionVersionDocument(*summaryDoc, project, report)
5151
summaryDoc = &updatedSummaryDoc
5252

audit/gdcd/UpdateExistingPage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package main
33
import (
44
"common"
55
"context"
6-
"gdcd/add-code-examples"
7-
"gdcd/compare-code-examples"
6+
add_code_examples "gdcd/add-code-examples"
7+
compare_code_examples "gdcd/compare-code-examples"
88
"gdcd/db"
99
"gdcd/snooty"
1010
"gdcd/types"

audit/gdcd/UpdateProjectReportForNewPage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"common"
5-
"gdcd/add-code-examples"
5+
add_code_examples "gdcd/add-code-examples"
66
compare_code_examples "gdcd/compare-code-examples"
77
"gdcd/types"
88
"gdcd/utils"

audit/gdcd/add-code-examples/CategorizeDriverLanguageSnippet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"common"
55
"context"
66
"fmt"
7+
78
"github.com/tmc/langchaingo/llms"
89
"github.com/tmc/langchaingo/llms/ollama"
910
"github.com/tmc/langchaingo/prompts"

audit/gdcd/add-code-examples/CategorizeJsonLikeSnippet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"common"
55
"context"
66
"fmt"
7+
78
"github.com/tmc/langchaingo/llms"
89
"github.com/tmc/langchaingo/llms/ollama"
910
"github.com/tmc/langchaingo/prompts"

audit/gdcd/add-code-examples/CategorizeShellSnippet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"common"
55
"context"
66
"fmt"
7+
78
"github.com/tmc/langchaingo/llms"
89
"github.com/tmc/langchaingo/llms/ollama"
910
"github.com/tmc/langchaingo/prompts"

audit/gdcd/add-code-examples/CategorizeTextSnippet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"common"
55
"context"
66
"fmt"
7+
78
"github.com/tmc/langchaingo/llms"
89
"github.com/tmc/langchaingo/llms/ollama"
910
"github.com/tmc/langchaingo/prompts"

audit/gdcd/compare-code-examples/CompareExistingIncomingCodeExampleSlices.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66
"gdcd/snooty"
77
"gdcd/types"
8+
89
"github.com/tmc/langchaingo/llms/ollama"
910
)
1011

audit/gdcd/compare-code-examples/CompareExistingIncomingCodeExampleSlices_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import (
44
"common"
55
"context"
66
"fmt"
7-
"gdcd/add-code-examples"
7+
add_code_examples "gdcd/add-code-examples"
88
"gdcd/compare-code-examples/data"
99
"gdcd/types"
10-
"github.com/tmc/langchaingo/llms/ollama"
1110
"log"
1211
"testing"
12+
13+
"github.com/tmc/langchaingo/llms/ollama"
1314
)
1415

1516
func TestOneNewCodeExampleHandledCorrectly(t *testing.T) {

audit/gdcd/compare-code-examples/HandleNewPageNodes_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import (
55
add_code_examples "gdcd/add-code-examples"
66
"gdcd/compare-code-examples/data"
77
"gdcd/types"
8-
"github.com/tmc/langchaingo/llms/ollama"
98
"log"
109
"testing"
10+
11+
"github.com/tmc/langchaingo/llms/ollama"
1112
)
1213

1314
// NOTE: For these tests, I'm just confirming that we're creating the correct number of new code nodes. We don't need to

0 commit comments

Comments
 (0)