From 4f24b643b1dcb972bf97f6a5946165cb0e884315 Mon Sep 17 00:00:00 2001 From: maxcask Date: Mon, 10 Nov 2025 14:10:27 +0200 Subject: [PATCH 1/3] chore: Add default value of virtualFrameBuffer parameter equaltrue this is to reflect the actual behavior --- resources/metadata/npmExecuteScripts.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/metadata/npmExecuteScripts.yaml b/resources/metadata/npmExecuteScripts.yaml index 75a9aa4f2b..607f2edf7d 100644 --- a/resources/metadata/npmExecuteScripts.yaml +++ b/resources/metadata/npmExecuteScripts.yaml @@ -114,6 +114,7 @@ spec: - PARAMETERS - STAGES - STEPS + default: true - name: scriptOptions type: "[]string" description: Options are passed to all runScripts calls separated by a '--'. './piper npmExecuteScripts --runScripts ci-e2e --scriptOptions '--tag1' will correspond to 'npm run ci-e2e -- --tag1' From aca1832d9d207738abe3617f23ea95fa879c5e22 Mon Sep 17 00:00:00 2001 From: maksim bondarenko Date: Mon, 10 Nov 2025 14:20:05 +0200 Subject: [PATCH 2/3] update generated --- cmd/npmExecuteScripts_generated.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/npmExecuteScripts_generated.go b/cmd/npmExecuteScripts_generated.go index c282734d86..223a84c5dc 100644 --- a/cmd/npmExecuteScripts_generated.go +++ b/cmd/npmExecuteScripts_generated.go @@ -266,7 +266,7 @@ func addNpmExecuteScriptsFlags(cmd *cobra.Command, stepConfig *npmExecuteScripts cmd.Flags().BoolVar(&stepConfig.Install, "install", true, "Run npm install or similar commands depending on the project structure.") cmd.Flags().StringSliceVar(&stepConfig.RunScripts, "runScripts", []string{}, "List of additional run scripts to execute from package.json.") cmd.Flags().StringVar(&stepConfig.DefaultNpmRegistry, "defaultNpmRegistry", os.Getenv("PIPER_defaultNpmRegistry"), "URL of the npm registry to use. Defaults to https://registry.npmjs.org/") - cmd.Flags().BoolVar(&stepConfig.VirtualFrameBuffer, "virtualFrameBuffer", false, "(Linux only) Start a virtual frame buffer in the background. This allows you to run a web browser without the need for an X server. Note that xvfb needs to be installed in the execution environment.") + cmd.Flags().BoolVar(&stepConfig.VirtualFrameBuffer, "virtualFrameBuffer", true, "(Linux only) Start a virtual frame buffer in the background. This allows you to run a web browser without the need for an X server. Note that xvfb needs to be installed in the execution environment.") cmd.Flags().StringSliceVar(&stepConfig.ScriptOptions, "scriptOptions", []string{}, "Options are passed to all runScripts calls separated by a '--'. './piper npmExecuteScripts --runScripts ci-e2e --scriptOptions '--tag1' will correspond to 'npm run ci-e2e -- --tag1'") cmd.Flags().StringSliceVar(&stepConfig.BuildDescriptorExcludeList, "buildDescriptorExcludeList", []string{`deployment/**`}, "List of build descriptors and therefore modules to exclude from execution of the npm scripts. The elements can either be a path to the build descriptor or a pattern.") cmd.Flags().StringSliceVar(&stepConfig.BuildDescriptorList, "buildDescriptorList", []string{}, "List of build descriptors and therefore modules for execution of the npm scripts. The elements have to be paths to the build descriptors. **If set, buildDescriptorExcludeList will be ignored.**") @@ -378,7 +378,7 @@ func npmExecuteScriptsMetadata() config.StepData { Type: "bool", Mandatory: false, Aliases: []config.Alias{}, - Default: false, + Default: true, }, { Name: "scriptOptions", From 2a5baa5eea34ad4f66193aac84cc80cab663b890 Mon Sep 17 00:00:00 2001 From: maxcask Date: Mon, 10 Nov 2025 15:28:25 +0200 Subject: [PATCH 3/3] Update npmExecuteScripts calls to use virtualFrameBuffer --- integration/integration_npm_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/integration_npm_test.go b/integration/integration_npm_test.go index 08339eb1b7..81c3a97120 100644 --- a/integration/integration_npm_test.go +++ b/integration/integration_npm_test.go @@ -37,7 +37,7 @@ func TestNPMIntegrationRunScriptsWithOptions(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --runScripts=start --scriptOptions=--tag,tag1 >test-log-runScriptWithOptions.txt 2>&1 +/piperbin/piper npmExecuteScripts --runScripts=start --virtualFrameBuffer=false --scriptOptions=--tag,tag1 >test-log-runScriptWithOptions.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700) @@ -89,7 +89,7 @@ func TestNPMIntegrationRegistrySetInFlags(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --defaultNpmRegistry=https://foo.bar >test-log-registrySetInFlags.txt 2>&1 +/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --virtualFrameBuffer=false --defaultNpmRegistry=https://foo.bar >test-log-registrySetInFlags.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700) @@ -140,7 +140,7 @@ func TestNPMIntegrationRegistrySetInNpmrc(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --install --runScripts=ci-build >test-log-registrySetInNpmrc.txt 2>&1 +/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --virtualFrameBuffer=false >test-log-registrySetInNpmrc.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700) @@ -191,7 +191,7 @@ func TestNPMIntegrationRegistryWithTwoModules(t *testing.T) { //workaround to use test script util it is possible to set workdir for Exec call testScript := `#!/bin/sh cd /test -/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --defaultNpmRegistry=https://foo.bar >test-log-registryWithTwoModules.txt 2>&1 +/piperbin/piper npmExecuteScripts --install --runScripts=ci-build --virtualFrameBuffer=false --defaultNpmRegistry=https://foo.bar >test-log-registryWithTwoModules.txt 2>&1 ` os.WriteFile(filepath.Join(tempDir, "runPiper.sh"), []byte(testScript), 0700)