Commit Graph

191 Commits

Author SHA1 Message Date
Todd Treece
c090de9ed9
Chore: Move dev-dashboards jsonnet into separate directory (#58619) 2022-11-11 04:19:29 -05:00
sam boyer
07e5f8117f
Reconcile coremodels, entities, objects under new kind framework (#56492)
* Update thema to latest

* Deal with s/Library/*Runtime/

* Commit new, working results of codegen

* We like pointers now

* Always take runtime arg for NewBase()

* Sketchy handwavy pass at entity meta framework

* Little nibbles

* Update pkg/framework/coremodel/entityframework.cue

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>

* Move file into new framework location

* Introduce loaders, Go code

* Complete rename to kind

* Flesh out framework, add svg/dashboard examples

* Cruft removal

* Remove generated kind go files from gitignore

* Refine maturity concept, add SlotKind

* Update embed and go deps

* Export PrefixWithGrafanaCUE

* Make the loader actually work, holy crap

* Many small tweaks to type.cue

* Add Apache 2 licensing exceptions for kinds

* Add new kinds dir, start of generator

* Roll back to earlier oapi-codegen

* Introduce new grafana-specific CUE loaders

* Introduce new tidy code generators framework

* Catch up kind framework with tinkering

* Add slices for the generators

* Add write/verify step to main generator

* Many renames

* Split up kind framework cue files

* Use kind.Decl within generated kinds

* Create kind.SomeDecl wrapper type to cache lineages

* Better names again

* Get one generated implemented, hopefully

* Copy dashboard schema into new kind.cue

* Small fixes to make the initial gen work

* Put svg kind in its new home

* Add generated Go dashboard type

* More renames and cleanups

* Add base kind registry and generator

* Stop blacklisting *_gen.go files

This is not the Go best practice, anyway. All we actually want to ignore
for enterprise is generated wire files.

* Change codegen output directories

pkg/kind -> pkg/kinds
pkg/registry/kindreg -> pkg/registry/corekind

* Rename pkg/framework/kind to pkg/kindsys

* Add core structured kind generator

* Add plural and machine names to kind spec

* Copy playlist over to kind system

* Consolidate kindsys files

* Add raw kind generator

* Update CODEOWNERS for kind framework

* Touch up comments a bit

* More docs tweaks

* Remove generated types to reduce noise for review

* Split each generator into its own file

* Rename Slot kind to Composable kind

* Add handwavy types for customkind loading

* Guard against init calls to framework loader

* First pass at doc on extending the kind system

* Improve attribute example in docs

* Fix wire imports

* Add basic TS types generator

* Fix composable kind category def

* No need for a separate file with generate directive

* Catch dashboard schema up

* Rename generator types to something saner and generic

* Make version configurable in ts/go generators

* Add CommonMeta to ease property access

* Add kindsys prop indicating whether lineage is group

* Put all kind categories back in a single file

* Finish with kindsys group props

* Refactor maturity progression per discussion

- Replace "committed" with "merged"
- All kindcats can use all maturity levels, at least for now

* Convert ts veneer index generator to modular system

* Move over to new jennywrites framework

* Strip down old coremodel generator

* Use public version of jennywrites

* Pull latest thema

* Commit generated Go types

* Add header injection postprocessor

* Move sdboyer/jennywrites to grafana/codejen

* Tweak header output

* Remove dashboard and playlist coremodels

* Fix up backend dashboards devenv test

* Fix TS import patterns to new gen filename

* Update internal imports, remove coremodel registry

* Fix compilation errors, wire generation

* Export and replace the prefix dropper

* More Go struct and field name changes

* Last name fixes, hopefully

* Fix lint errors

* Last lint error

Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
2022-11-10 12:36:40 -08:00
Todd Treece
e105b5a107
Chore: Add jsonnet library for devenv dashboards (#57928) 2022-11-03 11:04:39 -04:00
Josh Hunt
2e16d5499e
Dashboard: Add dashboard validation warning to save drawer (#55732)
* add api route for validating a dashboard json

* add feature flag for showDashboardValidationWarnings

* tidy up

* comments and messages

* swagger specs

* fix typo

* more swagger

* tests!

* tidy test a little bit

* no more ioutil

* api will return different status code depending on validation error

* clean up

* handle 4xx errors

* remove console.log

* fix backend tests

* tidy up

* Swagger: Exclude alpha endpoints

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-10-14 09:51:05 -04:00
Sofia Papagiannaki
4cdbfb7606
Chore: Timeout integration package tests faster (#56287) 2022-10-10 09:27:04 +02:00
Emil Tullstedt
b287047052
Chore: Upgrade Go to 1.19.1 (#54902)
* WIP

* Set public_suffix to a pre Ruby 2.6 version

* we don't need to install python

* Stretch->Buster

* Bump versions in lib.star

* Manually update linter

Sort of messy, but the .mod-file need to contain all dependencies that
use 1.16+ features, otherwise they're assumed to be compiled with
-lang=go1.16 and cannot access generics et al.

Bingo doesn't seem to understand that, but it's possible to manually
update things to get Bingo happy.

* undo reformatting

* Various lint improvements

* More from the linter

* goimports -w ./pkg/

* Disable gocritic

* Add/modify linter exceptions

* lint + flatten nested list

Go 1.19 doesn't support nested lists, and there wasn't an obvious workaround.
https://go.dev/doc/comment#lists
2022-09-12 12:03:49 +02:00
linoman
3f0beee362
Update README build references (#54394) 2022-08-29 16:36:06 +02:00
lean.dev
e8e7b59bb0
Implementing OpenApi 3 specs (converted from Swagger 2) (#53243)
* Adding OpenApi target to makefile, to covert swagger spec into OpenAPI 3
* Adding endpoint to server swaggerui with new openapi3 specs
* Passing output file as parameter for OpenApi3 specs
* Implement workaround for missing host and prefix domain
2022-08-04 13:51:12 -03:00
Sofia Papagiannaki
3713a193d8
Chore: Fix Makefile target dependency (#53165) 2022-08-02 19:42:48 +03:00
Sofia Papagiannaki
3f58e8ec2a
Chore: Cleanup Makefile (#53037)
Remove redundant reference to deleted folder pkg/api/docs/definitions
2022-08-01 16:31:49 +03:00
Sofia Papagiannaki
7ba076de10
Chore: Move swagger definitions to the handlers (#52643) 2022-07-27 09:54:37 -04:00
Sofia Papagiannaki
f7c5eceb21
Chore: Update to the latest grafana-plugin-sdk-go and more swagger fixes (#52445)
* Fix get legacy alert response

* Swagger: Fix get folder by UID response

* Fix conflicting swagger model Alert

Reanme legacy alerting swagger model to LegacyAlert to differentiate it
from the prometheus Alert

* Bump grafana-plugin-sdk-go

* Fix get folder response

* Use go-swagger command for merging the specifications and remove merge_specs script
2022-07-20 16:09:42 +03:00
Kat Yang
ab8ad1bb42
Chore: Add new go test commands for unit, integration, and pro tests to makefile (#51202)
* Chore: Add new go test commands for unit, integration tests to makefile

* Add test-go-unit and test-go-integration targets as dependencies of the test-go target

* Add makefile target for mysql & postgres backends

* Set GRAFANA_TEST_DB variable for the xargs postgres command

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Set GRAFANA_TEST_DB variable for the xargs mysql command

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Use postgres_tests as source

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Set postgres_tests as source

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Clean test cache before postgres and mysql integration test makefile commands

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-07-19 11:04:38 +03:00
Sofia Papagiannaki
a5924315f8
API: Fix failure to generate swagger specification due to missing binary (#51551)
* Fix swagger generation

Add installing binary as dependency to the target

* Some more fixes
2022-06-30 09:58:07 +03:00
Sofia Papagiannaki
1399ab50b3
API: Universal swagger generation (#51033) 2022-06-27 10:54:31 +03:00
ying-jeanne
62531715b3
Chore: remove bra and scripts/go from grafana (#51130) 2022-06-21 11:08:08 +02:00
ying-jeanne
4489f331b8
Chore: Use the bingo built golangci-lint (#51048)
* use the bingo built golangci-lint

* remove grapl usage

* add dependancy
2022-06-17 19:46:20 +02:00
sam boyer
c8239a3a73
dev: Ignore generated go files in bra (#50889) 2022-06-15 16:33:40 +01:00
sam boyer
4c4aa95d38
coremodels: Automatically generate coremodel registries (#50057)
* coremodel: Generate static registry

* Actually make codegen work

Also, remove the per-coremodel assignability test from generator set.

* Make wire gen depend on cue gen

This is necessary now that we're generating a wire set as part of
coremodel registry generation.

* Add wire inject bits to http server

* s/staticregistry/registry/

* move to static and dynamic wording

* Move registry type into registry package

* Use static registry in http handler

* Oi comments
2022-06-15 15:47:04 +02:00
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
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
Carl Bergquist
e61d049623 tech(build): replace npm with yarn (#7108)
* tech(build): replace npm with yarn

* tech(build): change node version for CI
2017-01-06 07:28:43 +01:00
Dan Cech
6b16fcea52 Oauth2 Updates (#6226)
* break out go and js build commands

* support oauth providers that return errors via redirect

* remove extra call to get grafana.net org membership

* removed GitHub specifics from generic OAuth

* readded ability to name generic source

* revert to a backward-compatible state, refactor and clean up

* streamline oauth user creation, make generic oauth support more generic
2016-10-11 08:51:44 +02:00
bergquist
d3a5d5c058 tech(build): update makefile 2016-09-15 13:02:16 +02:00
Dan Cech
650bb4c719 use npm test to run npm tests 2016-04-25 12:53:15 -04:00
Dan Cech
2244224b12 add basic Makefile, remove need for global grunt-cli 2016-04-25 12:44:26 -04:00