From c79d49c862ad800f30abcd4fc9b543f99a8e70f9 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 1 Sep 2022 14:31:12 +0200 Subject: [PATCH] Delete old fallbacks and compatible stuff (#791) Drop ... * ... DRONE_ and deprecated pipeline environment vars * ... deprecated sqlite3 file path --- cmd/server/setup.go | 6 ++---- pipeline/frontend/metadata.go | 3 ++- pipeline/pipeline.go | 7 ------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/cmd/server/setup.go b/cmd/server/setup.go index a4b3da3c0..bfaf803ee 100644 --- a/cmd/server/setup.go +++ b/cmd/server/setup.go @@ -92,7 +92,7 @@ func setupStore(c *cli.Context) (store.Store, error) { return store, nil } -// TODO: convert it to a check and fail hard only function in v0.16.0 to be able to remove it in v0.17.0 +// TODO: remove it in v1.1.0 // TODO: add it to the "how to migrate from drone docs" func fallbackSqlite3File(path string) (string, error) { const dockerDefaultPath = "/var/lib/woodpecker/woodpecker.sqlite" @@ -149,9 +149,7 @@ func fallbackSqlite3File(path string) (string, error) { // file is still at old location _, err = os.Stat(dockerOldPath) if err == nil { - // TODO: use log.Fatal()... in next version - log.Error().Msgf("found sqlite3 file at deprecated path '%s', please move it to '%s' and update your volume path if necessary", dockerOldPath, dockerDefaultPath) - return dockerOldPath, nil + log.Fatal().Msgf("found sqlite3 file at old path '%s', please move it to '%s' and update your volume path if necessary", dockerOldPath, dockerDefaultPath) } // file does not exist at all diff --git a/pipeline/frontend/metadata.go b/pipeline/frontend/metadata.go index b7c826e73..dfa621f46 100644 --- a/pipeline/frontend/metadata.go +++ b/pipeline/frontend/metadata.go @@ -187,7 +187,8 @@ func (m *Metadata) Environ() map[string]string { "CI_SYSTEM_PLATFORM": m.Sys.Platform, // will be set by pipeline platform option or by agent "CI_SYSTEM_VERSION": version.Version, - "CI_SYSTEM_ARCH": m.Sys.Platform, // TODO: remove after next version + // DEPRECATED + "CI_SYSTEM_ARCH": m.Sys.Platform, // TODO: remove after v1.0.x version } if m.Curr.Event == EventTag { params["CI_COMMIT_TAG"] = strings.TrimPrefix(m.Curr.Commit.Ref, "refs/tags/") diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index 3f6e0f5f3..e37dd8d6f 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -206,13 +206,6 @@ func (r *Runtime) execAll(steps []*backend.Step) <-chan error { // Executes the step and returns the state and error. func (r *Runtime) exec(step *backend.Step) (*backend.State, error) { - // TODO: using DRONE_ will be deprecated with 0.15.0. remove fallback with following release - for key, value := range step.Environment { - if strings.HasPrefix(key, "CI_") { - step.Environment[strings.Replace(key, "CI_", "DRONE_", 1)] = value - } - } - if err := r.engine.Exec(r.ctx, step); err != nil { return nil, err }