Skip to content
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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

anbraten
Copy link
Member

Support depends_on in cli.
Simplify how the stepBuilder works.

@anbraten anbraten changed the title Move step builder Support depends_on in cli & move stepbuilder Jul 24, 2024
@anbraten anbraten added server feature add new functionality refactor delete or replace old code cli labels Jul 24, 2024
@@ -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"
Copy link
Member

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 :/

Copy link
Member Author

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 😉

Copy link
Member Author

@anbraten anbraten Sep 12, 2024

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

@woodpecker-bot
Copy link
Collaborator

woodpecker-bot commented Jul 24, 2024

Deploying preview to https://woodpecker-ci-woodpecker-pr-3967.surge.sh

@anbraten anbraten changed the title Support depends_on in cli & move stepbuilder Refactor stepbuilder Sep 26, 2024
)

type Item struct {
Workflow *model.Workflow // TODO: get rid of server type in this package
Copy link
Member Author

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.

Copy link
Member

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

@anbraten anbraten marked this pull request as ready for review September 26, 2024 07:52
@anbraten anbraten removed cli feature add new functionality labels Sep 26, 2024
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
Copy link
Contributor

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?

@6543
Copy link
Member

6543 commented Sep 28, 2024

Linter still fails :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor delete or replace old code server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants