Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into reuse-query2
Browse files Browse the repository at this point in the history
* grafana/master: (22 commits)
  grafana/toolkit: bundle plugins with webpack (grafana#17850)
  Explore: Adds orgId to URL for sharing purposes (grafana#17895)
  grafana/toolkit: copy sass files (grafana#17888)
  ChangePassword: Rewrite change password page to react (grafana#17811)
  AngularPanels: Fixed loading state indication for angular panels (grafana#17900)
  Explore: Adds support for toggling text edit mode in explore (grafana#17870)
  LDAP: Divide the requests (grafana#17885)
  Build: fixes missing shebang in release tagging script. (grafana#17894)
  Teams: show proper label for each auth provider (grafana#17860)
  Logging: Login and Logout logging actions (grafana#17760) (grafana#17883)
  Loki: Adds comment explaining usage of RFC3339Nano string (grafana#17872)
  Explore: Query rows are now reset when changing data sources (grafana#17865)
  Codestyle: add guidelines for removing the m alias for models (grafana#17890)
  Docs: How to work with themes (grafana#17876)
  Docs: Fix developing plugins index page (grafana#17877)
  StatsPicker: Fix multiple value input layout etc. (grafana#17827)
  Chore: Build grafana-cli when running bra run (grafana#17788)
  Build: use golangci-lint as a make command (grafana#17739)
  Explore: Log highlights only update when user stops typing (grafana#17845)
  Loki: getHighlighterExpressionsFromQuery Returns null if filter term is not quoted (grafana#17852)
  ...
  • Loading branch information
ryantxu committed Jul 3, 2019
2 parents 3088065 + 9f35115 commit 5e4ec96
Show file tree
Hide file tree
Showing 85 changed files with 4,495 additions and 986 deletions.
3 changes: 2 additions & 1 deletion .bra.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[run]
init_cmds = [
["go", "run", "build.go", "-dev", "build-server"],
["go", "run", "build.go", "-dev", "build-cli"],
["go", "run", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]
watch_all = true
Expand Down
32 changes: 16 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
name: check documentation spelling errors
command: 'codespell -I ./words_to_ignore.txt docs/'

backend-lint:
lint-go:
docker:
- image: circleci/golang:1.12.6
environment:
Expand All @@ -124,8 +124,8 @@ jobs:
steps:
- checkout
- run:
name: backend lint
command: './scripts/backend-lint.sh'
name: Lint Go
command: 'make lint-go'

test-frontend:
docker:
Expand Down Expand Up @@ -633,7 +633,7 @@ workflows:
filters: *filter-only-master
- codespell:
filters: *filter-only-master
- backend-lint:
- lint-go:
filters: *filter-only-master
- test-frontend:
filters: *filter-only-master
Expand All @@ -649,7 +649,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
Expand All @@ -661,7 +661,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master
Expand All @@ -671,7 +671,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
- build-all-enterprise
Expand All @@ -682,7 +682,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-master
Expand All @@ -702,7 +702,7 @@ workflows:
filters: *filter-only-release
- codespell:
filters: *filter-only-release
- backend-lint:
- lint-go:
filters: *filter-only-release
- test-frontend:
filters: *filter-only-release
Expand All @@ -718,7 +718,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
Expand All @@ -730,7 +730,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
Expand All @@ -741,7 +741,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
Expand All @@ -751,7 +751,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release
Expand All @@ -769,7 +769,7 @@ workflows:
- build-fast-frontend
- codespell:
filters: *filter-not-release-or-master
- backend-lint:
- lint-go:
filters: *filter-not-release-or-master
- test-frontend:
filters: *filter-not-release-or-master
Expand All @@ -787,7 +787,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
- cache-server-test
Expand All @@ -798,7 +798,7 @@ workflows:
- test-backend
- test-frontend
- codespell
- backend-lint
- lint-go
- mysql-integration-test
- postgres-integration-test
- cache-server-test
Expand Down
31 changes: 23 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-include local/Makefile

.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go test-go test-js test run clean gosec revive devenv devenv-down revive-alerting
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go gosec revive golangci-lint go-vet test-go test-js test run clean devenv devenv-down revive-alerting

GO := GO111MODULE=on go
GO_FILES := ./pkg/...
Expand Down Expand Up @@ -43,10 +43,6 @@ build-docker-full:
@echo "build docker container"
docker build --tag grafana/grafana:dev .

lint-go:
@echo "lint go source"
scripts/backend-lint.sh

test-go:
@echo "test backend"
GO111MODULE=on go test -v ./pkg/...
Expand Down Expand Up @@ -78,27 +74,46 @@ scripts/go/bin/bra: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/bra github.com/Unknwon/bra

scripts/go/bin/golangci-lint: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint

revive: scripts/go/bin/revive
@echo "lint via revive"
@scripts/go/bin/revive \
-formatter stylish \
-config ./scripts/go/configs/revive.toml \
$(GO_FILES)

revive-alerting: scripts/go/bin/revive
@echo "lint alerting via revive"
@scripts/go/bin/revive \
-formatter stylish \
./pkg/services/alerting/...

run: scripts/go/bin/bra
@scripts/go/bin/bra run

# TODO recheck the rules and leave only necessary exclusions
gosec: scripts/go/bin/gosec
@echo "lint via gosec"
@scripts/go/bin/gosec -quiet \
-exclude=G104,G107,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json \
$(GO_FILES)

golangci-lint: scripts/go/bin/golangci-lint
@echo "lint via golangci-lint"
@scripts/go/bin/golangci-lint run \
--config ./scripts/go/configs/.golangci.yml \
$(GO_FILES)

go-vet:
@echo "lint via go vet"
@go vet $(GO_FILES)

lint-go: go-vet golangci-lint revive revive-alerting gosec

run: scripts/go/bin/bra
@scripts/go/bin/bra run

# create docker-compose file with provided sources and start them
# example: make devenv sources=postgres,openldap
ifeq ($(sources),)
Expand Down
18 changes: 15 additions & 3 deletions UPGRADING_DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,30 @@ The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__mo

All dependencies are vendored in the `vendor/` directory.

_Note:_ Since most developers of Grafana still use the `GOPATH` we need to specify `GO111MODULE=on` to make `go mod` and `got get` work as intended. If you have setup Grafana outside of the `GOPATH` on your machine you can skip `GO111MODULE=on` when running the commands below.

To add or update a new dependency, use the `go get` command:

```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
# Pick the latest tagged release.
go get example.com/some/module/pkg
GO111MODULE=on go get example.com/some/module/pkg

# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z
GO111MODULE=on go get example.com/some/module/pkg@vX.Y.Z
```

Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:

```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
GO111MODULE=on go mod tidy

GO111MODULE=on go mod vendor
```

You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request.

## Node.js Dependencies

Updated using `yarn`.
Expand All @@ -60,7 +72,7 @@ Our builds run on CircleCI through our build script.

The main build step (in CircleCI) is built using a custom build container that comes pre-baked with some of the necessary dependencies.

Link: [grafana-build-container](https://github.com/grafana/grafana-build-container)
Link: [grafana/build-container](https://github.com/grafana/grafana/tree/master/scripts/build/ci-build)

#### Dependencies

Expand Down
Loading

0 comments on commit 5e4ec96

Please sign in to comment.