From cc515827072139e01201d50f5c56c352a18e5427 Mon Sep 17 00:00:00 2001 From: jev forsberg Date: Tue, 5 Aug 2025 14:10:48 -0600 Subject: [PATCH] Add test workflow for core dagger build and clean up NX variables - Add test-dagger-build.yml workflow to test core release build command - Remove all NX environment variables from frontend build functions - This isolates whether core dagger build works independently of E2E issues --- .github/workflows/test-dagger-build.yml | 28 +++++++++++++++++++++ pkg/build/daggerbuild/frontend/build.go | 6 ----- pkg/build/daggerbuild/frontend/storybook.go | 3 --- 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/test-dagger-build.yml diff --git a/.github/workflows/test-dagger-build.yml b/.github/workflows/test-dagger-build.yml new file mode 100644 index 00000000000..4fc12abb409 --- /dev/null +++ b/.github/workflows/test-dagger-build.yml @@ -0,0 +1,28 @@ +name: Test Dagger Build Only +on: + workflow_dispatch: + push: + branches: + - baldm0mma/migrate_11.4.8 + +jobs: + test-dagger-build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + path: ./grafana + persist-credentials: false + + - name: Test release build command (single architecture) + uses: dagger/dagger-for-github@e47aba410ef9bb9ed81a4d2a97df31061e5e842e + with: + version: "0.9.3" + verb: run + args: --silent go -C grafana run ./pkg/build/cmd artifacts -a targz:grafana:linux/amd64 --grafana-ref=${{ github.sha }} --build-id=${{ github.run_number }} --version=11.4.8-test + + - name: Check if artifacts were created + run: | + ls -la dist/ + echo "Release build completed successfully!" diff --git a/pkg/build/daggerbuild/frontend/build.go b/pkg/build/daggerbuild/frontend/build.go index 39c9199482c..9aec71e37d9 100644 --- a/pkg/build/daggerbuild/frontend/build.go +++ b/pkg/build/daggerbuild/frontend/build.go @@ -8,9 +8,6 @@ import ( func Build(builder *dagger.Container, version string) *dagger.Directory { public := builder. - WithEnvVariable("CI", "true"). - WithEnvVariable("NX_DAEMON", "false"). - WithEnvVariable("NX_CACHE_PROJECT_GRAPH", "false"). WithExec([]string{"/bin/sh", "-c", fmt.Sprintf("yarn lerna version %s --exact --no-git-tag-version --no-push --force-publish -y", version)}). WithExec([]string{"yarn", "run", "build"}). WithExec([]string{"/bin/sh", "-c", "find /src/public -type d -name node_modules -print0 | xargs -0 rm -rf"}). @@ -21,9 +18,6 @@ func Build(builder *dagger.Container, version string) *dagger.Directory { func BuildPlugins(builder *dagger.Container) *dagger.Directory { public := builder. - WithEnvVariable("CI", "true"). - WithEnvVariable("NX_DAEMON", "false"). - WithEnvVariable("NX_CACHE_PROJECT_GRAPH", "false"). WithExec([]string{"yarn", "install", "--immutable"}). WithExec([]string{"/bin/sh", "-c", `if [ -d /src/plugins-bundled ]; then yarn run plugins:build-bundled; else mkdir /src/plugins-bundled; fi`}). WithExec([]string{"/bin/sh", "-c", "find /src/plugins-bundled -type d -name node_modules -print0 | xargs -0 rm -rf"}). diff --git a/pkg/build/daggerbuild/frontend/storybook.go b/pkg/build/daggerbuild/frontend/storybook.go index 0713787215b..8aebc9a7238 100644 --- a/pkg/build/daggerbuild/frontend/storybook.go +++ b/pkg/build/daggerbuild/frontend/storybook.go @@ -5,9 +5,6 @@ import "dagger.io/dagger" // Storybook returns a dagger.Directory which contains the built storybook server. func Storybook(builder *dagger.Container, src *dagger.Directory, version string) *dagger.Directory { return builder. - WithEnvVariable("CI", "true"). - WithEnvVariable("NX_DAEMON", "false"). - WithEnvVariable("NX_CACHE_PROJECT_GRAPH", "false"). WithExec([]string{"yarn", "run", "storybook:build"}). Directory("./packages/grafana-ui/dist/storybook") }