Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"slices"
"strings"

"codeberg.org/6543/xyaml"
"codeberg.org/6543/xyaml/v2"
"github.com/oklog/ulid/v2"
"github.com/urfave/cli/v3"
"go.uber.org/multierr"
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
al.essio.dev/pkg/shellescape v1.6.0
charm.land/huh/v2 v2.0.3
code.gitea.io/sdk/gitea v0.25.1
codeberg.org/6543/go-yaml2json v1.0.0
codeberg.org/6543/xyaml v1.1.0
codeberg.org/6543/go-yaml2json/v2 v2.0.0
codeberg.org/6543/xyaml/v2 v2.0.1
codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v3 v3.0.0
github.com/6543/logfile-open v1.2.1
github.com/adrg/xdg v0.5.3
Expand Down Expand Up @@ -57,6 +57,7 @@ require (
github.com/zalando/go-keyring v0.2.8
gitlab.com/gitlab-org/api/client-go/v2 v2.34.0
go.uber.org/multierr v1.11.0
go.yaml.in/yaml/v4 v4.0.0-rc.4
golang.org/x/crypto v0.52.0
golang.org/x/image v0.41.0
golang.org/x/net v0.55.0
Expand All @@ -80,6 +81,7 @@ require (
charm.land/bubbles/v2 v2.0.0 // indirect
charm.land/bubbletea/v2 v2.0.2 // indirect
charm.land/lipgloss/v2 v2.0.1 // indirect
codeberg.org/6543/xyaml v1.1.0 // indirect
filippo.io/edwards25519 v1.2.0 // indirect
github.com/42wim/httpsig v1.2.4 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ charm.land/lipgloss/v2 v2.0.1 h1:6Xzrn49+Py1Um5q/wZG1gWgER2+7dUyZ9XMEufqPSys=
charm.land/lipgloss/v2 v2.0.1/go.mod h1:KjPle2Qd3YmvP1KL5OMHiHysGcNwq6u83MUjYkFvEkM=
code.gitea.io/sdk/gitea v0.25.1 h1:yywxWwoV+SdjHtbC6unBiXojWdZOtoHuGhEazEXeWuE=
code.gitea.io/sdk/gitea v0.25.1/go.mod h1:uDFWYBU8dgZsgOHwe6C/6olxvf8FHguNB3wW1i83fgg=
codeberg.org/6543/go-yaml2json v1.0.0 h1:heGqo9VEi7gY2yNqjj7X4ADs5nzlFIbGsJtgYDLrnig=
codeberg.org/6543/go-yaml2json v1.0.0/go.mod h1:mz61q14LWF4ZABrgMEDMmk3t9dPi6zgR1uBh2VKV2RQ=
codeberg.org/6543/go-yaml2json/v2 v2.0.0 h1:S2c643uPhlNlURQWjnnOyOGmiAcCewINBzpGRcfwaVg=
codeberg.org/6543/go-yaml2json/v2 v2.0.0/go.mod h1:a0LIJUJKeRvfGJMQC0aDdywyqgQQzaAT2zzi7OPDeOE=
codeberg.org/6543/xyaml v1.1.0 h1:0PWTy8OUqshshjrrnAXFWXSPUEa8R49DIh2ah07SxFc=
codeberg.org/6543/xyaml v1.1.0/go.mod h1:jI7afXLZUxeL4rNNsG1SlHh78L+gma9lK1bIebyFZwA=
codeberg.org/6543/xyaml/v2 v2.0.1 h1:GIkCLqf8TeUHjRqTbhCOGAmc8pzCuAFr4lWgLV+HgPc=
codeberg.org/6543/xyaml/v2 v2.0.1/go.mod h1:OiVkoPEUSJK4xUub8OuQvdnJM9SpM74oGxpGB045JVI=
codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v3 v3.0.0 h1:s2fK+FBwvcYsmKDjNhmoe7B8q9zsgs0UrSlYe9r4XjM=
codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v3 v3.0.0/go.mod h1:Is2jTpS1dizeXm4skQv/ES3QVqnzcNhn2GzZXpiw9f8=
filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
Expand Down Expand Up @@ -655,6 +657,8 @@ go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U=
go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI=
golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
8 changes: 4 additions & 4 deletions pipeline/frontend/yaml/compiler/settings/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"strconv"
"strings"

"codeberg.org/6543/go-yaml2json"
"gopkg.in/yaml.v3"
"codeberg.org/6543/go-yaml2json/v2"
"go.yaml.in/yaml/v4"
)

// ParamsToEnv uses reflection to convert a map[string]interface to a list
Expand Down Expand Up @@ -97,7 +97,7 @@ func sanitizeParamValue(v any, getSecretValue func(name string) (string, error))

case reflect.Map:
switch v := v.(type) {
// gopkg.in/yaml.v3 only emits this map interface
// go.yaml.in/yaml/v4 only emits this map interface
case map[string]any:
// check if it's a secret and return value if it's the case
value, isSecret, err := injectSecret(v, getSecretValue)
Expand Down Expand Up @@ -204,7 +204,7 @@ func injectSecretRecursive(v any, getSecretValue func(name string) (string, erro
switch t.Kind() {
case reflect.Map:
switch v := v.(type) {
// gopkg.in/yaml.v3 only emits this map interface
// go.yaml.in/yaml/v4 only emits this map interface
case map[string]any:
// handle secrets
value, isSecret, err := injectSecret(v, getSecretValue)
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/compiler/settings/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestParamsToEnv(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion pipeline/frontend/yaml/constraint/constraint.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"slices"

"github.com/expr-lang/expr"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"

"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/metadata"
yaml_base_types "go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/types/base"
Expand Down Expand Up @@ -123,6 +123,9 @@ func (when *When) IsLocal() bool {
}

func (when *When) UnmarshalYAML(value *yaml.Node) error {
if value.Kind == yaml.DocumentNode && len(value.Content) == 1 {
value = value.Content[0]
}
switch value.Kind {
case yaml.SequenceNode:
if err := value.Decode(&when.Constraints); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/constraint/constraint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"

"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/metadata"
)
Expand Down
5 changes: 4 additions & 1 deletion pipeline/frontend/yaml/constraint/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/bmatcuk/doublestar/v4"
"go.uber.org/multierr"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"

yaml_base_types "go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/types/base"
)
Expand Down Expand Up @@ -75,6 +75,9 @@ func (c *List) Excludes(v string) bool {

// UnmarshalYAML unmarshal the constraint.
func (c *List) UnmarshalYAML(value *yaml.Node) error {
if value.Kind == yaml.DocumentNode && len(value.Content) == 1 {
value = value.Content[0]
}
out1 := struct {
Include yaml_base_types.StringOrSlice
Exclude yaml_base_types.StringOrSlice
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/constraint/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestConstraintList(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/constraint/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestConstraintMap(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion pipeline/frontend/yaml/constraint/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"strings"

"github.com/bmatcuk/doublestar/v4"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"

yaml_base_types "go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/types/base"
"go.woodpecker-ci.org/woodpecker/v3/shared/optional"
Expand All @@ -35,6 +35,9 @@ type Path struct {

// UnmarshalYAML unmarshal the constraint.
func (c *Path) UnmarshalYAML(value *yaml.Node) error {
if value.Kind == yaml.DocumentNode && len(value.Content) == 1 {
value = value.Content[0]
}
out1 := struct {
Include yaml_base_types.StringOrSlice `yaml:"include"`
Exclude yaml_base_types.StringOrSlice `yaml:"exclude"`
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/constraint/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestConstraintPath(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/linter/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"slices"

"codeberg.org/6543/xyaml"
"codeberg.org/6543/xyaml/v2"
"go.uber.org/multierr"

pipeline_errors "go.woodpecker-ci.org/woodpecker/v3/pipeline/errors"
Expand Down
6 changes: 3 additions & 3 deletions pipeline/frontend/yaml/linter/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"io"
"strings"

"codeberg.org/6543/go-yaml2json"
"codeberg.org/6543/xyaml"
"codeberg.org/6543/go-yaml2json/v2"
"codeberg.org/6543/xyaml/v2"
"github.com/xeipuuv/gojsonschema"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

//go:embed schema.json
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/matrix/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package matrix
import (
"strings"

"codeberg.org/6543/xyaml"
"codeberg.org/6543/xyaml/v2"

pipeline_errors "go.woodpecker-ci.org/woodpecker/v3/pipeline/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package yaml

import (
"codeberg.org/6543/xyaml"
"codeberg.org/6543/xyaml/v2"

"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"

"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/metadata"
yaml_base_types "go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/types/base"
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/types/base/int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type StructStringOrInt struct {
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/types/base/slice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

type StructStringOrSlice struct {
Expand Down
5 changes: 4 additions & 1 deletion pipeline/frontend/yaml/types/container_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package types
import (
"fmt"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

// ContainerList contains ordered collection of containers.
Expand All @@ -27,6 +27,9 @@ type ContainerList struct {

// UnmarshalYAML implements the Unmarshaler interface.
func (c *ContainerList) UnmarshalYAML(value *yaml.Node) error {
if value.Kind == yaml.DocumentNode && len(value.Content) == 1 {
value = value.Content[0]
}
switch value.Kind {
// We support maps ...
case yaml.MappingNode:
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/types/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"

"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/constraint"
"go.woodpecker-ci.org/woodpecker/v3/pipeline/frontend/yaml/types/base"
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/types/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestMarshalNetworks(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pipeline/frontend/yaml/types/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func TestMarshalVolumes(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion shared/optional/serialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package optional
import (
"encoding/json"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)

func (o *Option[T]) UnmarshalJSON(data []byte) error {
Expand All @@ -29,6 +29,9 @@ func (o Option[T]) MarshalJSON() ([]byte, error) {
}

func (o *Option[T]) UnmarshalYAML(value *yaml.Node) error {
if value.Kind == yaml.DocumentNode && len(value.Content) == 1 {
value = value.Content[0]
}
var v *T
if err := value.Decode(&v); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion shared/optional/serialization_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"

"go.woodpecker-ci.org/woodpecker/v3/shared/optional"
)
Expand Down