-
-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor stepbuilder #3967
base: main
Are you sure you want to change the base?
Refactor stepbuilder #3967
Conversation
depends_on
in cli & move stepbuilder
@@ -33,32 +32,29 @@ import ( | |||
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/linter" | |||
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/matrix" | |||
yaml_types "go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/types" | |||
"go.woodpecker-ci.org/woodpecker/v2/server" | |||
forge_types "go.woodpecker-ci.org/woodpecker/v2/server/forge/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pipeline now depends on server :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you might have seen in the code below: // TODO: use don't import from server => move FileMeta to pipeline package
😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicating server models is again quite a pain. Maybe we should move the models to a central place as duplicating them as we did in woodpecker-go
for example is making the code mainly harder to update and read
Deploying preview to https://woodpecker-ci-woodpecker-pr-3967.surge.sh |
depends_on
in cli & move stepbuilder) | ||
|
||
type Item struct { | ||
Workflow *model.Workflow // TODO: get rid of server type in this package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@6543 How should we handle this type? Should we move the server models to a shared package? Would like to avoid duplicating them somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No via DTOs that might to u like more boilerplate but it helps with portability in the long run
Config *backend_types.Config | ||
Yamls []*forge_types.FileMeta // TODO: get rid of server type in this package | ||
CompilerOptions []compiler.Option | ||
GetWorkflowMetadata func(*model.Workflow) metadata.Metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow I find this prop name not clear, maybe name it WorkflowMetadataFunc
?
Linter still fails :/ |
Support
depends_on
in cli.Simplify how the
stepBuilder
works.