mirror of https://github.com/grafana/grafana.git
[Enterprise] Consolidate extensions folders and keep them around (#98486)
* WIP: copy approach * Fix package name * Do not ignore .keep for frontend extensions * Add keep file for frontend extensions * Tweak makefile to generate enterprise swagger or not * Remove duplicate imports * Add build extensions * Add CMD extensions * Add keep to e2e extensions * Add .keep * Reduce file structure changes * Ignore boring crypto * Add e2e extensions keep file * Remove enterprise file * Update .gitignore * Move things around * Update git ignore * Consolidate backend extensions folder * Move enterprise deps * Update comment * Do not use build tags * Ignore setting enterprise * Revert changes in makefile * Revert package changes * Add back extensions main.go * Update git ignore * Ignore spanner tests * Trick ignore files only by git * Add .ignore file to CODEOWNERS for frontend-ops * Fix issue with noisy duplicate targets
This commit is contained in:
parent
2014d27def
commit
8edfff1bba
|
@ -5,6 +5,10 @@ GOPATH ?= $(shell go env GOPATH)
|
||||||
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
|
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
|
||||||
GO ?= $(shell which go)
|
GO ?= $(shell which go)
|
||||||
|
|
||||||
|
# Add this near the top of the file, after the initial variable definitions
|
||||||
|
ifndef VARIABLES_MK
|
||||||
|
VARIABLES_MK := 1
|
||||||
|
|
||||||
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
|
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
|
||||||
# will be used; reinstalling only if needed.
|
# will be used; reinstalling only if needed.
|
||||||
# For example for bra variable:
|
# For example for bra variable:
|
||||||
|
@ -65,3 +69,4 @@ $(SWAGGER): $(BINGO_DIR)/swagger.mod
|
||||||
@echo "(re)installing $(GOBIN)/swagger-v0.30.6-0.20240310114303-db51e79a0e37"
|
@echo "(re)installing $(GOBIN)/swagger-v0.30.6-0.20240310114303-db51e79a0e37"
|
||||||
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=swagger.mod -o=$(GOBIN)/swagger-v0.30.6-0.20240310114303-db51e79a0e37 "github.com/go-swagger/go-swagger/cmd/swagger"
|
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=swagger.mod -o=$(GOBIN)/swagger-v0.30.6-0.20240310114303-db51e79a0e37 "github.com/go-swagger/go-swagger/cmd/swagger"
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
|
@ -444,6 +444,7 @@
|
||||||
/.betterer.eslint.config.js @grafana/frontend-ops
|
/.betterer.eslint.config.js @grafana/frontend-ops
|
||||||
/.gitattributes @grafana/frontend-ops
|
/.gitattributes @grafana/frontend-ops
|
||||||
/.gitignore @grafana/frontend-ops
|
/.gitignore @grafana/frontend-ops
|
||||||
|
/.ignore @grafana/frontend-ops
|
||||||
/.nvmrc @grafana/frontend-ops
|
/.nvmrc @grafana/frontend-ops
|
||||||
/.prettierignore @grafana/frontend-ops
|
/.prettierignore @grafana/frontend-ops
|
||||||
/.yarn @grafana/frontend-ops
|
/.yarn @grafana/frontend-ops
|
||||||
|
|
|
@ -40,6 +40,7 @@ __debug_bin*
|
||||||
# This is the new place of the block, but I leave the previous here for a while
|
# This is the new place of the block, but I leave the previous here for a while
|
||||||
/devenv/docker/blocks/auth/saml-enterprise
|
/devenv/docker/blocks/auth/saml-enterprise
|
||||||
/devenv/docker/blocks/auth/signer
|
/devenv/docker/blocks/auth/signer
|
||||||
|
/devenv/docker/blocks/spanner_tests
|
||||||
|
|
||||||
/tmp
|
/tmp
|
||||||
tools/phantomjs/phantomjs
|
tools/phantomjs/phantomjs
|
||||||
|
@ -103,14 +104,18 @@ profile.cov
|
||||||
/pkg/cmd/grafana-cli/grafana-cli
|
/pkg/cmd/grafana-cli/grafana-cli
|
||||||
/pkg/cmd/grafana-server/grafana-server
|
/pkg/cmd/grafana-server/grafana-server
|
||||||
/pkg/cmd/grafana-server/debug
|
/pkg/cmd/grafana-server/debug
|
||||||
/pkg/extensions/*
|
|
||||||
/pkg/build/cmd/artifactspage.go
|
# Extensions
|
||||||
/pkg/build/cmd/artifactspage.tmpl.html
|
|
||||||
/pkg/build/cmd/exportversion.go
|
|
||||||
/pkg/server/wireexts_enterprise.go
|
|
||||||
/pkg/cmd/grafana-cli/runner/wireexts_enterprise.go
|
/pkg/cmd/grafana-cli/runner/wireexts_enterprise.go
|
||||||
|
/pkg/server/wireexts_enterprise.go
|
||||||
|
/pkg/build/cmd/enterprise.go
|
||||||
|
/pkg/extensions/*
|
||||||
|
!/pkg/extensions/.keep
|
||||||
!/pkg/extensions/main.go
|
!/pkg/extensions/main.go
|
||||||
/public/app/extensions
|
/public/app/extensions
|
||||||
|
!/public/app/extensions/.keep
|
||||||
|
|
||||||
|
|
||||||
debug.test
|
debug.test
|
||||||
/examples/*/dist
|
/examples/*/dist
|
||||||
/packaging/**/*.rpm
|
/packaging/**/*.rpm
|
||||||
|
@ -170,6 +175,7 @@ compilation-stats.json
|
||||||
/e2e/benchmarks/**/results
|
/e2e/benchmarks/**/results
|
||||||
/e2e/build_results.zip
|
/e2e/build_results.zip
|
||||||
/e2e/extensions
|
/e2e/extensions
|
||||||
|
!/e2e/extensions/.keep
|
||||||
/e2e/extensions-suite
|
/e2e/extensions-suite
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# This is a trick to ignore files only by git but not by other tools
|
||||||
|
!/public/app/extensions
|
||||||
|
!/pkg/extensions/*
|
||||||
|
!/pkg/cmd/grafana-cli/runner/wireexts_enterprise.go
|
||||||
|
!/pkg/server/wireexts_enterprise.go
|
||||||
|
!/pkg/build/cmd/enterprise.go
|
||||||
|
!/pkg/extensions/*
|
||||||
|
|
||||||
|
# Enterprise emails
|
||||||
|
!/emails/templates/enterprise_*
|
||||||
|
!/public/emails/enterprise_*
|
||||||
|
|
||||||
|
# Enterprise reporting fonts
|
||||||
|
!/public/fonts/dejavu
|
||||||
|
|
||||||
|
# Enterprise devenv
|
||||||
|
!/devenv/docker/blocks/grafana-enterprise
|
||||||
|
!/devenv/docker/blocks/saml-enterprise
|
||||||
|
# This is the new place of the block, but I leave the previous here for a while
|
||||||
|
!/devenv/docker/blocks/auth/saml-enterprise
|
||||||
|
!/devenv/docker/blocks/auth/signer
|
||||||
|
!/devenv/docker/blocks/spanner_tests
|
|
@ -21,10 +21,6 @@ var (
|
||||||
Usage: "Specify number of tries before failing",
|
Usage: "Specify number of tries before failing",
|
||||||
Value: 1,
|
Value: 1,
|
||||||
}
|
}
|
||||||
dryRunFlag = cli.BoolFlag{
|
|
||||||
Name: "dry-run",
|
|
||||||
Usage: "Only simulate actions",
|
|
||||||
}
|
|
||||||
tagFlag = cli.StringFlag{
|
tagFlag = cli.StringFlag{
|
||||||
Name: "tag",
|
Name: "tag",
|
||||||
Usage: "Grafana version tag",
|
Usage: "Grafana version tag",
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/build"
|
"github.com/grafana/grafana/pkg/build"
|
||||||
|
"github.com/grafana/grafana/pkg/build/cmd/util"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -66,7 +67,7 @@ func main() {
|
||||||
Name: "publish-metrics",
|
Name: "publish-metrics",
|
||||||
Usage: "Publish a set of metrics from stdin",
|
Usage: "Publish a set of metrics from stdin",
|
||||||
ArgsUsage: "<api-key>",
|
ArgsUsage: "<api-key>",
|
||||||
Action: MaxArgCountWrapper(1, PublishMetrics),
|
Action: util.MaxArgCountWrapper(1, PublishMetrics),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "verify-drone",
|
Name: "verify-drone",
|
||||||
|
@ -178,7 +179,7 @@ func main() {
|
||||||
Name: "fetch",
|
Name: "fetch",
|
||||||
Usage: "Fetch Grafana Docker images",
|
Usage: "Fetch Grafana Docker images",
|
||||||
ArgsUsage: "[version]",
|
ArgsUsage: "[version]",
|
||||||
Action: MaxArgCountWrapper(1, FetchImages),
|
Action: util.MaxArgCountWrapper(1, FetchImages),
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&editionFlag,
|
&editionFlag,
|
||||||
},
|
},
|
||||||
|
@ -229,7 +230,7 @@ func main() {
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&editionFlag,
|
&editionFlag,
|
||||||
&buildIDFlag,
|
&buildIDFlag,
|
||||||
&dryRunFlag,
|
&util.DryRunFlag,
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "src-bucket",
|
Name: "src-bucket",
|
||||||
Value: "grafana-downloads",
|
Value: "grafana-downloads",
|
||||||
|
@ -242,7 +243,7 @@ func main() {
|
||||||
Usage: "Publish packages to GitHub releases",
|
Usage: "Publish packages to GitHub releases",
|
||||||
Action: PublishGithub,
|
Action: PublishGithub,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&dryRunFlag,
|
&util.DryRunFlag,
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "path",
|
Name: "path",
|
||||||
Usage: "Path to the asset to be published",
|
Usage: "Path to the asset to be published",
|
||||||
|
@ -267,7 +268,7 @@ func main() {
|
||||||
Usage: "Publish image to AWS Marketplace releases",
|
Usage: "Publish image to AWS Marketplace releases",
|
||||||
Action: PublishAwsMarketplace,
|
Action: PublishAwsMarketplace,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&dryRunFlag,
|
&util.DryRunFlag,
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Release version (default from metadata)",
|
Usage: "Release version (default from metadata)",
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/service/ecr"
|
"github.com/aws/aws-sdk-go/service/ecr"
|
||||||
"github.com/aws/aws-sdk-go/service/marketplacecatalog"
|
"github.com/aws/aws-sdk-go/service/marketplacecatalog"
|
||||||
"github.com/docker/docker/api/types/image"
|
"github.com/docker/docker/api/types/image"
|
||||||
|
"github.com/grafana/grafana/pkg/build/cmd/util"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -138,7 +139,7 @@ func setupPublishAwsMarketplaceTests(t *testing.T) *cli.App {
|
||||||
testApp := cli.NewApp()
|
testApp := cli.NewApp()
|
||||||
testApp.Action = PublishAwsMarketplace
|
testApp.Action = PublishAwsMarketplace
|
||||||
testApp.Flags = []cli.Flag{
|
testApp.Flags = []cli.Flag{
|
||||||
&dryRunFlag,
|
&util.DryRunFlag,
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "version",
|
Name: "version",
|
||||||
Usage: "Release version (default from metadata)",
|
Usage: "Release version (default from metadata)",
|
||||||
|
@ -171,9 +172,11 @@ type mockAwsMarketplaceDocker struct {
|
||||||
func (m *mockAwsMarketplaceDocker) ImagePull(ctx context.Context, refStr string, options image.PullOptions) (io.ReadCloser, error) {
|
func (m *mockAwsMarketplaceDocker) ImagePull(ctx context.Context, refStr string, options image.PullOptions) (io.ReadCloser, error) {
|
||||||
return io.NopCloser(bytes.NewReader([]byte(""))), m.ImagePullError
|
return io.NopCloser(bytes.NewReader([]byte(""))), m.ImagePullError
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mockAwsMarketplaceDocker) ImageTag(ctx context.Context, source string, target string) error {
|
func (m *mockAwsMarketplaceDocker) ImageTag(ctx context.Context, source string, target string) error {
|
||||||
return m.ImageTagError
|
return m.ImageTagError
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mockAwsMarketplaceDocker) ImagePush(ctx context.Context, image string, options image.PushOptions) (io.ReadCloser, error) {
|
func (m *mockAwsMarketplaceDocker) ImagePush(ctx context.Context, image string, options image.PushOptions) (io.ReadCloser, error) {
|
||||||
return io.NopCloser(bytes.NewReader([]byte(""))), m.ImagePushError
|
return io.NopCloser(bytes.NewReader([]byte(""))), m.ImagePushError
|
||||||
}
|
}
|
||||||
|
@ -202,6 +205,7 @@ func (m *mockAwsMarketplaceCatalog) DescribeEntityWithContext(ctx context.Contex
|
||||||
EntityIdentifier: aws.String("productid"),
|
EntityIdentifier: aws.String("productid"),
|
||||||
}, m.DescribeEntityWithContextError
|
}, m.DescribeEntityWithContextError
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mockAwsMarketplaceCatalog) StartChangeSetWithContext(ctx context.Context, input *marketplacecatalog.StartChangeSetInput, opts ...request.Option) (*marketplacecatalog.StartChangeSetOutput, error) {
|
func (m *mockAwsMarketplaceCatalog) StartChangeSetWithContext(ctx context.Context, input *marketplacecatalog.StartChangeSetInput, opts ...request.Option) (*marketplacecatalog.StartChangeSetOutput, error) {
|
||||||
return &marketplacecatalog.StartChangeSetOutput{}, m.StartChangeSetWithContextError
|
return &marketplacecatalog.StartChangeSetOutput{}, m.StartChangeSetWithContextError
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/go-github/github"
|
"github.com/google/go-github/github"
|
||||||
|
"github.com/grafana/grafana/pkg/build/cmd/util"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
@ -158,7 +159,7 @@ func setupPublishGithubTests(t *testing.T) (*cli.App, string) {
|
||||||
testApp := cli.NewApp()
|
testApp := cli.NewApp()
|
||||||
testApp.Action = PublishGithub
|
testApp.Action = PublishGithub
|
||||||
testApp.Flags = []cli.Flag{
|
testApp.Flags = []cli.Flag{
|
||||||
&dryRunFlag,
|
&util.DryRunFlag,
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "path",
|
Name: "path",
|
||||||
Required: true,
|
Required: true,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package util
|
||||||
|
|
||||||
import "github.com/urfave/cli/v2"
|
import "github.com/urfave/cli/v2"
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package util
|
||||||
|
|
||||||
|
import "github.com/urfave/cli/v2"
|
||||||
|
|
||||||
|
var DryRunFlag = cli.BoolFlag{
|
||||||
|
Name: "dry-run",
|
||||||
|
Usage: "Only simulate actions",
|
||||||
|
}
|
Loading…
Reference in New Issue