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

[Code Freeze] Restructuring the code #1473

Closed
kradalby opened this issue May 23, 2023 · 3 comments
Closed

[Code Freeze] Restructuring the code #1473

kradalby opened this issue May 23, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@kradalby
Copy link
Collaborator

kradalby commented May 23, 2023

Juan and I are currently undertaking a large code refactor to make the code more maintainable.

Currently the goal is to split a lot of the code into modules, which forces us to have separate concerns and make sure that more of the code does one thing, and does it well. We had a lot of cycling dependencies (allowed by one large package) and it made everything very tightly knitted, and testing very hard as you had to set up a massive dependency chain.

Rough plan for how we want to do it:

  1. Move control go code to package hscontrol (Code reorg step 1 #1444)
  2. Split "core" code into packages (types, db, policy) (code reorg part 2, the database #1458)
  • This is mainly a reorg change, where the code change is only to be able to move code
  • types contains all our datatypes, and functions attached to them without dependencies
  • db contains all functions that manipulate and changes the database
  • policy contains all functions related to ACLs, a big change is that it does no longer depend on db
  1. Split and potentially rewrite hscontrol into packages (this might change) (Code reorg part 3 #1477)
  • mapper, all code related to generating MapResponses (the map clients need to find their peers)
  • api, the code that implements our gRPC interface (For now, leave grpc in root)
  • derp, derp related code
  • dns, related code
  1. Rewrite policy package (Codereorg: Part 4, policy improvement #1487)
  • Generate filter and ssh rules per node
  1. Rewrite polling and global state (Codereorg: Part 5, state  #1492)
  2. Rename Machine to Node (Rename Machine to Node #1553)
@kradalby kradalby added the enhancement New feature or request label May 23, 2023
@kradalby kradalby pinned this issue May 23, 2023
@kev-the-dev
Copy link

For clarity, this issue is tagged [Code Freeze] as the maintainers will wait to merge any non-reorg changes until after the re-org? Makes sense to me but wanted to clarify

@kradalby
Copy link
Collaborator Author

kradalby commented May 26, 2023

@kev-the-dev, I realise that I have not actually written that out. Thanks for asking.

Yes, we are not taking contributions at the moment.

@kradalby
Copy link
Collaborator Author

This has been implemented, and we are preparing to get these changes out as alpha soon, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@kradalby @kev-the-dev and others