Code Review / Pull Requests requirements
Intro
When code is created, it must go through peer review. Why? Because we're human. We make mistakes. We miss things. That is one of the underlying premises of the indeni platform. To decrease the chances of error in the knowledge we develop, we must employ peer review.
When a knowledge expert finishes work and test on an ind script, or a rule, they will use the "pull request" feature to request a review of their code. A pull request essentially means "I've developed code on a side branch on GIT, and I want to merge it into the main repository".
Important
Please use Visual Studio code and the Indeni code quality plugin to catch problems as you develop
Required test for PR submission
Section | Topic | Comments |
---|---|---|
Hands on | Add a link to a server with the code deployed Add live alert |
|
Code | Readability | |
Naming conventions |
| |
IND use specific tags, and not generic ones | ||
Test file created in Python to validate your code | ||
Grammar of friendly strings |
| |
Data is always reported and only once | ||
| Error handling
The code must not crash! | Example class ShowSystemEnvironmentals(BaseParser):
def parse(self, raw_data: str, dynamic_var: dict, device_tags: dict):
if raw_data:
xml_data = helper_methods.parse_data_as_xml(raw_data)
if xml_data and xml_data['response']['@status'] == 'success':
/* code goes here */
|
| ATE
|
|
Tests | Test doc
|
|
| In the UI Validate all of your work is working properly
|
|
| Content testing
|
|
| Negative testing
|
|
IND is loaded without failure |
| |
| Rules |
|
Review logs | Look for ERROR and FAIL in the following log files:
| |
Alert
| ||
Auto-Triage
|
Important
Check out this New Common Mistakes Developing Automation Script page for more details.