diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index a91b6c1bf..81d42e083 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -3933,10 +3933,6 @@ const docTemplate = `{ "description": "uses reported user for webhooks and name of cron for cron pipelines", "type": "string" }, - "signed": { - "description": "deprecate", - "type": "boolean" - }, "started_at": { "type": "integer" }, @@ -3963,10 +3959,6 @@ const docTemplate = `{ "additionalProperties": { "type": "string" } - }, - "verified": { - "description": "deprecate", - "type": "boolean" } } }, @@ -4230,9 +4222,6 @@ const docTemplate = `{ "name": { "type": "string" }, - "pgid": { - "type": "integer" - }, "pid": { "type": "integer" }, diff --git a/pipeline/stepBuilder.go b/pipeline/stepBuilder.go index 51589b875..6772470a0 100644 --- a/pipeline/stepBuilder.go +++ b/pipeline/stepBuilder.go @@ -83,7 +83,6 @@ func (b *StepBuilder) Build() ([]*Item, error) { UUID: uuid.New().String(), // TODO(#1784): Remove once workflows are a separate entity in database PipelineID: b.Curr.ID, PID: pidSequence, - PGID: pidSequence, State: model.StatusPending, Environ: axis, Name: SanitizePath(y.Name), @@ -305,7 +304,6 @@ func SetPipelineStepsOnPipeline(pipeline *model.Pipeline, pipelineItems []*Item) PipelineID: pipeline.ID, PID: pidSequence, PPID: item.Workflow.PID, - PGID: gid, State: model.StatusPending, } if item.Workflow.State == model.StatusSkipped { diff --git a/server/model/pipeline.go b/server/model/pipeline.go index 55b7ca897..0ef4da99c 100644 --- a/server/model/pipeline.go +++ b/server/model/pipeline.go @@ -43,8 +43,6 @@ type Pipeline struct { Avatar string `json:"author_avatar" xorm:"pipeline_avatar"` Email string `json:"author_email" xorm:"pipeline_email"` Link string `json:"link_url" xorm:"pipeline_link"` - Signed bool `json:"signed" xorm:"pipeline_signed"` // deprecate - Verified bool `json:"verified" xorm:"pipeline_verified"` // deprecate Reviewer string `json:"reviewed_by" xorm:"pipeline_reviewer"` Reviewed int64 `json:"reviewed_at" xorm:"pipeline_reviewed"` Steps []*Step `json:"steps,omitempty" xorm:"-"` diff --git a/server/model/step.go b/server/model/step.go index 450cf9fe5..41b93a51b 100644 --- a/server/model/step.go +++ b/server/model/step.go @@ -35,7 +35,6 @@ type Step struct { PipelineID int64 `json:"pipeline_id" xorm:"UNIQUE(s) INDEX 'step_pipeline_id'"` PID int `json:"pid" xorm:"UNIQUE(s) 'step_pid'"` PPID int `json:"ppid" xorm:"step_ppid"` - PGID int `json:"pgid" xorm:"step_pgid"` Name string `json:"name" xorm:"step_name"` State StatusValue `json:"state" xorm:"step_state"` Error string `json:"error,omitempty" xorm:"VARCHAR(500) step_error"` diff --git a/server/model/step_test.go b/server/model/step_test.go index e933012f8..21d6df69e 100644 --- a/server/model/step_test.go +++ b/server/model/step_test.go @@ -27,7 +27,6 @@ func TestTree(t *testing.T) { PID: 2, PipelineID: 6, PPID: 1, - PGID: 2, Name: "clone", State: StatusSuccess, Error: "0", @@ -37,7 +36,6 @@ func TestTree(t *testing.T) { PipelineID: 6, PID: 1, PPID: 0, - PGID: 1, Name: "lint", State: StatusFailure, Error: "1", @@ -47,7 +45,6 @@ func TestTree(t *testing.T) { PipelineID: 6, PID: 3, PPID: 1, - PGID: 3, Name: "lint", State: StatusFailure, Error: "1", @@ -63,7 +60,6 @@ func TestTree(t *testing.T) { PID: 2, PipelineID: 6, PPID: 1, - PGID: 2, Name: "clone", State: StatusSuccess, Error: "0", diff --git a/server/pipeline/create.go b/server/pipeline/create.go index 17eb45002..12c4f21b9 100644 --- a/server/pipeline/create.go +++ b/server/pipeline/create.go @@ -81,7 +81,6 @@ func Create(ctx context.Context, _store store.Store, repo *model.Repo, pipeline // update some pipeline fields pipeline.RepoID = repo.ID - pipeline.Verified = true pipeline.Status = model.StatusPending if configFetchErr != nil { diff --git a/server/store/datastore/migration/018_drop_old_cols.go b/server/store/datastore/migration/018_drop_old_cols.go new file mode 100644 index 000000000..c13a4091d --- /dev/null +++ b/server/store/datastore/migration/018_drop_old_cols.go @@ -0,0 +1,44 @@ +// Copyright 2023 Woodpecker Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package migration + +import ( + "xorm.io/xorm" +) + +type oldPipeline018 struct { + ID int64 `xorm:"pk autoincr 'pipeline_id'"` + Signed bool `xorm:"pipeline_signed"` + Verified bool `xorm:"pipeline_verified"` +} + +func (oldPipeline018) TableName() string { + return "pipelines" +} + +var dropOldCols = task{ + name: "drop-old-col", + fn: func(sess *xorm.Session) error { + // make sure columns on pipelines exist + if err := sess.Sync(new(oldPipeline018)); err != nil { + return err + } + if err := dropTableColumns(sess, "steps", "step_pgid"); err != nil { + return err + } + + return dropTableColumns(sess, "pipelines", "pipeline_signed", "pipeline_verified") + }, +} diff --git a/server/store/datastore/migration/migration.go b/server/store/datastore/migration/migration.go index 13ffd493b..530f62c6f 100644 --- a/server/store/datastore/migration/migration.go +++ b/server/store/datastore/migration/migration.go @@ -47,6 +47,7 @@ var migrationTasks = []*task{ &removeInactiveRepos, &dropFiles, &removeMachineCol, + &dropOldCols, } var allBeans = []interface{}{ diff --git a/server/store/datastore/step_test.go b/server/store/datastore/step_test.go index 88bf43435..9aa8e4853 100644 --- a/server/store/datastore/step_test.go +++ b/server/store/datastore/step_test.go @@ -34,7 +34,6 @@ func TestStepFind(t *testing.T) { PipelineID: 1000, PID: 1, PPID: 2, - PGID: 3, Name: "build", State: model.StatusSuccess, Error: "pc load letter", @@ -65,14 +64,12 @@ func TestStepChild(t *testing.T) { PipelineID: 1, PID: 1, PPID: 1, - PGID: 1, State: "success", }, { UUID: "2bf387f7-2913-4907-814c-c9ada88707c0", PipelineID: 1, PID: 2, - PGID: 2, PPID: 1, Name: "build", State: "success", @@ -106,7 +103,6 @@ func TestStepList(t *testing.T) { PipelineID: 2, PID: 1, PPID: 1, - PGID: 1, State: "success", }, { @@ -114,14 +110,12 @@ func TestStepList(t *testing.T) { PipelineID: 1, PID: 1, PPID: 1, - PGID: 1, State: "success", }, { UUID: "40aab045-970b-4892-b6df-6f825a7ec97a", PipelineID: 1, PID: 2, - PGID: 2, PPID: 1, Name: "build", State: "success", @@ -150,7 +144,6 @@ func TestStepUpdate(t *testing.T) { PipelineID: 1, PID: 1, PPID: 2, - PGID: 3, Name: "build", State: "pending", Error: "pc load letter", @@ -188,7 +181,6 @@ func TestStepIndexes(t *testing.T) { PipelineID: 1, PID: 1, PPID: 1, - PGID: 1, State: "running", Name: "build", }, @@ -204,7 +196,6 @@ func TestStepIndexes(t *testing.T) { PipelineID: 1, PID: 1, PPID: 1, - PGID: 1, State: "success", Name: "clone", }, @@ -219,7 +210,6 @@ func TestStepIndexes(t *testing.T) { PipelineID: 5, PID: 4, PPID: 3, - PGID: 2, State: "success", Name: "clone", }, @@ -238,7 +228,6 @@ func TestStepByUUID(t *testing.T) { PipelineID: 1, PID: 1, PPID: 1, - PGID: 1, State: "running", Name: "build", }, @@ -247,7 +236,6 @@ func TestStepByUUID(t *testing.T) { PipelineID: 4, PID: 6, PPID: 7, - PGID: 8, Name: "build", State: "pending", Error: "pc load letter", diff --git a/web/src/lib/api/types/pipeline.ts b/web/src/lib/api/types/pipeline.ts index 5cb5a61d0..f319fce78 100644 --- a/web/src/lib/api/types/pipeline.ts +++ b/web/src/lib/api/types/pipeline.ts @@ -106,7 +106,6 @@ export type PipelineStep = { pipeline_id: number; pid: number; ppid: number; - pgid: number; name: string; state: PipelineStatus; exit_code: number; diff --git a/woodpecker-go/woodpecker/types.go b/woodpecker-go/woodpecker/types.go index ac9ddc6d1..25eaff9c0 100644 --- a/woodpecker-go/woodpecker/types.go +++ b/woodpecker-go/woodpecker/types.go @@ -93,7 +93,6 @@ type ( ID int64 `json:"id"` PID int `json:"pid"` PPID int `json:"ppid"` - PGID int `json:"pgid"` Name string `json:"name"` State string `json:"state"` Error string `json:"error,omitempty"`