Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/skills/bmad-testarch-ci/azure-pipelines-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
# Stack: {test_stack_type} | Framework: {test_framework}
#
# Variables to customize per project:
# INSTALL_CMD - dependency install command (e.g., npm ci, pnpm install --frozen-lockfile)
# INSTALL_CMD - dependency install command (e.g., npm ci --ignore-scripts, pnpm install --frozen-lockfile --ignore-scripts)
# NOTE: --ignore-scripts skips ALL lifecycle scripts — both dependency scripts (preinstall/postinstall/prepare)
# AND root-package hooks (SonarCloud S6505). For dependencies needing lifecycle scripts, add explicit
# `npm rebuild <pkg>` steps. For root-package scripts (e.g., prepare hooks), run them as separate steps
# (e.g., `npm run prepare` if needed for your stack).
# TEST_CMD - main test command (e.g., npm run test:e2e, npm test, npx vitest)
# LINT_CMD - lint command (e.g., npm run lint)
# BROWSER_INSTALL - browser install command (frontend/fullstack only; omit for backend)
# BROWSER_INSTALL - browser install command using the lockfile-pinned local binary; avoid npx,
# which can resolve an unpinned copy from the npx cache or global bin
# (e.g., ./node_modules/.bin/playwright install --with-deps chromium;
# frontend/fullstack only; omit for backend)
# DEFAULT_NODE_VERSION - Node.js version (read from .nvmrc or default to 24)

trigger:
Expand Down Expand Up @@ -51,7 +58,7 @@ stages:
path: $(npm_config_cache)
displayName: "Cache npm"

- script: npm ci
- script: npm ci --ignore-scripts
Comment thread
don-petry marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply the hardening to every installed skill copy

When this CI skill is invoked through Claude or the canonical BMAD installation, it resolves the sibling templates under .claude/skills/bmad-testarch-ci/ and _bmad/tea/workflows/testarch/bmad-testarch-ci/; both still run plain npm ci and npx playwright, so those supported entry points continue generating pipelines without either security hardening. Update the corresponding templates in both installed copies (or establish a single shared source) so behavior does not depend on which agent runs the skill.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially done: the hardened template (npm ci --ignore-scripts and the local Playwright binary) is now also in _bmad/tea/workflows/testarch/bmad-testarch-ci/azure-pipelines-template.yaml (cc9250e). I could not update .claude/skills/bmad-testarch-ci/azure-pipelines-template.yaml: writes under .claude/ are denied in this environment. Leaving this thread open. A maintainer needs to copy the .github template over that file, or make one copy the shared source.

displayName: "Install dependencies" # Replace with INSTALL_CMD

- script: npm run lint
Expand Down Expand Up @@ -90,11 +97,11 @@ stages:
path: $(npm_config_cache)
displayName: "Cache npm"

- script: npm ci
- script: npm ci --ignore-scripts
displayName: "Install dependencies" # Replace with INSTALL_CMD

# Frontend/Fullstack only — skipped for backend-only stacks
- script: npx playwright install --with-deps chromium
- script: ./node_modules/.bin/playwright install --with-deps chromium
condition: ne(variables['TEST_STACK_TYPE'], 'backend')
displayName: "Install Playwright browsers" # Replace with BROWSER_INSTALL

Expand Down Expand Up @@ -132,11 +139,11 @@ stages:
versionSpec: $(DEFAULT_NODE_VERSION)
displayName: "Setup Node.js"

- script: npm ci
- script: npm ci --ignore-scripts
displayName: "Install dependencies" # Replace with INSTALL_CMD

# Frontend/Fullstack only — skipped for backend-only stacks
- script: npx playwright install --with-deps chromium
- script: ./node_modules/.bin/playwright install --with-deps chromium
condition: ne(variables['TEST_STACK_TYPE'], 'backend')
displayName: "Install Playwright browsers" # Replace with BROWSER_INSTALL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
# Stack: {test_stack_type} | Framework: {test_framework}
#
# Variables to customize per project:
# INSTALL_CMD - dependency install command (e.g., npm ci, pnpm install --frozen-lockfile)
# INSTALL_CMD - dependency install command (e.g., npm ci --ignore-scripts, pnpm install --frozen-lockfile --ignore-scripts)
# NOTE: --ignore-scripts skips ALL lifecycle scripts — both dependency scripts (preinstall/postinstall/prepare)
# AND root-package hooks (SonarCloud S6505). For dependencies needing lifecycle scripts, add explicit
# `npm rebuild <pkg>` steps. For root-package scripts (e.g., prepare hooks), run them as separate steps
# (e.g., `npm run prepare` if needed for your stack).
# TEST_CMD - main test command (e.g., npm run test:e2e, npm test, npx vitest)
# LINT_CMD - lint command (e.g., npm run lint)
# BROWSER_INSTALL - browser install command (frontend/fullstack only; omit for backend)
# BROWSER_INSTALL - browser install command using the lockfile-pinned local binary; avoid npx,
# which can resolve an unpinned copy from the npx cache or global bin
# (e.g., ./node_modules/.bin/playwright install --with-deps chromium;
# frontend/fullstack only; omit for backend)
# DEFAULT_NODE_VERSION - Node.js version (read from .nvmrc or default to 24)

trigger:
Expand Down Expand Up @@ -51,7 +58,7 @@ stages:
path: $(npm_config_cache)
displayName: "Cache npm"

- script: npm ci
- script: npm ci --ignore-scripts
displayName: "Install dependencies" # Replace with INSTALL_CMD

- script: npm run lint
Expand Down Expand Up @@ -90,11 +97,11 @@ stages:
path: $(npm_config_cache)
displayName: "Cache npm"

- script: npm ci
- script: npm ci --ignore-scripts
displayName: "Install dependencies" # Replace with INSTALL_CMD

# Frontend/Fullstack only — skipped for backend-only stacks
- script: npx playwright install --with-deps chromium
- script: ./node_modules/.bin/playwright install --with-deps chromium
condition: ne(variables['TEST_STACK_TYPE'], 'backend')
displayName: "Install Playwright browsers" # Replace with BROWSER_INSTALL

Expand Down Expand Up @@ -132,11 +139,11 @@ stages:
versionSpec: $(DEFAULT_NODE_VERSION)
displayName: "Setup Node.js"

- script: npm ci
- script: npm ci --ignore-scripts
displayName: "Install dependencies" # Replace with INSTALL_CMD

# Frontend/Fullstack only — skipped for backend-only stacks
- script: npx playwright install --with-deps chromium
- script: ./node_modules/.bin/playwright install --with-deps chromium
condition: ne(variables['TEST_STACK_TYPE'], 'backend')
displayName: "Install Playwright browsers" # Replace with BROWSER_INSTALL

Expand Down
Loading