diff --git a/cmd/server/openapi/docs.go b/cmd/server/openapi/docs.go index 0ae125a3c..09175725f 100644 --- a/cmd/server/openapi/docs.go +++ b/cmd/server/openapi/docs.go @@ -5340,6 +5340,18 @@ const docTemplate = `{ "StatusSkipped": "skipped as another step failed", "StatusSuccess": "successfully finished" }, + "x-enum-descriptions": [ + "skipped as another step failed", + "pending to be executed", + "currently running", + "successfully finished", + "failed to finish (exit code != 0)", + "killed by user", + "error with the config / while parsing / some other system problem", + "waiting for approval", + "blocked and declined", + "created / internal use only" + ], "x-enum-varnames": [ "StatusSkipped", "StatusPending", @@ -5751,6 +5763,12 @@ const docTemplate = `{ "RequireApprovalNone": "require approval for no events", "RequireApprovalPullRequests": "require approval for all PRs" }, + "x-enum-descriptions": [ + "require approval for no events", + "require approval for PRs from forks (default)", + "require approval for all PRs", + "require approval for all external events" + ], "x-enum-varnames": [ "RequireApprovalNone", "RequireApprovalForks", @@ -5885,6 +5903,13 @@ const docTemplate = `{ "PipelineErrorTypeGeneric": "some generic error", "PipelineErrorTypeLinter": "some error with the config syntax" }, + "x-enum-descriptions": [ + "some error with the config syntax", + "using some deprecated feature", + "some error with the config semantics", + "some generic error", + "some bad-habit error" + ], "x-enum-varnames": [ "PipelineErrorTypeLinter", "PipelineErrorTypeDeprecation", diff --git a/go.mod b/go.mod index dd502e6ea..5334dde66 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 - github.com/swaggo/swag v1.16.4 + github.com/swaggo/swag v1.16.5 github.com/urfave/cli-docs/v3 v3.0.0-alpha6 github.com/urfave/cli/v3 v3.3.8 github.com/xeipuuv/gojsonschema v1.2.0 @@ -67,9 +67,9 @@ require ( google.golang.org/grpc v1.73.0 google.golang.org/protobuf v1.36.6 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.33.2 - k8s.io/apimachinery v0.33.2 - k8s.io/client-go v0.33.2 + k8s.io/api v0.33.3 + k8s.io/apimachinery v0.33.3 + k8s.io/client-go v0.33.3 src.techknowlogick.com/xormigrate v1.7.1 xorm.io/builder v0.3.13 xorm.io/xorm v1.3.9 diff --git a/go.sum b/go.sum index 288142fa9..8d831dffe 100644 --- a/go.sum +++ b/go.sum @@ -545,8 +545,8 @@ github.com/swaggo/files v1.0.1 h1:J1bVJ4XHZNq0I46UU90611i9/YzdrF7x92oX1ig5IdE= github.com/swaggo/files v1.0.1/go.mod h1:0qXmMNH6sXNf+73t65aKeB+ApmgxdnkQzVTAj2uaMUg= github.com/swaggo/gin-swagger v1.6.0 h1:y8sxvQ3E20/RCyrXeFfg60r6H0Z+SwpTjMYsMm+zy8M= github.com/swaggo/gin-swagger v1.6.0/go.mod h1:BG00cCEy294xtVpyIAHG6+e2Qzj/xKlRdOqDkvq0uzo= -github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A= -github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg= +github.com/swaggo/swag v1.16.5 h1:nMf2fEV1TetMTJb4XzD0Lz7jFfKJmJKGTygEey8NSxM= +github.com/swaggo/swag v1.16.5/go.mod h1:ngP2etMK5a0P3QBizic5MEwpRmluJZPHjXcMoj4Xesg= github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -787,12 +787,12 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.33.2 h1:YgwIS5jKfA+BZg//OQhkJNIfie/kmRsO0BmNaVSimvY= -k8s.io/api v0.33.2/go.mod h1:fhrbphQJSM2cXzCWgqU29xLDuks4mu7ti9vveEnpSXs= -k8s.io/apimachinery v0.33.2 h1:IHFVhqg59mb8PJWTLi8m1mAoepkUNYmptHsV+Z1m5jY= -k8s.io/apimachinery v0.33.2/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= -k8s.io/client-go v0.33.2 h1:z8CIcc0P581x/J1ZYf4CNzRKxRvQAwoAolYPbtQes+E= -k8s.io/client-go v0.33.2/go.mod h1:9mCgT4wROvL948w6f6ArJNb7yQd7QsvqavDeZHvNmHo= +k8s.io/api v0.33.3 h1:SRd5t//hhkI1buzxb288fy2xvjubstenEKL9K51KBI8= +k8s.io/api v0.33.3/go.mod h1:01Y/iLUjNBM3TAvypct7DIj0M0NIZc+PzAHCIo0CYGE= +k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA= +k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/client-go v0.33.3 h1:M5AfDnKfYmVJif92ngN532gFqakcGi6RvaOF16efrpA= +k8s.io/client-go v0.33.3/go.mod h1:luqKBQggEf3shbxHY4uVENAxrDISLOarxpTKMiUuujg= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= diff --git a/pipeline/rpc/proto/woodpecker.pb.go b/pipeline/rpc/proto/woodpecker.pb.go index b2136b5b2..be14acffe 100644 --- a/pipeline/rpc/proto/woodpecker.pb.go +++ b/pipeline/rpc/proto/woodpecker.pb.go @@ -22,11 +22,12 @@ package proto import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) const ( diff --git a/pipeline/rpc/proto/woodpecker_grpc.pb.go b/pipeline/rpc/proto/woodpecker_grpc.pb.go index 4ecfaf474..9c21c298d 100644 --- a/pipeline/rpc/proto/woodpecker_grpc.pb.go +++ b/pipeline/rpc/proto/woodpecker_grpc.pb.go @@ -23,6 +23,7 @@ package proto import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/server/forge/gitlab/gitlab.go b/server/forge/gitlab/gitlab.go index e6ab4426f..6b52e0aa7 100644 --- a/server/forge/gitlab/gitlab.go +++ b/server/forge/gitlab/gitlab.go @@ -28,7 +28,7 @@ import ( "time" "github.com/rs/zerolog/log" - "gitlab.com/gitlab-org/api/client-go" + gitlab "gitlab.com/gitlab-org/api/client-go" "golang.org/x/oauth2" "go.woodpecker-ci.org/woodpecker/v3/server" diff --git a/server/forge/gitlab/helper.go b/server/forge/gitlab/helper.go index 30c7bbe1d..f6b669bc6 100644 --- a/server/forge/gitlab/helper.go +++ b/server/forge/gitlab/helper.go @@ -19,7 +19,7 @@ import ( "crypto/tls" "net/http" - "gitlab.com/gitlab-org/api/client-go" + gitlab "gitlab.com/gitlab-org/api/client-go" "golang.org/x/oauth2" ) diff --git a/server/forge/gitlab/status.go b/server/forge/gitlab/status.go index be03b7c9d..81d122db4 100644 --- a/server/forge/gitlab/status.go +++ b/server/forge/gitlab/status.go @@ -15,7 +15,7 @@ package gitlab import ( - "gitlab.com/gitlab-org/api/client-go" + gitlab "gitlab.com/gitlab-org/api/client-go" "go.woodpecker-ci.org/woodpecker/v3/server/model" ) diff --git a/server/model/agent.go b/server/model/agent.go index 24d34affa..acadcfb6e 100644 --- a/server/model/agent.go +++ b/server/model/agent.go @@ -40,7 +40,7 @@ type Agent struct { CustomLabels map[string]string `json:"custom_labels" xorm:"JSON 'custom_labels'"` // OrgID is counted as unset if set to -1, this is done to ensure a new(Agent) still enforce the OrgID check by default OrgID int64 `json:"org_id" xorm:"INDEX 'org_id'"` -} // @name Agent +} // @name Agent const ( IDNotSet = -1 diff --git a/server/model/config.go b/server/model/config.go index 7103a5999..4f5cbcfb5 100644 --- a/server/model/config.go +++ b/server/model/config.go @@ -22,7 +22,7 @@ type Config struct { Hash string `json:"hash" xorm:"UNIQUE(s) 'hash'"` Name string `json:"name" xorm:"UNIQUE(s) 'name'"` Data []byte `json:"data" xorm:"LONGBLOB 'data'"` -} // @name Config +} // @name Config func (Config) TableName() string { return "configs" diff --git a/server/model/const.go b/server/model/const.go index d0ab526e7..2137da4c2 100644 --- a/server/model/const.go +++ b/server/model/const.go @@ -20,7 +20,7 @@ import ( "fmt" ) -type WebhookEvent string // @name WebhookEvent +type WebhookEvent string // @name WebhookEvent const ( EventPush WebhookEvent = "push" @@ -51,7 +51,7 @@ func (s WebhookEvent) Validate() error { } // StatusValue represent pipeline states woodpecker know. -type StatusValue string // @name StatusValue +type StatusValue string // @name StatusValue const ( StatusSkipped StatusValue = "skipped" // skipped as another step failed @@ -78,7 +78,7 @@ func (s StatusValue) Validate() error { } // RepoVisibility represent to what state a repo in woodpecker is visible to others. -type RepoVisibility string // @name RepoVisibility +type RepoVisibility string // @name RepoVisibility const ( VisibilityPublic RepoVisibility = "public" diff --git a/server/model/cron.go b/server/model/cron.go index cdce73ef3..7af889085 100644 --- a/server/model/cron.go +++ b/server/model/cron.go @@ -29,7 +29,7 @@ type Cron struct { Schedule string `json:"schedule" xorm:"schedule NOT NULL"` // @weekly, 3min, ... Created int64 `json:"created" xorm:"created NOT NULL DEFAULT 0"` Branch string `json:"branch" xorm:"branch"` -} // @name Cron +} // @name Cron // TableName returns the database table name for xorm. func (Cron) TableName() string { diff --git a/server/model/feed.go b/server/model/feed.go index 04357fc4e..a5e1a6fcd 100644 --- a/server/model/feed.go +++ b/server/model/feed.go @@ -34,4 +34,4 @@ type Feed struct { Author string `json:"author,omitempty" xorm:"pipeline_author"` Avatar string `json:"author_avatar,omitempty" xorm:"pipeline_avatar"` Email string `json:"author_email,omitempty" xorm:"pipeline_email"` -} // @name Feed +} // @name Feed diff --git a/server/model/forge.go b/server/model/forge.go index 87854dd3e..8433d9d7f 100644 --- a/server/model/forge.go +++ b/server/model/forge.go @@ -35,7 +35,7 @@ type Forge struct { SkipVerify bool `json:"skip_verify,omitempty" xorm:"bool"` OAuthHost string `json:"oauth_host,omitempty" xorm:"VARCHAR(250) 'oauth_host'"` // public url for oauth if different from url AdditionalOptions map[string]any `json:"additional_options,omitempty" xorm:"json"` -} // @name Forge +} // @name Forge // TableName returns the database table name for xorm. func (Forge) TableName() string { diff --git a/server/model/log.go b/server/model/log.go index 9ac618063..640c80457 100644 --- a/server/model/log.go +++ b/server/model/log.go @@ -15,7 +15,7 @@ package model // LogEntryType identifies the type of line in the logs. -type LogEntryType int // @name LogEntryType +type LogEntryType int // @name LogEntryType const ( LogEntryStdout LogEntryType = iota @@ -33,7 +33,7 @@ type LogEntry struct { Data []byte `json:"data" xorm:"LONGBLOB"` Created int64 `json:"-" xorm:"created"` Type LogEntryType `json:"type" xorm:"'type'"` -} // @name LogEntry +} // @name LogEntry // TODO: store info what specific command the line belongs to (must be optional and impl. by backend) diff --git a/server/model/org.go b/server/model/org.go index a81f2eaf7..759faa6e9 100644 --- a/server/model/org.go +++ b/server/model/org.go @@ -22,7 +22,7 @@ type Org struct { IsUser bool `json:"is_user" xorm:"is_user"` // if name lookup has to check for membership or not Private bool `json:"-" xorm:"private"` -} // @name Org +} // @name Org // TableName return database table name for xorm. func (Org) TableName() string { diff --git a/server/model/perm.go b/server/model/perm.go index f25c23812..a746c8241 100644 --- a/server/model/perm.go +++ b/server/model/perm.go @@ -26,7 +26,7 @@ type Perm struct { Synced int64 `json:"synced" xorm:"synced"` Created int64 `json:"created" xorm:"created"` Updated int64 `json:"updated" xorm:"updated"` -} // @name Perm +} // @name Perm // TableName return database table name for xorm. func (Perm) TableName() string { @@ -37,4 +37,4 @@ func (Perm) TableName() string { type OrgPerm struct { Member bool `json:"member"` Admin bool `json:"admin"` -} // @name OrgPerm +} // @name OrgPerm diff --git a/server/model/pipeline.go b/server/model/pipeline.go index b74e8184a..8d6a472d0 100644 --- a/server/model/pipeline.go +++ b/server/model/pipeline.go @@ -53,7 +53,7 @@ type Pipeline struct { PullRequestLabels []string `json:"pr_labels,omitempty" xorm:"json 'pr_labels'"` IsPrerelease bool `json:"is_prerelease,omitempty" xorm:"is_prerelease"` FromFork bool `json:"from_fork,omitempty" xorm:"from_fork"` -} // @name Pipeline +} // @name Pipeline // TableName return database table name for xorm. func (Pipeline) TableName() string { @@ -77,4 +77,4 @@ func (p Pipeline) IsMultiPipeline() bool { type PipelineOptions struct { Branch string `json:"branch"` Variables map[string]string `json:"variables"` -} // @name PipelineOptions +} // @name PipelineOptions diff --git a/server/model/pull_request.go b/server/model/pull_request.go index e5ed59717..93ef6baf1 100644 --- a/server/model/pull_request.go +++ b/server/model/pull_request.go @@ -17,4 +17,4 @@ package model type PullRequest struct { Index ForgeRemoteID `json:"index"` Title string `json:"title"` -} // @name PullRequest +} // @name PullRequest diff --git a/server/model/registry.go b/server/model/registry.go index 20af16fed..9f1372977 100644 --- a/server/model/registry.go +++ b/server/model/registry.go @@ -35,7 +35,7 @@ type Registry struct { Username string `json:"username" xorm:"varchar(2000) 'username'"` Password string `json:"password" xorm:"TEXT 'password'"` ReadOnly bool `json:"readonly" xorm:"-"` -} // @name Registry +} // @name Registry func (r Registry) TableName() string { return "registries" diff --git a/server/model/repo.go b/server/model/repo.go index fad2bc78f..a819d87c2 100644 --- a/server/model/repo.go +++ b/server/model/repo.go @@ -72,7 +72,7 @@ type Repo struct { Perm *Perm `json:"-" xorm:"-"` CancelPreviousPipelineEvents []WebhookEvent `json:"cancel_previous_pipeline_events" xorm:"json 'cancel_previous_pipeline_events'"` NetrcTrustedPlugins []string `json:"netrc_trusted" xorm:"json 'netrc_trusted'"` -} // @name Repo +} // @name Repo // TableName return database table name for xorm. func (Repo) TableName() string { @@ -138,7 +138,7 @@ type RepoPatch struct { CancelPreviousPipelineEvents *[]WebhookEvent `json:"cancel_previous_pipeline_events"` NetrcTrusted *[]string `json:"netrc_trusted"` Trusted *TrustedConfigurationPatch `json:"trusted"` -} // @name RepoPatch +} // @name RepoPatch type ForgeRemoteID string @@ -162,4 +162,4 @@ type TrustedConfigurationPatch struct { type RepoLastPipeline struct { *Repo LastPipeline *Pipeline `json:"last_pipeline,omitempty"` -} // @name RepoLastPipeline +} // @name RepoLastPipeline diff --git a/server/model/secret.go b/server/model/secret.go index d9806145b..e510f65b4 100644 --- a/server/model/secret.go +++ b/server/model/secret.go @@ -52,7 +52,7 @@ type Secret struct { Value string `json:"value,omitempty" xorm:"TEXT 'value'"` Images []string `json:"images" xorm:"json 'images'"` Events []WebhookEvent `json:"events" xorm:"json 'events'"` -} // @name Secret +} // @name Secret // TableName return database table name for xorm. func (Secret) TableName() string { diff --git a/server/model/step.go b/server/model/step.go index dba0d3bac..b0418c13a 100644 --- a/server/model/step.go +++ b/server/model/step.go @@ -39,7 +39,7 @@ type Step struct { Started int64 `json:"started,omitempty" xorm:"started"` Finished int64 `json:"finished,omitempty" xorm:"finished"` Type StepType `json:"type,omitempty" xorm:"type"` -} // @name Step +} // @name Step // TableName return database table name for xorm. func (Step) TableName() string { @@ -57,7 +57,7 @@ func (p *Step) Failing() bool { } // StepType identifies the type of step. -type StepType string // @name StepType +type StepType string // @name StepType const ( StepTypeClone StepType = "clone" diff --git a/server/model/task.go b/server/model/task.go index 1429d6832..215305da3 100644 --- a/server/model/task.go +++ b/server/model/task.go @@ -30,7 +30,7 @@ type Task struct { RunOn []string `json:"run_on" xorm:"json 'run_on'"` DepStatus map[string]StatusValue `json:"dep_status" xorm:"json 'dependencies_status'"` AgentID int64 `json:"agent_id" xorm:"'agent_id'"` -} // @name Task +} // @name Task // TableName return database table name for xorm. func (Task) TableName() string { diff --git a/server/model/user.go b/server/model/user.go index 4cc49b6c5..6129ceb12 100644 --- a/server/model/user.go +++ b/server/model/user.go @@ -71,7 +71,7 @@ type User struct { // OrgID is the of the user as model.Org. OrgID int64 `json:"org_id" xorm:"org_id"` -} // @name User +} // @name User // TableName return database table name for xorm. func (User) TableName() string { diff --git a/server/queue/queue.go b/server/queue/queue.go index e575bafcd..a7f4865ac 100644 --- a/server/queue/queue.go +++ b/server/queue/queue.go @@ -47,7 +47,7 @@ type InfoT struct { Running int `json:"running_count"` } `json:"stats"` Paused bool `json:"paused"` -} // @name InfoT +} // @name InfoT func (t *InfoT) String() string { var sb strings.Builder