Development environment

The reference build environment is the "CI container" as defined in containers/ci. A native host environment probably deviates from this reference environment in various minor or major ways. This document attempts to help setting up a local development environment that resembles that of the CI container.

Overview of requirements:

  • Node 14+
  • Yarn v1.x
  • Go 1.15+
  • Docker
  • GCP and/or AWS CLIs (gcloud/aws)
  • make
  • git
  • golangci-lint
  • markdownlint

The sections below hopefully help with setting up some of these!

Manage NodeJS with NVM

Our recommendation is to use NVM for managing NodeJS installations. At the time of writing we are using NodeJS 14.x:

nvm install 14
nvm use 14

Building locally

To build locally, visit our Developer Workflows page.

Golang and dependencies

We are currently using Golang 1.15. Go code is a small portion of our code base (under the go/ directory), so this is not terribly important.

We use golangci-lint to lint the Go codebase. You'll need to install it and have it available in your PATH to run the pre-commit hooks locally.

You may need to set GOPRIVATE to be able to build the project in Visual Studio Code. Also, you may want to use the following the following in your preferences.json to configure the Go plugin.

"go.toolsEnvVars": {
"GO111MODULE": "on",
"GOPRIVATE": "github.com/opstrace",
},

Required commit sign-off

Git commit sign-off is required for all commits.

Opstrace is following the Developer Certificate of Origin process instead of requiring a CLA in order to reduce friction toward contributions. All git commits must be have an explicit sign-off asserting the contents of the DCO to pass our CI checks.