fix(db-load-xml): -AllExtensions с загрузкой частями — отказ на обоих движках

Ветка ibcmd молча игнорировала список и загружала все расширения целиком.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ANXwbMUhuRFSCsq2RgmTTm
This commit is contained in:
Nick Shirokov
2026-09-24 18:08:20 +03:00
co-authored by Claude Opus 5.5
parent 80618f0b93
commit 647c633a9b
5 changed files with 89 additions and 3 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-load-xml.ps1" <
| `-Files <список>` | для Partial | Относительные пути файлов через запятую | | `-Files <список>` | для Partial | Относительные пути файлов через запятую |
| `-ListFile <путь>` | для Partial | Путь к файлу со списком (альтернатива `-Files`) | | `-ListFile <путь>` | для Partial | Путь к файлу со списком (альтернатива `-Files`) |
| `-Extension <имя>` | нет | Загрузить в расширение | | `-Extension <имя>` | нет | Загрузить в расширение |
| `-AllExtensions` | нет | Загрузить все расширения | | `-AllExtensions` | нет | Загрузить все расширения (только полностью; частями — по одному через `-Extension`) |
| `-NoApplyCheck` | нет | Не проверять применимость расширения после загрузки | | `-NoApplyCheck` | нет | Не проверять применимость расширения после загрузки |
| `-Format <формат>` | нет | `Hierarchical` (по умолч.) / `Plain` | | `-Format <формат>` | нет | `Hierarchical` (по умолч.) / `Plain` |
| `-UpdateDB` | нет | После загрузки сразу обновить конфигурацию БД (`/UpdateDBCfg`) | | `-UpdateDB` | нет | После загрузки сразу обновить конфигурацию БД (`/UpdateDBCfg`) |
@@ -1,4 +1,4 @@
# db-load-xml v1.30 — Load 1C configuration from XML files # db-load-xml v1.31 — Load 1C configuration from XML files
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
# NB: *nix-раскладку платформы (/opt/1cv8/<ver>/1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. # NB: *nix-раскладку платформы (/opt/1cv8/<ver>/1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется.
<# <#
@@ -717,6 +717,13 @@ if ($Mode -eq "Partial" -and -not $Files -and -not $ListFile) {
Write-Host "Error: -Files or -ListFile required for Partial mode" -ForegroundColor Red Write-Host "Error: -Files or -ListFile required for Partial mode" -ForegroundColor Red
exit 1 exit 1
} }
# Частями грузится одно расширение за раз: конфигуратор такое сочетание отвергает сам, а ibcmd
# молча загрузил бы все расширения целиком, не глядя в список.
if ($Mode -eq "Partial" -and $AllExtensions) {
Write-Host "Error: -AllExtensions cannot be combined with a partial load (-Files/-ListFile)" -ForegroundColor Red
Write-Host " Загружайте расширения по одному: -Extension <имя>, -ConfigDir — каталог этого расширения." -ForegroundColor Yellow
exit 1
}
# --- Temp dir --- # --- Temp dir ---
$tempDir = Join-Path $env:TEMP "db_load_xml_$(Get-Random)" $tempDir = Join-Path $env:TEMP "db_load_xml_$(Get-Random)"
@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# db-load-xml v1.30 — Load 1C configuration from XML files # db-load-xml v1.31 — Load 1C configuration from XML files
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse import argparse
@@ -753,6 +753,12 @@ def main():
if args.Mode == "Partial" and not args.Files and not args.ListFile: if args.Mode == "Partial" and not args.Files and not args.ListFile:
print("Error: -Files or -ListFile required for Partial mode") print("Error: -Files or -ListFile required for Partial mode")
sys.exit(1) sys.exit(1)
# Частями грузится одно расширение за раз: конфигуратор такое сочетание отвергает сам, а ibcmd
# молча загрузил бы все расширения целиком, не глядя в список.
if args.Mode == "Partial" and args.AllExtensions:
print("Error: -AllExtensions cannot be combined with a partial load (-Files/-ListFile)")
print(" Загружайте расширения по одному: -Extension <имя>, -ConfigDir — каталог этого расширения.")
sys.exit(1)
# --- ibcmd branch (file infobase only; hierarchical full-directory import) --- # --- ibcmd branch (file infobase only; hierarchical full-directory import) ---
if engine == "ibcmd": if engine == "ibcmd":
@@ -0,0 +1,40 @@
{
"name": "Ошибка: -AllExtensions с загрузкой частями и на ibcmd — не полный импорт всех расширений (fake platform)",
"preRun": [
{
"writeFile": {
"path": "ibcmd.cmd",
"content": "@echo off\r\necho ARGS: %*\r\nexit /b 0\r\n"
}
},
{
"writeFile": {
"path": "ib/1Cv8.1CD",
"content": "stub"
}
},
{
"writeFile": {
"path": "src/CommonModules/Модуль.xml",
"content": "<?xml version=\"1.0\"?><MetaDataObject/>"
}
}
],
"args_extra": [
"-V8Path",
"{workDir}\\ibcmd.cmd",
"-InfoBasePath",
"{workDir}\\ib",
"-ConfigDir",
"{workDir}\\src",
"-Files",
"CommonModules/Модуль.xml",
"-AllExtensions"
],
"expectError": true,
"expect": {
"stdoutContains": "-AllExtensions cannot be combined with a partial load",
"stdoutNotContains": "ARGS:"
},
"osOnly": "win32"
}
@@ -0,0 +1,33 @@
{
"name": "Ошибка: -AllExtensions вместе с загрузкой частями",
"fakePlatform": {
"log": ""
},
"preRun": [
{
"writeFile": {
"path": "src/CommonModules/Модуль.xml",
"content": "<?xml version=\"1.0\"?><MetaDataObject/>"
}
}
],
"args_extra": [
"-V8Path",
"{fakePlatform}",
"-InfoBasePath",
"{workDir}/ib",
"-ConfigDir",
"{workDir}/src",
"-Files",
"CommonModules/Модуль.xml",
"-AllExtensions"
],
"expectError": true,
"expect": {
"stdoutContains": [
"-AllExtensions cannot be combined with a partial load",
"Загружайте расширения по одному: -Extension <имя>"
],
"stdoutNotContains": "Running:"
}
}