Skip to content

fix(load): unblock first load of an absent extension - #54

Open
zeegin wants to merge 1 commit into
alkoleft:masterfrom
zeegin:fix/issue-355-first-load-absent-extension
Open

fix(load): unblock first load of an absent extension#54
zeegin wants to merge 1 commit into
alkoleft:masterfrom
zeegin:fix/issue-355-first-load-absent-extension

Conversation

@zeegin

@zeegin zeegin commented Aug 14, 2026

Copy link
Copy Markdown

Problem

The very first load of an extension that the infobase does not carry yet fails on the compatibility probe:

v8-runner --config <CONFIG> load --path <EXT>.cfe --extension <NAME> --mode load
validation error: failed to determine infobase compatibility state for extension '<NAME>'

Exit code 2, result artifact_load_failed. The main configuration is already loaded into a fresh file infobase at this point; only the extension is missing.

Reproduced on platform 8.3.27.2130, v8-runner 0.5.1 (7ce1b06, current master).

Downstream report: IngvarConsulting/unica#355

Root cause

load always runs probe_compatibility before applying the artifact. For a .cfe it runs Designer

/CompareCfg -FirstConfigurationType ExtensionConfiguration -FirstName <NAME> \
            -SecondConfigurationType ExtensionDBConfiguration -SecondName <NAME>

When <NAME> is not in the infobase, Designer exits non-zero with

Конфигурация 'Расширение конфигурации' недоступна

classify_probe_failure then returns Unknown, which probe_compatibility turns into AppError::Validation. Two independent gaps combine here, and both must be closed for the scenario to work:

  1. to_ascii_lowercase() does not lowercase Cyrillic. It only maps A-Z, so "Расширение" never matches the literal "расширен". Every Russian branch of the classifier — не найден, не поддерж, and поддерж/поставщик on the configuration side — is unreachable whenever the platform capitalises the word, which it does. Verified:

    "Конфигурация 'Расширение конфигурации' недоступна"
      to_ascii_lowercase() -> contains("расширен") == false
      to_lowercase()       -> contains("расширен") == true
    
  2. No vocabulary for the absent-extension wording. The classifier recognises only not found/не найден and not supported/unsupported/не поддерж. The platform says недоступна ("unavailable").

An extension missing from the infobase is the normal state before the first load, so it should classify as NotSupported: validate_probe_mode_compatibility(LoadMode::Load, NotSupported) returns None and the load proceeds.

Change

  • classify_probe_failure uses Unicode to_lowercase().
  • The extension arm treats недоступ/unavailable/not available as absent, alongside the existing not-found and unsupported wording.
  • The two extension branches collapse into named absent / unsupported predicates; behaviour for previously recognised wording is unchanged.

This only widens classification of a probe that has already exited non-zero — a successful compare still returns Supported before reaching the classifier.

Tests

Three unit tests on classify_probe_failure:

  • the exact platform message classifies as NotSupported;
  • the English equivalent classifies as NotSupported;
  • an unrelated extension probe failure stays Unknown, so the widened wording cannot silently mask a real failure.

The first two fail on master before the change (left: Unknown, right: NotSupported).

Verification

Run on 7ce1b06 before and after the change:

passed failed
master 699 44
this branch 702 44

The 44 failures are pre-existing and environmental on this machine (no 1C platform installed); the sorted list of failing test names is identical before and after, so nothing regressed. cargo test --bin v8-runner load_artifact is fully green (15/15). cargo fmt --check passes, and cargo clippy reports no new warnings in the changed region.

I could not run the live-platform scenario end to end here — I have no 1C platform on this machine — so the platform-side confirmation is the reproduction in the linked downstream issue.

Summary by CodeRabbit

  • Исправления

    • Улучшено распознавание ошибок, связанных с отсутствующими или недоступными расширениями.
    • Добавлена поддержка сообщений на русском и английском языках.
    • Обеспечена корректная обработка текста с учётом регистра Unicode.
    • Нерелевантные ошибки по-прежнему сохраняют статус «Неизвестно».
  • Тесты

    • Добавлены проверки для русскоязычных и англоязычных сообщений, а также для нерелевантных ошибок.

- classify Designer's "Конфигурация 'Расширение конфигурации' недоступна"
  as NotSupported, so `load --mode load` proceeds on the first load of an
  extension the infobase does not carry yet instead of failing the
  compatibility probe with `failed to determine infobase compatibility state`
- switch the probe classifier to Unicode `to_lowercase`; `to_ascii_lowercase`
  leaves Cyrillic untouched, so every Russian branch silently never matched a
  capitalised platform diagnostic
- cover the absent-extension wording in ru and en, and keep unrelated
  extension probe failures classified as Unknown
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: df0c1ae8-34d7-4863-b892-1b32fcb89e07

📥 Commits

Reviewing files that changed from the base of the PR and between 7ce1b06 and 442cfc0.

📒 Files selected for processing (1)
  • src/use_cases/load_artifact.rs

Walkthrough

Классификатор ошибок пробирования теперь корректно обрабатывает Unicode-регистр и дополнительные английские и русские сообщения о недоступных расширениях. Тесты проверяют состояние NotSupported для таких сообщений и Unknown для нерелевантной ошибки.

Changes

Классификация ошибок пробирования

Layer / File(s) Summary
Обновление классификатора
src/use_cases/load_artifact.rs
classify_probe_failure использует to_lowercase() и распознаёт сообщения unavailable, not available и недоступ.
Тесты классификатора
src/use_cases/load_artifact.rs
Добавлены проверки английских и русских сообщений с состоянием NotSupported, а также нерелевантной ошибки с состоянием Unknown.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 442cf

The PR narrowly expands compatibility-error classification so the first load of an absent extension can proceed; no actionable merge-blocking risk remains after normal checks and review.

Poem

Я兔ик вижу: регистр стал точней,
Русский текст распознан теперь быстрей.
Расширение недоступно — NotSupported,
Ошибка чужая — Unknown сохранён.
Тесты прыгают в строках: раз, два, три!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно описывает основное изменение: исправление первой загрузки отсутствующего расширения.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant