agola/doc/devel.md
Simone Gotti d2b09d854f *: use new errors handling library
Implement a new error handling library based on pkg/errors. It provides
stack saving on wrapping and exports some function to add stack saving
also to external errors.
It also implements custom zerolog error formatting without adding too
much verbosity by just printing the chain error file:line without a full
stack trace of every error.

* Add a --detailed-errors options to print error with they full chain
* Wrap all error returns. Use errors.WithStack to wrap without adding a
  new messsage and error.Wrap[f] to add a message.
* Add golangci-lint wrapcheck to check that external packages errors are
  wrapped. This won't check that internal packages error are wrapped.
  But we want also to ensure this case so we'll have to find something
  else to check also these.
2022-02-28 12:49:13 +01:00

1.1 KiB

Local development

Start the web interface

For the first time you'll need the vue cli and its services installed as global modules:

npm install -g @vue/cli @vue/cli-service-global

Inside the agola-web repository run:

npm install
npm run serve

Build the agola binary

To build agola we usually test and support the latest two major versions of Go like in the Go release policy.

make

Start the agola server

  • Copy the example/config.yml where you prefer
./bin/agola serve --embedded-etcd --config /path/to/your/config.yml --components all-base,executor

or use an external etcd (set it in the config.yml):

./bin/agola serve --config /path/to/your/config.yml --components all-base,executor

Error handling

Use the --detailed-errors option to easily follow the errors chain.

When developing you should wrap every error using errors.Wrap[f] or errors.WithStack. The ci uses golangci-lint with the wrapcheck linter enabled to check if some errors aren't wrapped.