Codebase health
#1249
Replies: 1 comment 1 reply
-
directory is intended to contain the packages which can, conceivably, used outside of the epinio project itself. OTOH |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a broad discussion about how we could improve the health of the Epinio codebase. 🧑⚕️
There are different topics that came into my mind:
I think we can brainstorm a bit on the various topics and maybe open a dedicated discussion for each one if we need to.
Tests
We have a lot of acceptance/end-to-end tests, and this is good, since we have lot of moving pieces, cloud providers, and so on. But we have very few unit tests. While I agree that code coverage is not a useful metrics, I have to say that writing tests is a good way on writing good code.
About this I would propose to add a coverage badge and a goal that we should aim to. At the moment we have a test coverage of less than 20%. The final goal would be at 80%, but even if we could reach the 50% I think we could be happy about it!
We could embed some external tools like Codecov or Coveralls to check this.
Linters
We have added the new
funlen
linter to check for too lengthy function. We should lower the threshold and arrive (hopefully) to the default value.Project structure
This topic is going to be highly opinionated, but I think we can do better on structuring the project.
There is no golden rule on how to structure a Go project, but these are my 2¢, while trying to find resources and guidelines.
I have the feeling that having a no clear guideline on where to put things had brought us to an unclear situation. One "code smell" that I feel is the
helpers
package that looks too big to me, maybe there are things that could be moved in a more appropriate position. For example thekubernetes
package looks pretty big, with lot of things. Would it make sense to move it inside theinternal
package?Interfaces
We have very few interfaces, and we usually pass structs to the functions. This is going to couple the code a lot, and make it really hard to test. We should avoid this.
These are just some small things that came up into my mind, feel free to add more, and let me know. I could missing some context!
Beta Was this translation helpful? Give feedback.
All reactions