Skip to content

test: add unit coverage for McpToolDialog (100% LINE) — remove exclus… #32

test: add unit coverage for McpToolDialog (100% LINE) — remove exclus…

test: add unit coverage for McpToolDialog (100% LINE) — remove exclus… #32

name: One-shot module runtime fix
on:
pull_request:
branches: [ main ]
permissions:
contents: write
jobs:
patch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: Patch production source and remove workflow
shell: bash
run: |
python3 - <<'PY'
from pathlib import Path
path = Path('src/main/java/com/bajinho/continuebeans/ai/NetBeansFunctionExecutor.java')
text = path.read_text(encoding='utf-8')
needle = ''' private FunctionResult executeGetModuleInfo(Map<String, Object> args) {
String moduleCodeName = (String) args.get("moduleCodeName");

Check failure on line 23 in .github/workflows/one-shot-module-runtime-fix.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/one-shot-module-runtime-fix.yml

Invalid workflow file

You have an error in your yaml syntax on line 23
try {'''
replacement = ''' private FunctionResult executeGetModuleInfo(Map<String, Object> args) {
String moduleCodeName = (String) args.get("moduleCodeName");
// ModuleInfo lookup requires the NetBeans Platform runtime. Unit tests and
// plain Maven executions must not initialize the platform module system.
if (System.getProperty("netbeans.home") == null) {
return FunctionResult.error("Module not found: " + moduleCodeName);
}
try {'''
if needle not in text:
raise SystemExit('target method pattern not found')
if 'netbeans.home' in text.split('private FunctionResult executeGetModuleInfo', 1)[1].split('private FunctionResult executeGetModuleServices', 1)[0]:
raise SystemExit('guard already present')
path.write_text(text.replace(needle, replacement, 1), encoding='utf-8')
PY
git diff --check
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git rm .github/workflows/one-shot-module-runtime-fix.yml
git add src/main/java/com/bajinho/continuebeans/ai/NetBeansFunctionExecutor.java
git commit -m 'fix: guard NetBeans module lookup outside platform runtime'
git push origin HEAD:${GITHUB_HEAD_REF}