Improving Code Quality #2613
Replies: 3 comments
-
Definitely keen on this - we've been tripped up a couple of times just because we don't have shellcheck running across bash scripts. Personally, I'm keener on a post-commit GitHub Action-type nudge to get people into compliance, but happy to take any recommendations |
Beta Was this translation helpful? Give feedback.
-
My preference is for strong conventions that are enforced for each commit/PR - pre-commit hooks are okay, but depending on what they're required to do can be iffy. As for what we should be checking:
|
Beta Was this translation helpful? Give feedback.
-
I've got a few opinions on this topic, I hope you don't mind a bit of a brain dump :-) Improve the Lagoon test suiteIMO this is the Currently we have a quite extensive integration test suite, but very little in the way of unit testing. I've seen this referred to as the test ice-cream cone[0], as opposed to the test pyramid[1]. I think we experience most of the known problems[3] of tests structured this way:
I'd like to see Lagoon re-architected with unit testing in mind. This means things like:
There are plenty of tools to do this, but the way Lagoon is currently architected makes it very difficult to apply those tools. Document developer best practicesAs mentioned earlier in the discussion there are LSPs and other linting / code quality tools with editor integration. We should document how to get set up with the popular editors with at least linters for the main languages in Lagoon like Obviously we can't enforce how people send PRs but at least we can document a "happy path". That way people will fix style/lint issues when their editor tells them to instead of sending a PR and then having to look at CI output. Use more CI toolingSimilarly to the previous section, we should put the same checks in CI. This will catch any issues that do slip through into a PR. These kinds of style/lint checks should be made "required" checks in Github IMO. Improve release engineeringThe Lagoon release process is currently too manual, opaque, and slow. We should automate this more, document the parts which aren't automated, and prioritise the automation work. Ideally this should be fully GitOps driven: merge a branch or push a tag -> get a fully usable release, including helm charts etc. This should also have a goal of increasing the frequency of releases. Daily releases shouldn't be a big deal. The advantage of doing this is that changes go from PR -> production much more quickly. This makes the lifetime of bugs / feature requests much shorter, as well as speeding up the feedback loop for developers. Improve release engineering documentationFor example, here are some release engineering questions that, from what I can tell, aren't documented:
This is about reducing the bus factor. Maybe we can rotate Lagoon release responsibilities to a different person on each release? Document and enforce development best practicesSome things we currently do that IMO lead to more bugs and poorer code quality:
I think some of this can be enforced in Github. Rewrite anything written in bashThis one might be controversial so I left it for last, but here is my reasoning:
Maybe this is more of a stretch goal :) |
Beta Was this translation helpful? Give feedback.
-
I'd like to start a discussion to come up with some actions to help improve the code quality in lagoon. Specifically I'm thinking about the API (and other Node.js services) but this can apply to all our code bases (go, bash, etc).
What should we be doing?
How should we be doing it?
Which tools should we use?
What are we currently doing?
Beta Was this translation helpful? Give feedback.
All reactions