Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 922 commits behind fabric8-services:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

ALMighty Core

1. Building from source

The following guide is mainly targeted towards a Linux or Mac OSX development machine. If you are on Windows, we recommend to take a look at Getting started with almighty-core development on Windows.

1.1. Prerequisites

You need to install:

  • go (>= v1.6)

  • git

  • mercurial

  • make

1.1.1. Check your Go version

Run the following command to find out your Go version.

$ go version

You must at least have Go version 1.6. Our code uses a code generation tool called goa and it doesn’t play nice together with Go 1.5.

Ensure the environment variable GO15VENDOREXPERIMENT is set, for example by running export GO15VENDOREXPERIMENT=1. In Go 1.6 it is enabled by default and in Go 1.7 it is always enabled without the ability to turn it off.

If set, the GO15VENDOREXPERIMENT variable tells go to look for dependencies not only in the GOPATH (as usual) but also in a vendor directory located in the source directory.

See Fetch dependencies to see an explanaition on how we deal with dependencies.

1.1.2. Install glide

This project uses glide as a package manager for Go.

To install glide, go to the release page and download the newest binary for your operating system.

Unpack the archive that you’ve downloaded and place the glide executable somewhere so that it is in your PATH.

To check if everything is working, type glide --version in a terminal.

$ glide --version
glide version v0.11.0

Try to use at least version 0.11.0 as we haven’t tested another version.

1.2. Get the code

Assuming you have Go installed and configured (have $GOPATH setup) here is how to build.

Check out the code

$ git clone $GOPATH/src/

1.3. Build

Like most other projects, this one depends on various other projects that need to be downloaded.

We also generate some code from design files that shall make it into our final artifacts.

To fetch the dependencies, generate code and finally build the project you can type make in a freshly clone repository of this project.

$ cd $GOPATH/src/
$ make

1.3.1. Special make targets

There is no need to fetch the dependencies, or re-generate code every time you want to compile. That’s why we offer special make targets for these topics:

Fetch dependencies

This will download all the dependencies for this project inside a directory called vendor. This way we can ensure that every developer and our CI system is using the same version.

$ cd $GOPATH/src/
$ make deps

For dependency management of go packages we use glide. The file glide.yaml contains all dependencies. It is not suggested that you edit the file by hand but if you want to understand the format for this file, look here.

Generate GOA sources

You need to run this command if you just checked out the code and later if you’ve modified the designs.

$ cd $GOPATH/src/
$ make generate

If you want to just build the ALM server and client, run make build.

$ cd $GOPATH/src/
$ make build

This removes all downloaded dependencies, all generated code and compiled artifacts.

$ cd $GOPATH/src/
$ make clean

Here’s how to run all available tests. All tests will check all Go packages except those in the vendor/ directory. Make sure you have docker and docker-compose available.

Setting up test environment - make integration-test-env-prepare

Tear test environment down - make integration-test-env-tear-down


Unit tests have the minimum requirement on time and environment setup.

$ cd $GOPATH/src/
$ make test-unit

Integration tests demand more setup (i.e. the PostgreSQL DB must be already running) and probably time. We recommend that you use docker-compose up -d db.

$ cd $GOPATH/src/
$ make test-integration

To run both, the unit and the integration tests you can run

$ cd $GOPATH/src/
$ make test-all

To visualize the coverage of unit, integration, or all tests you can run these commands:

  • $ make coverage-unit

  • $ make coverage-integration

  • $ make coverage-all

If the tests (see Tests) have not yet run, or if the sources have changed since the last time the tests ran, they will be re-run to produce up to date coverage profiles.

Each of the above tests (see Tests) produces a coverage profile by default. Those coverage files are available under


Here’s how the <placeholders> expand


something like


unit or integration


Sets the mode for coverage analysis for the packages being tested. Possible values for <mode> are set (the default), count, or atomic and they directly relate to the output of go test --help.

  • set: bool: does this statement run?

  • count: int: how many times does this statement run?

  • atomic: int: count, but correct in multithreaded tests; significantly more expensive.

In addition to all individual coverage information for each package, we also create three more files:


This file collects all the coverage profiles for all unit tests.


This file collects all the coverage profiles for all integration tests.


This file is the merge result of the two afore mentioned files and thus gives coverage information for all tests.

2. Configuration file

If no configuration file is specified when the core is started, these are the defaults.

