1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2026-06-03 16:35:37 +02:00

refactor move state.State.Workflow into own type (#6338)

This commit is contained in:
6543
2026-03-28 15:40:15 +01:00
committed by GitHub
parent c5aa0a9516
commit 7a9f1ff2dc
2 changed files with 9 additions and 10 deletions
+1 -4
View File
@@ -204,10 +204,7 @@ func TestWorkflowWithServiceStep(t *testing.T) {
assert.Greater(t, traces[4].Workflow.Started, int64(0))
assert.EqualValues(t, state.State{
Workflow: struct {
Started int64 `json:"time"`
Error error `json:"error"`
}{
Workflow: state.Workflow{
Started: traces[4].Workflow.Started,
},
CurrStep: &backend.Step{
+8 -6
View File
@@ -23,14 +23,16 @@ import (
// And the workflow is updated alongside it.
type State struct {
// Global state of the currently running Workflow.
Workflow struct {
// Workflow start time
Started int64 `json:"time"`
// Current workflow error state
Error error `json:"error"`
}
Workflow Workflow
// Current step that updates the step and workflow state
CurrStep *backend.Step `json:"step"`
// Current step state
CurrStepState backend.State
}
type Workflow struct {
// Workflow start time
Started int64 `json:"time"`
// Current workflow error state
Error error `json:"error"`
}