Commit Graph

72 Commits

Author SHA1 Message Date
Sofia Papagiannaki
7418a80264
API: Make Swagger specification more consistent (#50576)
* Fix swagger generation targer using mac

Validate using the swagger binarry instead of the docker container

* API: Make swagger specification more consistent

Fix operation parameter ordering
2022-06-14 12:35:22 +02:00
Sofia Papagiannaki
a165b40e56
API: Fix swagger generation (#50071)
* API: Fix Swagger generation using docker

* Unset SWAGGER_GENERATE_EXTENSION for Mac
2022-06-03 13:31:14 +03:00
Sofia Papagiannaki
6112bd0c63
API: Fix swagger specification (#50034)
* API: Fix swagger specification

* Validate specification after generation
2022-06-02 10:49:52 +03:00
sam boyer
be06d37a20
schema: Generate Go and Typescript from Thema coremodels (#49193)
* Add go code generator for coremodels

* Just generate the entire coremodel for now

Maybe we'll need more flexibility as more coremodels are added, but for
now this is fine.

* Add note on type comment about stability, grodkit

* Remove local replace directive for thema

* Generate typescript from coremodel

* Update pkg/coremodel/dashboard/addenda.go

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Update cuetsy to new release

* Update thema to latest

* Fix enum generation for FieldColorModeId

* Put main generated object at the end of the file

* Tweaks to generated Go output

* Retweak back to var

* Add generated coremodel test

* Remove local replace statement again

* Add Make target and call into cuetsy cmd from gen

* Rename and comment linsrc for readability

* Move key codegen bits into reusable package

* Move body of cuetsifier into codegen pkg

Also genericize the diffing output into reusable WriteDiffer.

* Refactor coremodel generator to use WriteDiffer

* Add gen-cue step to CI

* Whip all the codegen automation into shape

* Add simplistic coremodel canonicality controls

* Remove erroneously committed test

* Bump thema version

* Remove dead code

* Improve wording of non-canonicality comment

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-05-27 03:21:37 +02:00
Alexander Weaver
ac8951f689
Alerting: Add support for documenting which alerting APIs are stable (#49018)
* Support for documenting stable vs unstable alerting routes

* empty commit, restart drone

* Touch-up references in root makefile and drop trailing escape newline

* Rebase and regenerate

* Extend README with docs for this change
2022-05-23 14:08:27 -05:00
Dan Cech
5c3308c6f3
add ability to pass builds flags/tags to go via make, update bra config (#46787) 2022-04-01 19:01:05 -04:00
Sofia Papagiannaki
2983082eb3
API: Fix missing enterprise routes in swagger spec (#45152) 2022-02-09 15:31:43 +01:00
Sofia Papagiannaki
35fe58de37
API: Extract OpenAPI specification from source code using go-swagger (#40528)
* API: Using go-swagger for extracting OpenAPI specification from source code

* Merge Grafana Alerting spec

* Include enterprise endpoints (if enabled)

* Serve SwaggerUI under feature flag

* Fix building dev docker images

* Configure swaggerUI

* Add missing json tags

Co-authored-by: Ying WANG <ying.wang@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-02-08 13:38:43 +01:00
Leonard Gram
c6021c8b4f
Build: building a local docker image using build-docker-dev no longer supported (#42563) 2021-12-01 14:34:28 +01:00
malcolmholmes
9c0a2a19fd
Package release before publishing (#42218)
* Package separately to publish

* Fix interpolation

* Windows format envvars

* More descriptive msg

* Won't publish from here

* Resolve docker issues in PR build

* Rename package docker step

* Correct npm release JSON structure
2021-11-30 10:53:07 +00:00
Joan López de la Franca Beltran
d49230d291
Grafana CLI Wire Runner (#41012)
* Set up Wire build graph

* Remove enterprise Wire set

* Move runner package outside commands

* Update Makefile (gen-go path)

* Minor prettier fix

* Include new Wire enterprise file into .gitignore

* Update Wire deps

* Update the grabpl version

Co-authored-by: Dan Cech <dcech@grafana.com>
2021-11-17 20:43:09 +01:00
Alexander Emelin
4cd2575ad0
Live: generate ts definitions for pipeline configs (#41544)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-11-15 22:45:35 +03:00
Dimitris Sotirakis
2b2c0b8b5e
Remove check for local drone version (#41535) 2021-11-12 14:08:43 +00:00
Dimitris Sotirakis
624d7631e6
Build/CI: Make integration-tests depend on initialize (#40782)
* Make integration tests depend on initialize

* Reorder steps for better visualisation
2021-10-21 22:28:57 +02:00
Dimitris Sotirakis
89e7a56714
Makefile: Force use drone-cli 1.4.0 version (#40385)
* Force use drone-cli 1.4.0

* Small modifications to prevent null generation

* Sign drone

* Use bingo to declare drone-cli version

* Update message in Makefile

* Update to latest grabpl version
2021-10-14 16:02:45 +02:00
kay delaney
b2e94d0733
Chore: Migrate yarn from v1 to v2 (#39082)
* Chore: Migrate yarn from v1 to v2

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-10-08 15:19:10 +01:00
Yuriy Tseretyan
428f32bcf9
fix makefile to make lint-go command visibile in help (#39256) 2021-09-21 10:30:47 -04:00
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