# Postgres configuration
#------------------------ localhost
postgres.port: 5432
postgres.user: postgres
postgres.password: mysecretpassword
postgres.database: postgres
postgres.sslmode: disable
# The amount of time in seconds before the connection times out
postgres.connection.timeout: 5
# Duration to wait before trying to connect again
postgres.connection.retrysleep: 1s

# HTTP configuration


# Misc.

# Enable development related features, e.g. token generation endpoint
developer.mode.enabled: false

# Whether you want to create the common work item types such as bug, feature, ...
populate.commontypes: true

# -----------------------------
# Authentication configuration
# -----------------------------

token.privatekey : >
                    -----BEGIN RSA PRIVATE KEY-----
                    -----END RSA PRIVATE KEY-----

token.publickey : >
                    -----BEGIN PUBLIC KEY-----
                    -----END PUBLIC KEY-----

# ----------------------------
# Github OAuth2 configuration
# ---------------------------- : 875da0d2113ba0a6951d
github.secret : 2fe6736e90a9283036a37059d75ac0c82f4f5288

Although this is a YAML file, we highly suggest to stick to this rather lenghty notation instead of nesting structs.

To override configuration values using environment variables, use the prefix ALMIGHTY_ and replace the dots in the variables names with underscores.

For example to override postgres.password, set the environment variable ALMIGHTY_POSTGRES_PASSWORD to the value of you liking.

Environment variables override the default values and the ones you’ve set in your config file.

2.1. Development

Only files ./*.go, ./design/*.go, ./models/*.go and ./tool/alm-cli/main.go should be edited.

These files and directory are generated:

  • ./app/

  • ./assets/js/

  • ./client/

  • ./swagger/

  • ./tool/cli/

  • ./bindata_asstfs.go

3. Developer setup

Start up dependent docker services using docker-compose and runs auto reload on source change tool fresh.

$ cd $GOPATH/src/
$ make dev

The above steps start the API Server on port 8080.

Test out the build by executing CLI commands in a different terminal.

The CLI needs the API Server which was started on executing make dev to be up and running. Please do not kill the process. Alternatively if you haven’t run make dev you could just start the server by running ./bin/alm.

Generate a token for future use.

./bin/alm-cli generate login -H localhost:8080 --pp

You should get Token in response, save this token in your favourite editor as you need to use this token for POST API calls

Create a work item type (using above token).

./bin/alm-cli create workitemtype --key "<GENERATED TOKEN>" --payload '{"fields":{"system.owner":{"Type":{"Kind":"user"},"Required":true},"system.state":{"Type":{"Kind":"string"},"Required":false}},"name":"Epic"}' -H localhost:8080 --pp

Note: Work Item Type Name is unique. If one tries to create another work item type with same name, error will be trown.

Retrieve the work item type.

$ ./bin/alm-cli show workitemtype --name "Epic" -H localhost:8080

List all available work item types.

$ ./bin/alm-cli list workitemtype -H localhost:8080 --pp

Create a work item.

Based on WorkItemType created above, we can create WorkItem. We need to use name of work item type in the type field below.

$ ./bin/alm-cli create workitem --key "<GENERATED TOKEN>" --payload '{"type": "Epic", "fields": { "system.owner": "tmaeder", "system.state": "open" }}' -H localhost:8080

Retrieve the work item.

$ ./bin/alm-cli show workitem --id 1 -H localhost:8080 --pp

System defined Work Item Types are

  • userstory

  • valueproposition

  • fundamental

  • experience

  • feature

  • bug

Use any one of above to create Work Item based on that type. Following example creates a Work Item of type userstory

$ ./bin/alm-cli create workitem --key "<GENERATED TOKEN>" --payload '{ "data": { "attributes": { "system.owner": "tmaeder", "system.state": "open", "system.title": "Example of an Epic", "version": "1" }, "relationships": { "baseType": { "data": { "id": "Epic", "type": "workitemtypes" } } }, "type": "workitems" } }' -H localhost:8080

In response you should get ID of created item, using that you can retrieve the work item.

$ ./bin/alm-cli show workitem --id <ID> -H localhost:8080 --pp


No description, website, or topics provided.







No releases published


No packages published


  • Go 93.4%
  • Makefile 3.1%
  • Batchfile 1.9%
  • PLpgSQL 0.6%
  • SQLPL 0.3%
  • Shell 0.3%
  • Other 0.4%