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: Reorganize into server/{api,grpc,shared} packages #337

Merged
merged 14 commits into from
Sep 22, 2021

Conversation

cognifloyd
Copy link
Contributor

@cognifloyd cognifloyd commented Sep 21, 2021

Reorganize server/* so that the purpose is evident in the package structure.

  • json/rest-ish APIs are in server/api
  • grpc server (for agent communication) is in server/grpc
  • server.Config is in server/config.go as it is used by both server/api and server/grpc
  • misc utils (used by server/api and server/grpc) are in server/shared
  • drop droneserver import

@6543 6543 added this to the 0.15.0 milestone Sep 21, 2021
@6543 6543 added the refactor delete or replace old code label Sep 21, 2021
@cognifloyd
Copy link
Contributor Author

K. I'm satisfied with this now. :)

@cognifloyd
Copy link
Contributor Author

cognifloyd commented Sep 22, 2021

We could also move:

  • server/debug to server/api/debug
  • server/metrics to server/api/metrics

Does that make sense / would that be a good change?

edit: I just pushed a commit that does that, since those are only used from router, they are logically part of the api

cmd/server/server.go Outdated Show resolved Hide resolved
server/helpers/procBuilder.go Outdated Show resolved Hide resolved
cmd/server/server.go Outdated Show resolved Hide resolved
server/helpers/procBuilder.go Outdated Show resolved Hide resolved
server/helpers/procBuilder.go Outdated Show resolved Hide resolved
Copy link
Member

@anbraten anbraten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just two more naming question

cmd/server/server.go Show resolved Hide resolved
cmd/server/setup.go Outdated Show resolved Hide resolved
@cognifloyd cognifloyd changed the title Refactor: Reorganize into server/{api,grpc,helpers} packages Refactor: Reorganize into server/{api,grpc,shared} packages Sep 22, 2021
@anbraten anbraten merged commit 35a45b7 into woodpecker-ci:master Sep 22, 2021
@cognifloyd cognifloyd deleted the api-reorg branch September 23, 2021 15:33
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants