- Errors are reported via Sentry. It has a plugin for Spring Boot.
- We have weekly triage meetings to address each issue in Sentry.
- Once we get through the backlog of errors we’ll change our workflow to a more proactive one.
- We’ll review this process as we go.
The Error Triage meeting will follow:
- Filter Sentry by ‘recent’.
- Each entry, zoom out to 90 days to see context.
- Create GitLab issue and link it to Sentry. Create Issue »
- The issue should take the form:
- Malfunction. → GitLab ‘bug’ Issue, snooze for 1 week.
- Bug in the code. → GitLab ‘bug’ Issue, snooze for 1 week
- Application Notification. → This is likely a feature that should be raised to the Product team to be removed from Sentry workflow. Either the message should be included in a report for Product, or sent to the user, or instrumented some other way. Issue should mention that we remove the error message from the codebase.
- Check for confidential details before pasting.
- Link the issue to Sentry.
- Snooze the error in Sentry for a period, e.g. 6 months. We will use the GitLab issue to track.
- The Product Triage team will pick up and prioritise the issue. High priority issues should be marked as such.
Legacy to Greenfield
- We will gradually improve our Legacy codebase, but we won’t aim to make any fundamental changes.
- As we focus on services, we will extract the code or rewrite the service wholesale.
- If the code is simply extracted it will be classed as Legacy, but we will be in a better position to improve it. We will have to be tolerant of service boundaries being a little inexact.
- If it is re-written it will be classed as Greenfield.
- We use SONAR for Java and Python.
- We use clj-kondo for Clojure.
- We will follow the rules to the letter for Greenfield projects. Sometimes they are cumbersome, but the benefit of a clean codebase nearly always outweighs the annoyance.
- IntelliJ has an excellent plugin which will flag things before they are picked up with CI and get quick feedback.
These should be met before submitting for code review. Reviewer should also confirm as the first step of code review.
- Code should not be merged if:
- Tests don’t pass.
- For Legacy codebases, SONAR results should not have got worse.
- For Greenfield codebases, SONAR results should be green.
- They are not linked to an issue number(s) in commit messages. Click it to make sure it works.
- Review requirements in the linked issues / user stories. Make sure all functionality is represented by tests and implemented.
- If code needs fixing, make the change and resubmit:
- If the merge reduces the test coverage, remove unused code or refactor to write new tests.
- If there is behaviour that hasn’t been specified to the point where a unit test can be written, work with the Product Owner to clarify requirements.
- Check the ‘code review’ box on the relevant tickets. Review other developer actions on the ticket. Don’t move to ‘done’ until all boxes are ticked.
We use standard style guides. Reformat your code before committing.
- We use Google Java Style for Java. You can download it here and import into Intellij.
- Reformat your project before committing. In Intellij you can right-click on the project tree and ‘reformat code’.
- PEP8 is the official Python style.
- Google’s YAPF tool can be used to reformat files. Use
yapf -i -r /path/to/code.
- We use Clojure Style Guide.