Switch to ULID (#2986)

Closes https://github.com/woodpecker-ci/woodpecker/discussions/2156
This commit is contained in:
qwerty287 2023-12-21 20:23:51 +01:00 committed by GitHub
parent 619858e0e9
commit ce4f952b50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

2
go.mod
View file

@ -26,7 +26,6 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.0
github.com/google/go-github/v57 v57.0.0
github.com/google/tink/go v1.7.0
github.com/google/uuid v1.5.0
github.com/gorilla/securecookie v1.1.2
github.com/jellydator/ttlcache/v3 v3.1.1
github.com/joho/godotenv v1.5.1
@ -102,6 +101,7 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.2.0 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect

View file

@ -20,7 +20,7 @@ import (
"path"
"strings"
"github.com/google/uuid"
"github.com/oklog/ulid/v2"
backend_types "go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/metadata"
@ -31,7 +31,7 @@ import (
func (c *Compiler) createProcess(name string, container *yaml_types.Container, stepType backend_types.StepType) (*backend_types.Step, error) {
var (
uuid = uuid.New()
uuid = ulid.Make()
detached bool
workingdir string

View file

@ -21,7 +21,7 @@ import (
"sync"
"time"
"github.com/google/uuid"
"github.com/oklog/ulid/v2"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"golang.org/x/sync/errgroup"
@ -74,7 +74,7 @@ func New(spec *backend.Config, opts ...Option) *Runtime {
r.Description = map[string]string{}
r.spec = spec
r.ctx = context.Background()
r.taskUUID = uuid.New().String()
r.taskUUID = ulid.Make().String()
for _, opts := range opts {
opts(r)
}