[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:
Roberto Jiménez Sánchez
2025-02-17 14:00:21 +01:00
committed by GitHub
parent 2014d27def
commit 8edfff1bba
13 changed files with 61 additions and 17 deletions
-4
View File
@@ -21,10 +21,6 @@ var (
Usage: "Specify number of tries before failing",
Value: 1,
}
dryRunFlag = cli.BoolFlag{
Name: "dry-run",
Usage: "Only simulate actions",
}
tagFlag = cli.StringFlag{
Name: "tag",
Usage: "Grafana version tag",
+6 -5
View File
@@ -5,6 +5,7 @@ import (
"os"
"github.com/grafana/grafana/pkg/build"
"github.com/grafana/grafana/pkg/build/cmd/util"
"github.com/urfave/cli/v2"
)
@@ -66,7 +67,7 @@ func main() {
Name: "publish-metrics",
Usage: "Publish a set of metrics from stdin",
ArgsUsage: "<api-key>",
Action: MaxArgCountWrapper(1, PublishMetrics),
Action: util.MaxArgCountWrapper(1, PublishMetrics),
},
{
Name: "verify-drone",
@@ -178,7 +179,7 @@ func main() {
Name: "fetch",
Usage: "Fetch Grafana Docker images",
ArgsUsage: "[version]",
Action: MaxArgCountWrapper(1, FetchImages),
Action: util.MaxArgCountWrapper(1, FetchImages),
Flags: []cli.Flag{
&editionFlag,
},
@@ -229,7 +230,7 @@ func main() {
Flags: []cli.Flag{
&editionFlag,
&buildIDFlag,
&dryRunFlag,
&util.DryRunFlag,
&cli.StringFlag{
Name: "src-bucket",
Value: "grafana-downloads",
@@ -242,7 +243,7 @@ func main() {
Usage: "Publish packages to GitHub releases",
Action: PublishGithub,
Flags: []cli.Flag{
&dryRunFlag,
&util.DryRunFlag,
&cli.StringFlag{
Name: "path",
Usage: "Path to the asset to be published",
@@ -267,7 +268,7 @@ func main() {
Usage: "Publish image to AWS Marketplace releases",
Action: PublishAwsMarketplace,
Flags: []cli.Flag{
&dryRunFlag,
&util.DryRunFlag,
&cli.StringFlag{
Name: "version",
Usage: "Release version (default from metadata)",
+5 -1
View File
@@ -15,6 +15,7 @@ import (
"github.com/aws/aws-sdk-go/service/ecr"
"github.com/aws/aws-sdk-go/service/marketplacecatalog"
"github.com/docker/docker/api/types/image"
"github.com/grafana/grafana/pkg/build/cmd/util"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
)
@@ -138,7 +139,7 @@ func setupPublishAwsMarketplaceTests(t *testing.T) *cli.App {
testApp := cli.NewApp()
testApp.Action = PublishAwsMarketplace
testApp.Flags = []cli.Flag{
&dryRunFlag,
&util.DryRunFlag,
&cli.StringFlag{
Name: "version",
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) {
return io.NopCloser(bytes.NewReader([]byte(""))), m.ImagePullError
}
func (m *mockAwsMarketplaceDocker) ImageTag(ctx context.Context, source string, target string) error {
return m.ImageTagError
}
func (m *mockAwsMarketplaceDocker) ImagePush(ctx context.Context, image string, options image.PushOptions) (io.ReadCloser, error) {
return io.NopCloser(bytes.NewReader([]byte(""))), m.ImagePushError
}
@@ -202,6 +205,7 @@ func (m *mockAwsMarketplaceCatalog) DescribeEntityWithContext(ctx context.Contex
EntityIdentifier: aws.String("productid"),
}, m.DescribeEntityWithContextError
}
func (m *mockAwsMarketplaceCatalog) StartChangeSetWithContext(ctx context.Context, input *marketplacecatalog.StartChangeSetInput, opts ...request.Option) (*marketplacecatalog.StartChangeSetOutput, error) {
return &marketplacecatalog.StartChangeSetOutput{}, m.StartChangeSetWithContextError
}
+2 -1
View File
@@ -10,6 +10,7 @@ import (
"testing"
"github.com/google/go-github/github"
"github.com/grafana/grafana/pkg/build/cmd/util"
"github.com/stretchr/testify/assert"
"github.com/urfave/cli/v2"
)
@@ -158,7 +159,7 @@ func setupPublishGithubTests(t *testing.T) (*cli.App, string) {
testApp := cli.NewApp()
testApp.Action = PublishGithub
testApp.Flags = []cli.Flag{
&dryRunFlag,
&util.DryRunFlag,
&cli.StringFlag{
Name: "path",
Required: true,
@@ -1,4 +1,4 @@
package main
package util
import "github.com/urfave/cli/v2"
+8
View File
@@ -0,0 +1,8 @@
package util
import "github.com/urfave/cli/v2"
var DryRunFlag = cli.BoolFlag{
Name: "dry-run",
Usage: "Only simulate actions",
}
View File