Skip to content

Commit 018a430

Browse files
committed
chore(deps): upgrade Go dependencies and migrate mongo-driver v1 → v2
Bump all outdated Go modules (alecthomas/chroma, go.starlark.net, modernc.org/sqlite, golang.org/x/*, charmbracelet/* indirects, etc.) and migrate go.mongodb.org/mongo-driver v1→v2 (166 files). Breaking changes fixed for v2 BSON driver: - Replace primitive.D/M/A/Binary with bson.D/M/A/Binary (subpackage merged into main bson package) - Replace bsontype.Binary/String with bson.TypeBinary/TypeString - Replace bson.D.Map() with manual key iteration (method removed) - Replace bson.RawArray.Elements() with Values() (API renamed) - Add bson.Type(cv.Type) cast for bsoncore→bson type conversion - Handle v2 behaviour change: nested docs inside bson.M / map[string]any now decode as bson.D instead of bson.M; all type-switch and assertion sites updated (scan.go, parser.go, supplement_describe.go, nav_compat.go x18 sites, resolver.go, domainmodel_modelsdk_test.go) Rebuild helpdesk-golden after nav_compat.go bsonD fix. All tests pass; benchmarks show no regression. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 5f2568c commit 018a430

336 files changed

Lines changed: 648 additions & 964 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/check_bson/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"fmt"
99
"os"
1010

11-
"go.mongodb.org/mongo-driver/bson"
11+
"go.mongodb.org/mongo-driver/v2/bson"
1212
_ "modernc.org/sqlite"
1313
)
1414

cmd/compare_pages/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"os"
99
"strings"
1010

11-
"go.mongodb.org/mongo-driver/bson"
11+
"go.mongodb.org/mongo-driver/v2/bson"
1212
)
1313

1414
func main() {

cmd/debug/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"os"
1010
"path/filepath"
1111

12-
"go.mongodb.org/mongo-driver/bson"
12+
"go.mongodb.org/mongo-driver/v2/bson"
1313
_ "modernc.org/sqlite"
1414
)
1515

cmd/dump_page/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"path/filepath"
1111
"strings"
1212

13-
"go.mongodb.org/mongo-driver/bson"
13+
"go.mongodb.org/mongo-driver/v2/bson"
1414
)
1515

1616
func main() {

cmd/extract_page/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"os"
1010
"strings"
1111

12-
"go.mongodb.org/mongo-driver/bson"
12+
"go.mongodb.org/mongo-driver/v2/bson"
1313
_ "modernc.org/sqlite"
1414
)
1515

cmd/modelsdk-codegen/audit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"sort"
99
"strings"
1010

11-
"go.mongodb.org/mongo-driver/bson"
11+
"go.mongodb.org/mongo-driver/v2/bson"
1212
_ "modernc.org/sqlite"
1313
)
1414

cmd/mxcli/bson/compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ func toMap(val any) (map[string]any, bool) {
407407

408408
// toSlice attempts to convert a value to []any.
409409
func toSlice(val any) ([]any, bool) {
410-
// bson.M unmarshals arrays as primitive.A which is []interface{}
410+
// bson.M unmarshals arrays as bson.A which is []interface{}
411411
s, ok := val.([]any)
412412
return s, ok
413413
}

cmd/mxcli/bson/render.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import (
55
"sort"
66
"strings"
77

8-
"go.mongodb.org/mongo-driver/bson"
9-
"go.mongodb.org/mongo-driver/bson/primitive"
8+
"go.mongodb.org/mongo-driver/v2/bson"
109
)
1110

1211
// Render converts a bson.D document to Normalized DSL text.
@@ -65,7 +64,7 @@ func renderField(sb *strings.Builder, key string, val any, indent int) {
6564
case nil:
6665
fmt.Fprintf(sb, "%s%s: null\n", pad, key)
6766

68-
case primitive.Binary:
67+
case bson.Binary:
6968
fmt.Fprintf(sb, "%s%s: <uuid>\n", pad, key)
7069

7170
case bson.D:

cmd/mxcli/bson/render_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ package bson
33
import (
44
"testing"
55

6-
"go.mongodb.org/mongo-driver/bson"
7-
"go.mongodb.org/mongo-driver/bson/primitive"
6+
"go.mongodb.org/mongo-driver/v2/bson"
87
)
98

109
func TestRenderScalarFields(t *testing.T) {
@@ -27,8 +26,8 @@ func TestRenderScalarFields(t *testing.T) {
2726
func TestRenderUUIDNormalized(t *testing.T) {
2827
doc := bson.D{
2928
{Key: "$Type", Value: "Workflows$Flow"},
30-
{Key: "$ID", Value: primitive.Binary{Subtype: 3, Data: []byte("anything")}},
31-
{Key: "PersistentId", Value: primitive.Binary{Subtype: 3, Data: []byte("anything")}},
29+
{Key: "$ID", Value: bson.Binary{Subtype: 3, Data: []byte("anything")}},
30+
{Key: "PersistentId", Value: bson.Binary{Subtype: 3, Data: []byte("anything")}},
3231
}
3332
got := Render(doc, 0)
3433
want := `Workflows$Flow

cmd/mxcli/cmd_bson_compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
bsondebug "github.com/mendixlabs/mxcli/cmd/mxcli/bson"
88
mmpr "github.com/mendixlabs/mxcli/modelsdk/mpr"
99
"github.com/spf13/cobra"
10-
"go.mongodb.org/mongo-driver/bson"
10+
"go.mongodb.org/mongo-driver/v2/bson"
1111
)
1212

1313
var bsonCompareCmd = &cobra.Command{

0 commit comments

Comments
 (0)