-
-
Notifications
You must be signed in to change notification settings - Fork 30
chore(package): migrate to pnpm workspace and update Docker contexts #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,46 @@ | ||
| node_modules | ||
| bun.lockb | ||
| npm-debug.log | ||
| **/node_modules/ | ||
| **/dist/ | ||
| **/.git/ | ||
| .gitignore | ||
| .gitattributes | ||
| *.md | ||
| *.log | ||
| npm-debug.log* | ||
| pnpm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| lerna-debug.log* | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
| .github/ | ||
| .husky/ | ||
| .vscode/ | ||
| .idea/ | ||
| .worktrees/ | ||
| worktrees/ | ||
| .open-api/ | ||
| .agent/ | ||
| .agents/ | ||
| .windsurf/ | ||
| .claude/ | ||
| .qwen/ | ||
| .omo/ | ||
| .temp/ | ||
| .tmp/ | ||
| .coverage/ | ||
| coverage/ | ||
| *.storage/ | ||
| worker/oasm-tools/ | ||
| worker/dist/ | ||
| worker/agent-sessions/ | ||
| console/coverage/ | ||
| console/e2e/playwright-report/ | ||
| console/e2e/test-results/ | ||
| console/e2e/.auth/ | ||
| console/sw.js | ||
| grpc-client/ | ||
| docs/ | ||
| Dockerfile | ||
| .dockerignore | ||
| bun.lockb |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,37 +6,39 @@ on: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'core-api/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'package*.json' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'pnpm-lock.yaml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'pnpm-workspace.yaml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'package.json' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'tsconfig*.json' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'core-api/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'package*.json' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'pnpm-lock.yaml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'pnpm-workspace.yaml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'package.json' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'tsconfig*.json' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Check Test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defaults: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: core-api | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
28
to
29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win Checkout doesn't disable credential persistence. zizmor flags this checkout for artifact credential persistence (artipacked): 🛡️ Proposed fix - name: Checkout code
uses: actions/checkout@v5
+ with:
+ persist-credentials: false📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.26.1)[warning] 28-29: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install pnpm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: pnpm/action-setup@v6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Node.js | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version: '22' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache: 'npm' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache: 'pnpm' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm ci --ignore-scripts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: core-api | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm install --frozen-lockfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm run test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: core-api | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm run test --filter core-api | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
23
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== Files ==\n'
git ls-files .github/workflows/check-test.yml .github/workflows/check-lint.yml || true
printf '\n== check-test.yml ==\n'
sed -n '1,220p' .github/workflows/check-test.yml
printf '\n== check-lint.yml ==\n'
sed -n '1,220p' .github/workflows/check-lint.yml
printf '\n== Search for working-directory and filter usage ==\n'
rg -n "defaults\.run\.working-directory|--filter|pnpm run test|pnpm --filter" .github/workflowsRepository: oasm-platform/open-asm Length of output: 2589 🌐 Web query:
💡 Result: In pnpm, command-line arguments and options placed after the script name are passed directly to the executed script [1][2]. Any options intended for the pnpm CLI itself must be placed before the script name [1][2]. Regarding the --filter option: 1. Placement: The --filter option is a pnpm CLI option used to restrict commands to specific subsets of packages in a workspace [3][4]. Because it is an option for the pnpm CLI, it must be placed before the script's name (or before the run command itself) to be correctly parsed and executed [5][2]. 2. Syntax: The correct structure for using a filter with a run command is: pnpm --filter <package_selector> run <script_name> [args_for_script] Placing --filter after the script name would result in it being passed as an argument to the script itself, rather than being interpreted by pnpm as a workspace filtering command [1][2]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
for path in [Path('.github/workflows/check-test.yml'), Path('.github/workflows/check-lint.yml')]:
print(f'## {path}')
if path.exists():
for i, line in enumerate(path.read_text().splitlines(), 1):
if 'defaults.run.working-directory' in line or '--filter' in line or 'pnpm run test' in line or 'pnpm --filter' in line:
print(f'{i}: {line}')
else:
print('missing')
PYRepository: oasm-platform/open-asm Length of output: 343 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== root package.json ==\n'
sed -n '1,220p' package.json
printf '\n== core-api package.json ==\n'
sed -n '1,220p' core-api/package.json
printf '\n== workspace package list ==\n'
find . -maxdepth 2 -name package.json -not -path './node_modules/*' | sortRepository: oasm-platform/open-asm Length of output: 5370 Use pnpm’s filter before
Proposed fix- run: pnpm run test --filter core-api
+ run: pnpm --filter core-api run test📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.26.1)[warning] 28-29: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,10 @@ name: Frontend Tests | |
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: ['console/**'] | ||
| paths: ['console/**', 'pnpm-lock.yaml', 'pnpm-workspace.yaml'] | ||
| pull_request: | ||
| branches: [main] | ||
| paths: ['console/**'] | ||
| paths: ['console/**', 'pnpm-lock.yaml', 'pnpm-workspace.yaml'] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
@@ -17,15 +17,18 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v6 | ||
|
|
||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: '22' | ||
| cache: 'npm' | ||
| cache-dependency-path: package-lock.json | ||
| cache: 'pnpm' | ||
|
|
||
| - run: npm ci | ||
| - run: npm run test:run --workspace=console | ||
| - run: npm run test:coverage --workspace=console | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm run test:run --filter console | ||
| - run: pnpm run test:coverage --filter console | ||
|
Comment on lines
+20
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Workflow excerpt:\n'
sed -n '1,120p' .github/workflows/frontend-tests.yml
printf '\nRelevant package scripts:\n'
git ls-files '**/package.json' | while read -r f; do
if rg -n '"test:run"|"test:coverage"' "$f" >/dev/null; then
printf '\n--- %s ---\n' "$f"
rg -n '"test:run"|"test:coverage"|"name"' "$f"
fi
done
printf '\nSearch for pnpm filter usage in workflows:\n'
rg -n "pnpm .*--filter|--filter .*pnpm|pnpm run .*--filter" .github . -g '!**/node_modules/**'Repository: oasm-platform/open-asm Length of output: 1690 🏁 Script executed: #!/bin/bash
set -euo pipefail
node - <<'JS'
const {spawnSync} = require('child_process');
function run(args){
const r = spawnSync('pnpm', args, {encoding:'utf8'});
console.log(`$ pnpm ${args.join(' ')}`);
console.log('exit', r.status);
if (r.stdout) console.log('stdout:\n' + r.stdout.trim());
if (r.stderr) console.log('stderr:\n' + r.stderr.trim());
console.log('---');
}
run(['--version']);
JSRepository: oasm-platform/open-asm Length of output: 203 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Workspace config:\n'
sed -n '1,120p' pnpm-workspace.yaml
printf '\nRoot package scripts:\n'
if [ -f package.json ]; then
rg -n '"test:run"|"test:coverage"|"scripts"' package.json
sed -n '1,140p' package.json
fi
printf '\npnpm run help excerpts:\n'
pnpm help run | sed -n '1,220p'Repository: oasm-platform/open-asm Length of output: 11361 🌐 Web query:
💡 Result: In pnpm, any options or arguments provided after the script name are passed directly to the executed script, not to the pnpm CLI [1][2]. If you intend to use pnpm-specific flags—such as --filter, --parallel, or --stream—you must place them before the script name or before the run command itself [1][3][2][4]. For example, if you want to run a script named build with a filter, the command should be structured as follows: pnpm --filter <package_selector> run build Alternatively, you can place the pnpm flags before the run subcommand: pnpm run --filter <package_selector> build If you place these flags after the script name (e.g., pnpm run build --filter <package_selector>), pnpm will attempt to pass those arguments to the build script itself rather than using them to configure the pnpm execution [3][4]. This behavior was standardized in pnpm v7 to ensure that all arguments following the script name are treated as part of the script's own arguments [3][5][4]. Citations:
Move
🤖 Prompt for AI Agents |
||
|
|
||
| - name: Upload coverage | ||
| uses: actions/upload-artifact@v4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # pnpm configuration for Open-ASM monorepo | ||
| strict-peer-dependencies=false | ||
| resolution-mode=highest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,38 @@ | ||
| FROM node:26-alpine AS base | ||
| # Install BASH to make our lives easier for entrypoint.sh... | ||
| RUN apk add --no-cache curl bash && \ | ||
| npm install -g serve && \ | ||
| npm install -g bun | ||
| npm install -g serve | ||
| ENV PNPM_HOME="/pnpm" | ||
| ENV PATH="$PNPM_HOME/bin:$PATH" | ||
| RUN npm install -g corepack && corepack enable | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| FROM base AS builder | ||
|
|
||
| COPY package.json ./ | ||
| WORKDIR /app | ||
|
|
||
| # Copy root workspace config and console package.json | ||
| COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./ | ||
| COPY console/package.json ./console/package.json | ||
|
|
||
| ENV NODE_ENV production | ||
| # Install all dependencies | ||
| RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
|
Comment on lines
+15
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Inspect the actual workspace membership and .npmrc settings
cat pnpm-workspace.yaml
echo "---"
cat .npmrc
echo "---"
# Confirm whether core-api/package.json (or others) is required for a frozen install at /app
fd -HI 'package.json' -d 2Repository: oasm-platform/open-asm Length of output: 648 Copy the
🤖 Prompt for AI Agents |
||
|
|
||
| COPY . . | ||
| RUN bun install | ||
| # Copy console source code | ||
| COPY console/ ./console/ | ||
|
|
||
| # Build | ||
| RUN \ | ||
| VITE_API_URL=APP_VITE_API_URL \ | ||
| bun run build | ||
| pnpm --filter console run build | ||
|
|
||
| # Clean bun cache and remove unused files | ||
| RUN bun pm cache clean && rm -rf src test | ||
| # Clean source and unused files | ||
| RUN rm -rf src test | ||
|
|
||
| FROM nginx:stable-alpine | ||
|
|
||
| COPY --from=builder /app/dist /usr/share/nginx/html | ||
| COPY ./nginx.conf /etc/nginx/conf.d/default.conf | ||
| COPY --from=builder /app/console/dist /usr/share/nginx/html | ||
| COPY ./console/nginx.conf /etc/nginx/conf.d/default.conf | ||
| EXPOSE 80 | ||
| CMD ["nginx", "-g", "daemon off;"] | ||
| CMD ["nginx", "-g", "daemon off;"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: oasm-platform/open-asm
Length of output: 6823
🏁 Script executed:
Repository: oasm-platform/open-asm
Length of output: 10220
🏁 Script executed:
Repository: oasm-platform/open-asm
Length of output: 11014
🌐 Web query:
pnpm run options listed after the script's name are passed to the executed script --filter after script name💡 Result:
In pnpm, options listed after a script's name are passed directly to the executed script, while options for the pnpm run command itself must be placed before the script's name [1][2]. Regarding your specific question about the --filter flag: the --filter option is a command-level option used to restrict which packages a command runs on [3][4]. Because it is a pnpm command-level option, it must be placed before the script name to be parsed by pnpm [4]. If you place --filter after the script name (e.g., pnpm run <script> --filter ), pnpm will not interpret it as a filtering instruction for the command [5]. Instead, it will pass the --filter argument directly to the script you are executing, which may cause the script to fail if it does not recognize that argument [1][2][5]. To correctly use filtering with a script, structure your command as follows: pnpm --filter <package_selector> run <script_name> This ensures the filter is applied to the pnpm command, and any additional arguments intended for your script can then be appended after the script name [2].
Citations:
Move
--filterbeforerunpnpm run lint --filter=${{ matrix.service }}forwards--filterto the lint script instead of scoping pnpm, so this step resolves to the root package and fails because the rootpackage.jsonhas nolintscript. Usepnpm --filter=${{ matrix.service }} run lintinstead.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents