alertmanager/ui/app/CONTRIBUTING.md
Simon Pasquier 3558e6fd9e Migrate from go-bindata to vfsgen (#1532)
* Migrate from go-bindata to vfsgen

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Ensure idempotent generation for vfsgen

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* asset: update generated files

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Fix asset paths for Windows platforms

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Regenerate assets

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Add vfs wrapper that returns constant mod time

This is identical to what we had with go-bindata and avoids the extra
step of storing the identity of the complete file system in another
location.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Additional cleanup

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-09-24 15:12:40 +02:00

2.4 KiB

Contributing

This document describes how to:

  • Set up your dev environment
  • Become familiar with Elm
  • Develop against AlertManager

Dev Environment Setup

You can either use our default Docker setup or install all dev dependencies locally. For the former you only need Docker installed, for the latter you need to set the environment flag NO_DOCKER to true and have the following dependencies installed:

In addition for easier development you can configure your editor.

All submitted elm code must be formatted with elm-format. Install and execute it however works best for you. We recommend having formatting the file on save, similar to how many developers use gofmt.

If you prefer, there's a make target available to format all elm source files:

# make format

Elm Resources

  • The Official Elm Guide is a great place to start. Going through the entire guide takes about an hour, and is a good primer to get involved in our codebase. Once you've worked through it, you should be able to start writing your feature with the help of the compiler.
  • Check the syntax reference when you need a reminder of how the language works.
  • Read up on how to write elm code.
  • Watch videos from the latest elm-conf
  • Learn how to use the debugger! Elm comes packaged with an excellent debugger. We've found this tool to be invaluable in understanding how the app is working as we're debugging behavior.

Local development workflow

At the top level of this repo, follow the HA AlertManager instructions. Compile the binary, then run with goreman. Add example alerts with the file provided in the HA example folder. Then start the development server:

# cd ui/app
# make dev-server

Your app should be available at http://localhost:<port>. Navigate to src/Main.elm. Any changes to the file system are detected automatically, triggering a recompile of the project.

Commiting changes

Before you commit changes, please run make build-all on the root level Makefile. Please include asset/*_vfsdata.go in your commit.