Skip to content

Commit 56a7998

Browse files
pieternclaude
andauthored
Migrate from gopkg.in/yaml.v3 to go.yaml.in/yaml/v3 (#4353)
## Changes Update all direct yaml imports to use the actively maintained fork under the official YAML organization. The new package is a drop-in replacement with an identical API. The old gopkg.in/yaml.v3 remains as an indirect dependency from external libraries (testify, databricks-sdk-go, cobra, etc.) until they migrate. Prompted by spf13/cobra#2336. ## Why The original gopkg.in/yaml.v3 repository was archived and marked unmaintained in April 2025. The YAML organization has taken over maintenance and published go.yaml.in/yaml/v3 as the successor. This migration ensures we receive future bug fixes and security updates. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 93b59f2 commit 56a7998

File tree

22 files changed

+34
-21
lines changed

22 files changed

+34
-21
lines changed

NOTICE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ go-ini/ini - https://github.com/go-ini/ini
1212
Copyright ini authors
1313
License - https://github.com/go-ini/ini/blob/main/LICENSE
1414

15+
go-yaml/yaml - https://github.com/yaml/go-yaml
16+
Copyright (c) 2011-2019 Canonical Ltd
17+
Copyright (c) 2006-2011 Kirill Simonov
18+
License - https://github.com/yaml/go-yaml/blob/v3/LICENSE
19+
1520
—--
1621

1722
This software contains code from the following open source projects, licensed under the MPL 2.0 license:
@@ -130,3 +135,8 @@ https://github.com/darccio/mergo/blob/master/LICENSE
130135
https://github.com/gorilla/mux
131136
Copyright (c) 2023 The Gorilla Authors. All rights reserved.
132137
https://github.com/gorilla/mux/blob/main/LICENSE
138+
139+
go-yaml/yaml - https://github.com/yaml/go-yaml
140+
Copyright (c) 2011-2019 Canonical Ltd
141+
Copyright (c) 2006-2011 Kirill Simonov
142+
License - https://github.com/yaml/go-yaml/blob/v3/LICENSE

acceptance/internal/bundle_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55

66
"dario.cat/mergo"
7-
"gopkg.in/yaml.v3"
7+
"go.yaml.in/yaml/v3"
88
)
99

1010
func MergeBundleConfig(source string, bundleConfig map[string]any) (string, error) {

acceptance/internal/bundle_config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/stretchr/testify/assert"
77
"github.com/stretchr/testify/require"
8-
"gopkg.in/yaml.v3"
8+
"go.yaml.in/yaml/v3"
99
)
1010

1111
func TestMergeBundleConfig(t *testing.T) {

bundle/direct/dresources/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"sync"
66

77
"github.com/databricks/cli/libs/structs/structpath"
8-
"gopkg.in/yaml.v3"
8+
"go.yaml.in/yaml/v3"
99
)
1010

1111
// ResourceLifecycleConfig defines lifecycle behavior for a resource type.

bundle/internal/schema/annotations.go

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

12-
yaml3 "gopkg.in/yaml.v3"
12+
yaml3 "go.yaml.in/yaml/v3"
1313

1414
"github.com/databricks/cli/bundle/internal/annotation"
1515
"github.com/databricks/cli/libs/dyn"

bundle/internal/schema/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/databricks/cli/libs/dyn/yamlloader"
1717
"github.com/databricks/cli/libs/jsonschema"
1818
"github.com/stretchr/testify/assert"
19-
"gopkg.in/yaml.v3"
19+
"go.yaml.in/yaml/v3"
2020
)
2121

2222
func copyFile(src, dst string) error {

cmd/bundle/generate/alert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/databricks/databricks-sdk-go/service/sql"
2020
"github.com/databricks/databricks-sdk-go/service/workspace"
2121
"github.com/spf13/cobra"
22-
"gopkg.in/yaml.v3"
22+
"go.yaml.in/yaml/v3"
2323
)
2424

2525
func NewGenerateAlertCommand() *cobra.Command {

cmd/bundle/generate/dashboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import (
3232
"github.com/databricks/databricks-sdk-go/service/dashboards"
3333
"github.com/databricks/databricks-sdk-go/service/workspace"
3434
"github.com/spf13/cobra"
35+
"go.yaml.in/yaml/v3"
3536
"golang.org/x/exp/maps"
36-
"gopkg.in/yaml.v3"
3737
)
3838

3939
type dashboard struct {

cmd/bundle/generate/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/databricks/cli/libs/textutil"
1919
"github.com/databricks/databricks-sdk-go/service/jobs"
2020
"github.com/spf13/cobra"
21-
"gopkg.in/yaml.v3"
21+
"go.yaml.in/yaml/v3"
2222
)
2323

2424
func NewGenerateJobCommand() *cobra.Command {

cmd/bundle/generate/pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/databricks/cli/libs/textutil"
1818
"github.com/databricks/databricks-sdk-go/service/pipelines"
1919
"github.com/spf13/cobra"
20-
"gopkg.in/yaml.v3"
20+
"go.yaml.in/yaml/v3"
2121
)
2222

2323
func NewGeneratePipelineCommand() *cobra.Command {

0 commit comments

Comments
 (0)