Kevin Printz 79f8433675 Cloudwatch: Fix autocomplete for Gamelift dimensions (#19145) (#19146) %!s(int64=6) %!d(string=hai) anos
..
api dd794625dd API: adds redirect helper to simplify http redirects (#19180) %!s(int64=6) %!d(string=hai) anos
bus 87760d4fde Codestyle: Fix govet issues (#17178) %!s(int64=6) %!d(string=hai) anos
cmd 2acffbeb10 CLI: Fix installing plugins on windows (#19061) %!s(int64=6) %!d(string=hai) anos
components e1b2d61ceb backend: null.Float NaN -> null for json marshal (#18284) %!s(int64=6) %!d(string=hai) anos
events de0f04ec3c feat(signup): progress on new sign up and email verification flow, #2353 %!s(int64=10) %!d(string=hai) anos
extensions 1a4be4af8c Enterprise: add dependencies for upcoming features (#18793) %!s(int64=6) %!d(string=hai) anos
infra 80592e3361 Metrics: Adds setting for turning off total stats metrics (#19142) %!s(int64=6) %!d(string=hai) anos
login 7b7b95341e LDAP: Allow an user to be synchronised against LDAP (#18976) %!s(int64=6) %!d(string=hai) anos
middleware 0cbbb43222 LDAP: Add API endpoint to debug user mapping from LDAP (#18833) %!s(int64=6) %!d(string=hai) anos
models a41a7ea656 Backend: Remove redundant condition of `ROLE_VIEWER` (#19211) %!s(int64=6) %!d(string=hai) anos
plugins f7c55d3968 Plugins: better warning when plugins fail to load (#18671) %!s(int64=6) %!d(string=hai) anos
registry d0c00388e6 add functionality to override service in registry %!s(int64=7) %!d(string=hai) anos
services 88051258e9 Azure Monitor: Add support for cross resource queries (#19115) %!s(int64=6) %!d(string=hai) anos
setting 80592e3361 Metrics: Adds setting for turning off total stats metrics (#19142) %!s(int64=6) %!d(string=hai) anos
tsdb 79f8433675 Cloudwatch: Fix autocomplete for Gamelift dimensions (#19145) (#19146) %!s(int64=6) %!d(string=hai) anos
util 35b74a99a8 Emails: resurrect template notification (#18686) %!s(int64=6) %!d(string=hai) anos
ARCHITECTURE.md 2ae6adef26 Codestyle: add guidelines for removing the m alias for models (#17890) %!s(int64=6) %!d(string=hai) anos
README.md 8f150c67aa Docs upgrading deps (#17657) %!s(int64=6) %!d(string=hai) anos
STYLEGUIDE.md caa1314f44 Build: use golangci-lint as a make command (#17739) %!s(int64=6) %!d(string=hai) anos

README.md

Grafana backend codebase

The code styleguide and brief description of the architecture

On going refactorings.

These issues are not something we want to address all at once but something we will improve over time. Since Grafana is released at a regular schedule the prefer approuch is to do this in batches. Not only is it easier to review, it also reduces the risk of conflicts when cherry-picking fixes from master to release branches. Changes that spawn multiple locations are therefore prefered in the end of the release cycle since we make fewer patch releases in the end of the cycle.

Global state

Global state makes testing and debugging software harder and its something we want to avoid when possible. Unfortunately, there is quite a lot of global state in Grafana. The way we want to migrate away from this is to use the inject package to wire up all dependencies either in pkg/cmd/grafana-server/main.go or self registering using registry.RegisterService ex https://github.com/grafana/grafana/blob/master/pkg/services/cleanup/cleanup.go#L25

Reduce the use of the init() function

Should only be used to register services/implementations.

Settings refactoring

The plan is to move all settings to from package level vars in settings package to the setting.Cfg struct. To access the settings services/components can inject this setting.Cfg struct.

Cfg struct Injection example

Reduce the use of Goconvey

We want to migrated away from using Goconvey and use stdlib testing as its the most common approuch in the GO community and we think it will make it easier for new contributors. Read more about how we want to write tests in the ARCHITECTURE.MD docs.

Sqlstore refactoring

The sqlstore handlers all use a global xorm engine variable. This should be refactored to use the Sqlstore instance.

Avoid global HTTP Handler functions

HTTP handlers should be refactored to so the handler methods are on the HttpServer instance or a more detailed handler struct. E.g (AuthHandler). This way they get access to HttpServer service dependencies (& Cfg object) and can avoid global state

Date comparison

Newly introduced date columns in the database should be stored as epochs if date comparison is required. This permits to have a unifed approach for comparing dates against all the supported databases instead of handling seperately each one of them. In addition to this, by comparing epochs error pruning transformations from/to other time zones are no more needed.

Dependency management

Documented in UPDRAGING_DEPENDENCIES.md.