mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-17 17:45:03 +02:00
Allow to restart pipelines that has warnings (#2939)
This commit is contained in:
parent
6de5922408
commit
c6ce23e933
1
.vscode/launch.json
vendored
1
.vscode/launch.json
vendored
@ -42,6 +42,7 @@
|
||||
"runtimeArgs": ["start"],
|
||||
"cwd": "${workspaceFolder}/web",
|
||||
"resolveSourceMapLocations": ["${workspaceFolder}/web/**", "!**/node_modules/**"],
|
||||
"envFile": "${workspaceFolder}/.env",
|
||||
"skipFiles": ["<node_internals>/**"]
|
||||
}
|
||||
]
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"go.woodpecker-ci.org/woodpecker/v2/pipeline/errors"
|
||||
forge_types "go.woodpecker-ci.org/woodpecker/v2/server/forge/types"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/model"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/store"
|
||||
@ -51,12 +50,10 @@ func Approve(ctx context.Context, store store.Store, currentPipeline *model.Pipe
|
||||
}
|
||||
|
||||
currentPipeline, pipelineItems, err := createPipelineItems(ctx, store, currentPipeline, user, repo, yamls, nil)
|
||||
if errors.HasBlockingErrors(err) {
|
||||
if err != nil {
|
||||
msg := fmt.Sprintf("failure to createPipelineItems for %s", repo.FullName)
|
||||
log.Error().Err(err).Msg(msg)
|
||||
return nil, err
|
||||
} else if err != nil {
|
||||
currentPipeline.Errors = errors.GetPipelineErrors(err)
|
||||
return nil, fmt.Errorf(msg)
|
||||
}
|
||||
|
||||
currentPipeline, err = start(ctx, store, currentPipeline, user, repo, pipelineItems)
|
||||
|
@ -91,7 +91,7 @@ func createPipelineItems(c context.Context, store store.Store,
|
||||
yamls []*forge_types.FileMeta, envs map[string]string,
|
||||
) (*model.Pipeline, []*pipeline.Item, error) {
|
||||
pipelineItems, err := parsePipeline(store, currentPipeline, user, repo, yamls, envs)
|
||||
if err != nil {
|
||||
if pipeline_errors.HasBlockingErrors(err) {
|
||||
currentPipeline, uerr := UpdateToStatusError(store, *currentPipeline, err)
|
||||
if uerr != nil {
|
||||
log.Error().Err(uerr).Msgf("Error setting error status of pipeline for %s#%d", repo.FullName, currentPipeline.Number)
|
||||
@ -99,9 +99,10 @@ func createPipelineItems(c context.Context, store store.Store,
|
||||
updatePipelineStatus(c, currentPipeline, repo, user)
|
||||
}
|
||||
|
||||
if pipeline_errors.HasBlockingErrors(err) {
|
||||
return currentPipeline, nil, err
|
||||
}
|
||||
return currentPipeline, nil, err
|
||||
} else if err != nil {
|
||||
currentPipeline.Errors = pipeline_errors.GetPipelineErrors(err)
|
||||
err = updatePipelinePending(c, store, currentPipeline, repo, user)
|
||||
}
|
||||
|
||||
currentPipeline = setPipelineStepsOnPipeline(currentPipeline, pipelineItems)
|
||||
|
Loading…
x
Reference in New Issue
Block a user