From f888f610970bc9a708e9d6120eef9953bee4c2a0 Mon Sep 17 00:00:00 2001 From: Kevin Minehart <5140827+kminehart@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:31:28 -0500 Subject: [PATCH] CI: remove unnecessary files from tarball (#109350) * remove npm artifacts and storybook from targz * fix small issue with docker verification --- .../daggerbuild/artifacts/package_targz.go | 27 ------------------- pkg/build/daggerbuild/docker/verify.go | 5 +++- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/pkg/build/daggerbuild/artifacts/package_targz.go b/pkg/build/daggerbuild/artifacts/package_targz.go index 56ea04030b3..bf3fe4c2073 100644 --- a/pkg/build/daggerbuild/artifacts/package_targz.go +++ b/pkg/build/daggerbuild/artifacts/package_targz.go @@ -55,9 +55,7 @@ type Tarball struct { // Dependent artifacts Backend *pipeline.Artifact Frontend *pipeline.Artifact - NPMPackages *pipeline.Artifact BundledPlugins *pipeline.Artifact - Storybook *pipeline.Artifact } func NewTarballFromString(ctx context.Context, log *slog.Logger, artifact string, state pipeline.StateHandler) (*pipeline.Artifact, error) { @@ -174,15 +172,6 @@ func NewTarball( return nil, err } - npmArtifact, err := NewNPMPackages(ctx, log, artifact, src, version, cache) - if err != nil { - return nil, err - } - - storybookArtifact, err := NewStorybook(ctx, log, artifact, src, version, cache) - if err != nil { - return nil, err - } tarball := &Tarball{ Name: name, Distribution: distro, @@ -195,9 +184,7 @@ func NewTarball( Backend: backendArtifact, Frontend: frontendArtifact, - NPMPackages: npmArtifact, BundledPlugins: bundledPluginsArtifact, - Storybook: storybookArtifact, } return pipeline.ArtifactWithLogging(ctx, log, &pipeline.Artifact{ @@ -239,16 +226,6 @@ func (t *Tarball) BuildFile(ctx context.Context, b *dagger.Container, opts *pipe return nil, err } - npmDir, err := opts.Store.Directory(ctx, t.NPMPackages) - if err != nil { - return nil, err - } - - storybookDir, err := opts.Store.Directory(ctx, t.Storybook) - if err != nil { - return nil, err - } - pluginsDir, err := opts.Store.Directory(ctx, t.BundledPlugins) if err != nil { return nil, err @@ -277,8 +254,6 @@ func (t *Tarball) BuildFile(ctx context.Context, b *dagger.Container, opts *pipe targz.NewMappedDir("packaging/wrappers", grafanaDir.Directory("packaging/wrappers")), targz.NewMappedDir("bin", backendDir), targz.NewMappedDir("public", frontendDir), - targz.NewMappedDir("npm-artifacts", npmDir), - targz.NewMappedDir("storybook", storybookDir), targz.NewMappedDir("plugins-bundled", pluginsDir), } @@ -329,9 +304,7 @@ func (t *Tarball) Dependencies(ctx context.Context) ([]*pipeline.Artifact, error return []*pipeline.Artifact{ t.Backend, t.Frontend, - t.NPMPackages, t.BundledPlugins, - t.Storybook, }, nil } diff --git a/pkg/build/daggerbuild/docker/verify.go b/pkg/build/daggerbuild/docker/verify.go index 56e8ff3118e..d3eec68fae4 100644 --- a/pkg/build/daggerbuild/docker/verify.go +++ b/pkg/build/daggerbuild/docker/verify.go @@ -40,7 +40,10 @@ func Verify( WithExposedPort(3000) // TODO: Add LICENSE to containers and implement validation - container, err := e2e.ValidatePackage(ctx, d, service.AsService(), src, yarnCache, nodeVersion) + container, err := e2e.ValidatePackage(ctx, d, service.AsService(dagger.ContainerAsServiceOpts{ + UseEntrypoint: false, + Args: []string{"grafana", "server"}, + }), src, yarnCache, nodeVersion) if err != nil { return err }