liquidx-studio.github.io

LiquidXLogo.png


Author: Nobel Khandaker

How we code

Designing and developing a software (SAAS or client software) is a complex process that are often impacted by a variety of constraints. Short time to market, shortage of engineering resources, complexity of the product requirements are often the common factors impacting any software development project. We use the described process to address the common challenges and deliver products that meets the quality bar required by our stakeholders.

How should you use this engineering handbook?

The process described here is largely driven by our Engineering excellence strategy. All engineers at LiquidX studio are mandated to follow the instructions included in this handbook. Any deviation from this engineering process requires prior approval from the head of engineering.

0. Before you code

Before the coding starts for a new product or feature, do the following:

  1. Read the product requirements file and review the UI changes (if any)
  2. Read and review the developer design document design doc template
  3. Create tracking work item on the task board

1. Single source of truth (SSOT)

We follow the Trunk-Based development model for version control and have a single source of truth for all software components and modules.
img

Key concepts

2. Source code

All changes that are deployed in the production (e.g., aws lambda scripts, SQL queries to create table/schema) are stored in our code repositories on Github:

Code changes

All code changes are done by creating a pull-request and then merging it to main branch after the code has been reviewed.

Branch rules/protection

The pull requests to change the code on the main branch is protected by Github’s branch protection rules:

3. Making a change

You are required to do the following to create a pull request on a branch in the repository.

Step 3.1 Follow Clean Coding

Follow SOLID principle, use clean coding

Step 3.2 Consistent Coding Style

You are required to follow a standard coding style:

Step 3.3: Formatting and Static analysis

Step 3.4: Write unit tests

If you are writing backend code (e.g., APIs, web services), your code should have unit test coverage of >90%. For smart contracts, the unit test coverage should be 100%.

Your change should not break the existing unit tests. Changes with the broken unit tests will be blocked from getting deployed in the production.

Step 3.5: Test your feature

Test your feature on your local machine.

Step 3.6: Create Pull requests

When you have completed static analysis, unit testing, and dev testing (in dev machine or in dev environment), create a pull request on the main branch.

Never check in code that will break existing features without a failsafe - use feature flighting!

Step 3.7: Code review

All code checkins require at least 2 sign-offs from the reviewers before they can be merged to the main branch.

Step 3.8: Test your feature

You are the sole owner of the feature/fix you are making for the product. So, you should test the changes thoroughly in the dev and release environment.

Step 3.9: Bug fixes

If any bugs are found, do the following:

5. Deployment

Deployment rings

All code changes will progress along the deployment path to be deployed into production:

img

Deployment and testing in the Release environment

The devops team will continually create release branches from the main and deploy it to the Release environment.

6. Continuous Integration (CI) and Continuous Delivery (CD)

Our repositories are integrated with the build and deployment pipelines of the CircleCI app.

CI

When a pull request is merged to the main, it triggers the build in our CI/CD tool. The build will fail if even a single unit test fails.

CD

When your pull request is merged to the main, it is auto-deployed in the dev environment. DevOps team will continually create release branches from the main branch

7. Production Deployment

WAR room approval

Feature Management and Canary releases

The risk of deploying new feature or code is minimized by using a canary release approach

Hotfixes and patching

Only in case of a critical or a major production incident (see our SLA definition) we will patch our production deployment.

End notes

This guid is designed to provide guidance to our engineers, it cannot guarantee perfection of the overall engineering process or the final product. We will continually have training/discussion sessions to review and collect feedback from our team members to further improve our effectiveness and efficiency.

References