Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 3.13 KB

development.md

File metadata and controls

72 lines (54 loc) · 3.13 KB

Development Documentation

Development Prerequisites

In addition to prerequisites in the main README, we also need

Functional Tests

Unit tests and integration tests are run by CircleCI on each commit pushed to Github. To be more confident after making a change, it is highly recommended to run functional tests locally.

make func_test

Functional tests make requests to RESTful APIs and gRPC APIs and print responses as well as data in the test database.

Commit Message Scope

Timer API Server adopts Angular Commit style.

Below are scopes used in Timer API Server for each commit type.

chore

  • makefile: changes related to makefiles.
  • lint: changes related to lint configs(e.g. .golangci.yml).
  • migration: changes related to migration files.
  • config: changes related to config files(e.g. config/example.yml).
  • git: changes related to git(e.g. .gitignore).
  • script: changes to scripts(in scripts/ other than makefiles)

feat, fix, style, refactor, perf, test

  • resource: changes to internal/resource.
  • rest: changes to internal/restserver.
  • grpc: changes to internal/grpcserver.
  • pkg: changes to internal/pkg.
  • app: changes to internal/app.

ci

  • circleci: changes related to circleci(e.g. .circleci/config.yml).
  • docker: changes related to docker (e.g. build/docker/Dockerfile).

docs

  • readme: changes related to readme files.
  • swagger: changes related to swagger docs(e.g. api/rest/swagger/swagger.yml).
  • comment: changes to comments.

build

  • <No specific scope>: changes to dependencies(e.g. go.mod)

Workflow

Timer API server uses Gitflow.

To make changes, a feature branch should be checked out from branch develop as the branch to work on. A Pull Request that intends to merge the feature branch to branch develop should be created on Github and make sure the CircleCI check passes.

Naming Convention for Feature branches

The scope of feature branches are encouraged to be small. The gist of Angular Commit style applies also to the naming of a feature branch. For example,

feat(app)/diable-reading-from-config-file-by-default
docs(readme)/add-overview-image
chore(makefile)/remove-mock-cleaning-in-phony-go-clean

Makefile

Makefile provides many handy phonies to automate tasks during development. For description of each phony, see the comment right above it. For a list of common top-level phonies, run make help at the root directory of the project.