Skip to content

Latest commit

 

History

History
114 lines (70 loc) · 4.96 KB

CONTRIBUTING.md

File metadata and controls

114 lines (70 loc) · 4.96 KB

Contributing to the Dynatrace Configuration as Code Core Libraries

What to contribute

Dynatrace Configuration as Code Core provides libraries simplifying the development of configuration as code tooling for Dynatrace.

It provides Go libraries for things like API clients, which are shared between several Dynatrace configuration as code tools.

How to contribute

The easiest way to start contributing or helping with the Configuration as Code Core project is to pick an existing issue/bug and get to work.

For proposing a change, we'd like to discuss potential changes in GitHub issues before implementation. That will allow us to give design feedback up front and set expectations about the scope of the change and, for more significant changes, how best to approach the work such that the Configuration as Code team can review it and merge it with other concurrent work. This allows being respectful of the time of community contributors.

The repo follows a relatively standard branching & PR workflow.

Branches naming follows the feature/{Issue}/{description} or bugfix/{Issue}/{description} pattern.

Branches are rebased, and only fast-forward merges to main are permitted. No merge commits.

By default, commits are not auto-squashed when merging a PR, so please ensure your commits are fit to go into main.

For convenience auto-squashing all PR commits into a single one is an optional merge strategy - but we strive for atomic commits with good commit messages in main so not auto-squashing is recommended.

Commits should conform to Conventional Commit standard.

Examples of Commit Style Messages

New Feature Changes

feat: allow provided config object to extend other configs

Bug Fix Changes

fix: change function call

see the issue for details

on typos fixed.

Reviewed-by: Z
Refs #133 

Documentation Changes

docs: correct getting started guide 

More examples can be found here

Code of Conduct and Shared Values

Before contributing, please read and approve our Code Of Conduct outlining our shared values and expectations.

Building the Dynatrace Configuration as Code Core libraries

The libraries are written in Go, so you'll need to have installed Go to build it.

As the libraries provide no executables, you may compile them using make compile, but there are no executables to be built and used.

Generally, make sure to take a look at the Makefile to see available build targets.

Testing the Dynatrace Configuration as Code Core libraries

Run the unit tests for the whole module with make test in the root folder.

Writing Tests

Take a look at Go Testing for more info on testing in Go.

We use github.com/stretchr/testify as a testing/assert library.

Generally, we aim for test coverage above 80% but don't enforce hard limits. Please make sure your code is reasonably well covered by tests.

Checking in go mod and sum files

Go module files go.mod and go.sum are checked-in in the root folder of the repo, so generally, run go from there.

go.mod and go.sum may change while building the project. To keep those files clean of unnecessary changes, please always run go mod tidy before committing changes to these files!

General information on code

Formatting

This project uses the default go formatting tool go fmt.

To format all files, you can use the Make target make format.

Pre-Commit Hook

Before committing changes, please make sure you've added the pre-commit hook from the hooks folder. On Unix, you can use the setup-git-hooks.sh to symlink that file into your .git/hooks folder.