Commit Graph

55 Commits

Author SHA1 Message Date
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection (#32289)
Fixes #30144

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
Will Browne
8a2f63ee06
Update Makefile (#37926) 2021-08-17 12:06:33 +02:00
Dimitris Sotirakis
e4779cfb4f
Remove pkg-archive from Makefile (#37821) 2021-08-12 11:39:09 +03:00
Julien Duchesne
f41f00dec4
Sign Drone's configuration YAML file (#36528)
* Sign Drone's configuration YAML file
This is needed to protect the repository

* Update grabpl to 2.2.8

* Add comment about generating the drone.yml file
2021-07-14 14:40:28 +02:00
Serge Zaitsev
93cd375ada
remove GO111MODULE (#36235) 2021-06-29 10:01:21 +02:00
Dimitris Sotirakis
d3e510e92f
Chore: Remove Revive standalone linter - use it via golangci-lint (#33150)
* Remove Revive standalone linter - use it via golangci-lint

* Add revive settings to ignore lint errors for now

* Small fix

* Update to grabpl v0.5.53

* Remove errorCode and warningCode from config
2021-04-20 16:51:08 +02:00
Dimitris Sotirakis
c86eeae132
Remove tidy-check script (#31423)
* Remove tidy-check script

* Update grabpl version to 0.5.43
2021-02-23 17:53:30 +02:00
Joan López de la Franca Beltran
b33dcf8213
Proposal to include a tidy check (#27204)
* Initial tidy-check proposal

* Add tidy check to Drone & CircleCI definitions

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-09-21 10:00:44 +02:00
Arve Knudsen
3a362b758a
CI: Upgrade golangci-lint and base image (#26892)
* CI: Upgrade build image to use golangci-lint 1.30.0

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Upgrade Debian base image

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Makefile: Upgrade golangci-lint

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-08-10 18:38:53 +02:00
Carl Bergquist
db8d7ffbf6
Linting fixes for the provisioning package (#25690) 2020-06-30 22:46:41 +02:00
Arve Knudsen
5070f7a75b
Chore: Start harmonizing linting with plugin SDK (#25854)
* Chore: Harmonize linting with plugin SDK

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 14:08:32 +02:00
Arve Knudsen
084542a006
Chore: Consolidate on golangci-lint (#25834)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-26 08:46:08 +02:00
Marcus Efraimsson
c0f3b2929c
Backend plugins: Refactor to allow shared contract between core and external backend plugins (#25472)
Refactor to allow shared contract between core and external backend plugins 
allowing core backend data sources in Grafana to be implemented in same 
way as an external backend plugin.
Use v0.67.0 of sdk.
Add tests for verifying plugin is restarted when process is killed.
Enable strict linting for backendplugin packages
2020-06-11 16:14:05 +02:00
Šimon Podlipský
9106f2f68a
Makefile: Build should build bundled plugins 2020-05-18 10:22:45 +02:00
Marcus Efraimsson
871ad73414
Backend plugins: Renderer v2 plugin (#23625)
grafana-plugin-model is legacy and is replaced by new backend 
plugins SDK and architecture. Renderer is not part of SDK and 
we want to keep it that way for now since it's highly unlikely there 
will be more than one kind of renderer plugin.
So this PR adds support for renderer plugin v2.
Also adds support sending a Device Scale Factor parameter to the 
plugin v2 remote rendering service and by that replaces #22474.
Adds support sending a Headers parameter to the plugin v2 and
remote rendering service which for now only include 
Accect-Language header (the user locale in browser when using 
Grafana), ref grafana/grafana-image-renderer#45.
Fixes health check json details response.
Adds image renderer plugin configuration settings in defaults.ini 
and sample.ini.

Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
2020-04-21 16:16:41 +02:00
Carl Bergquist
9652a1410b
Build: Stricter linting should break the build (#23606) 2020-04-16 16:09:27 +02:00
Carl Bergquist
80f40040b0
Linting fixes for dashboard provsioning (#23576) 2020-04-15 08:12:52 +02:00
Carl Bergquist
0fd5945542
Fixes linting errors in datasource provisioning. (#23515) 2020-04-11 21:07:07 +02:00
Leonard Gram
2850419470
Build: adds make target run-frontend (#20227)
Adds a target that will run yarn install if needed and then build and start watching for changes.
2019-11-12 11:08:40 +01:00
Marcus Olsson
79cbe191b6
Docs: Document Makefile (#19720)
* Document Makefile

* Fix review comments

* Rename group to Services

* Fix review comments
2019-10-22 16:03:22 +02:00
Kyle Brandt
84609abdfa build: update scripts go.(mod|sum) (#19834)
* build: update scripts go.(mod|sum)

* build: exclude gosec rule G108

Gosec rule G108: Profiling endpoint automatically exposed on /debug/pprof
is not applicable since we only enable /debug/pprof endpoint if -profile
flag is provided when starting grafana.
2019-10-16 10:52:51 +02:00
Marcus Efraimsson
b76c6daf85
enforce GO111MODULE=on when running make run (#19724)
Fixes so make run works on older Go versions than 1.13.
2019-10-09 11:01:42 +02:00
Torkel Ödegaard
781b679d47
Release: Fix issue with tag script on osx (#19557)
* Release: Fix issue with release script on osx

* Added shellcheck ignore rule
2019-10-02 10:11:15 +02:00
Sofia Papagiannaki
de075e529d
Build: Fix potential case-insensitive import collision for github.com/Unknwon/com (#18915)
* update gopkg.in/macaron.v1

* update github.com/go-macaron/binding

* update github.com/go-macaron/session

* Substitute github.com/Unknwon/com with github.com/unknwon/com

* Clean up modules using `go mod tidy`

* Substitute github.com/Unknwon/bra with github.com/unknwon/bra
2019-09-09 14:22:06 +03:00
Oleg Gaidarenko
4b16cd6cc8
Build: Introduce shellcheck (#18081)
* Build: introduce shellcheck

Fixes #16198
2019-07-23 13:12:33 +03:00
Oleg Gaidarenko
8202fa2fde
Build: change definition of the vars in makefile (#18151)
Prompted by the @slim-bean talk (thanks!). With that definition
`GO_FILES` var can be dynamically changed, that will be very helpful
in grafana enterprise repo
2019-07-18 12:11:05 +03:00
Oleg Gaidarenko
b049b003f2 Build: allow dynamically change docker image (#18112)
* Build: allow dynamically change docker image

Right now, only for couple DBs.
With the 2.1, you can do `${TAG:-5.6}` without needing the `.env` file, but
it seems it would be better for back-compat to support `.env` right now.

Fixes #17891

* Build: add prefix for removal process

* Docs: mention makefile command instead of the bash

Since we are moving to makefile for things and make command
simplifies some of the actions you have to perform to work with
different environments

* Docs: mention dynamic tags in the docs

* Docs: avoid name collision

Fixes #16107
2019-07-16 08:16:10 +02:00
Oleg Gaidarenko
1cbec50866 Build: consistently reference go binary (#18059)
Before this applied, go binary is referenced inconsistently in makefile.
Sometimes with go modules enabled and sometimes not, sometimes through
a variable and sometimes not.

This change makes all the references in makefile consistent
2019-07-11 20:55:35 +02:00
Oleg Gaidarenko
caa1314f44
Build: use golangci-lint as a make command (#17739)
* Build: use golangci-lint as a make command

* Since gometalinter was deprecated in favor of golangci-lint so it was
  replaced by it. Responsibilities held by the gometalinter was moved to
  golangci-lint

* There was some changes in implementation (that was also mentioned in
  the code comment) between the tools, which uncovered couple errors
  in the code. Those issues were either solved or disabled by
  the inline comments

* Introduce the golangci-lint config, to make their
  configuration more manageable

* Build: replace backend-lint.sh script with make
2019-07-02 16:06:59 +03:00
Oleg Gaidarenko
bc7c420ee8
Build: make bra a local dependency (#17414)
Same idea as with the `gosec`, `revive` and etc.
Allows you to execute `make bra` as pinned local dependency instead
as global one. And therefore alleviates dependency installation issues.

README also updated - I was thinking to provide verbose installation instructions
for it. Since with that way we assume make is installed on the
developer system.

But it might be premature right now?
2019-06-07 16:42:08 +03:00
Oleg Gaidarenko
f43af0e644
Build: specify build flag for docker-compose up (#17411)
Otherwise changed data will not get refreshed to the previous
state.

Which I think is not evident (unless you are familar with docker-compose).
and therefore error-prone (at least it did for me)
2019-06-03 21:09:29 +03:00
Carl Bergquist
d8736a2547
Alerting: golint fixes for alerting (#17246) 2019-06-03 10:25:58 +02:00
Oleg Gaidarenko
a1a498f96c
Build: ignore absence of docker-compose (#17331)
If devenv/docker-compose.yaml file is missing, `devenv-down`
and subsequently `devenv` is not going to work
2019-05-28 20:08:27 +03:00
Oleg Gaidarenko
9ff44b5037
Build(makefile): improve error handling (#17281)
* Build(makefile): improve error handling

Ref baa55ab6ae
2019-05-28 19:32:14 +03:00
Oleg Gaidarenko
baa55ab6ae
Feature: do dev environment via makefile (#17136)
Simplifies dev environment creation. I also planing to utilize
this logic for the LDAP benchmarking
2019-05-25 04:38:01 +03:00
Oleg Gaidarenko
be66ed9dab
Chore: explore possibilities of using makefile (#17039)
* Chore: explore possibilities of using makefile

This is an exploratory commit - I wanted to see how
revive/gosec linters could be integrated with makefile and our build scripts.

Looks better then I expected :)

* Chore: make revive happy

Revive execution was not supplied with path, if you restore there is couple
errors that were popping up - so I fixed them

* Chore: make revive happy
2019-05-16 00:29:26 +03:00
Carl Bergquist
68f5ddf18c
replace dep with go modules (#16017)
- guide shamelessly stolen from prometheus/prometheus
- updates local interface of oauth exchange
- updates local impl of hclogger
- bump jaeger client version

closes #16088
2019-04-16 12:00:55 +02:00
Oleg Gaidarenko
04b3afcd15
Chore: Implement revive (#16200)
Since we do not like some of the default golint rules,
this commit proposes to use https://github.com/mgechev/revive.

And potential revive speed-up should't hurt :).

Right now, presented config (./conf/revive.toml) is permissive,
we might improve it over time however. Fixes for found revive
issues in the code are very limited so it wouldn't be large to review.

Also in this commit:

* Add annotations for makefile commands and declare phony targets

* Rename "gometalinter" script and CI command to "lint"
  since we are doing there a bit more then using gometalinter package

* Add Makefile rules to .editorconfig

* Documentation which mentioned "golint" replaced with revive

Fixes #16109
Ref #16160
2019-03-27 17:53:49 +01:00
Leonard Gram
2e8c4699b0 build: internal metrics for packaging. 2018-11-15 14:42:09 +01:00
David Kaltschmidt
a4ef1d6175 Makefile: dependency-driven target to build node_modules
- added `node_modules` as new target
- dependency on `package.json` and `yarn.lock` allows for quick `make
  node_modules` after a branch change, which noops when the deps have
 not changed
- also added `clean` target
2018-10-29 11:08:30 +01:00
bergquist
2936e34d75 removes protoc from makefile 2018-09-11 10:53:21 +02:00
Dan Cech
96d6657b00 produce an image compatible with grafana-docker 2018-08-09 09:10:53 +02:00
Leonard Gram
0ff54d257a build: makes it easier to build a local docker container. 2018-08-03 09:40:02 +02:00
David Kaltschmidt
c3cc60b080 Support for local Docker builds
* add a git-ignored `local/` folder for Makefile/Dockerfile
* import `local/Makefile` to root Makefile
* add `.dockerignore`
2018-05-07 12:32:18 +02:00
Dan Cech
338655dd37
move Context and session out of middleware 2018-03-06 18:16:49 -05:00
bergquist
9e942f1a6d Adds Tables types to protobuf 2018-01-11 15:34:07 +01:00
bergquist
a2d47427ba separate plugin impl and proto files 2017-12-07 16:33:36 +01:00
bergquist
3c0f61511d build: deps-go is not required for building grafana
setup compiles the backend and caches it which is nice
when developing grafana since incremental compiles are
much faster. But its not required for building grafana.
2017-02-16 09:10:55 +01:00
bergquist
2ad2b96133 build: avoid progress bar update on yarn install
this will save us ~100TB of unneeded data in the long term.
2017-02-13 15:26:10 +01:00
bergquist
60a2041065 tech(build): yarn install should use --pure-lockfile 2017-01-12 15:36:44 +01:00