Skip to content

Подключены и обновлены фикстуры, фикс чтения предопределенных#626

Merged
theshadowco merged 4 commits into
developfrom
feature/newFixtures
Jun 29, 2026
Merged

Подключены и обновлены фикстуры, фикс чтения предопределенных#626
theshadowco merged 4 commits into
developfrom
feature/newFixtures

Conversation

@theshadowco

@theshadowco theshadowco commented Jun 29, 2026

Copy link
Copy Markdown
Member

Описание

  1. Подключены фикстуры для 8.5
  2. Обновлены фикстуры ssl 3.1
  3. Исправлена ошибка чтения предопределенных

Связанные задачи

Closes: #584

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Дополнительно

Summary by CodeRabbit

  • New Features

    • Added support for additional configuration content so more nested items are recognized.
    • Expanded support for a new SSL 3.2 example set across configuration and metadata handling.
  • Bug Fixes

    • Improved handling of configuration and metadata cases that previously only worked for SSL 3.1.
    • Updated access and content counts to reflect the newer format accurately.
  • Tests

    • Broadened test coverage for SSL 3.2 across many metadata types and reader scenarios.
    • Added new fixture-generation support for updating test resources more easily.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Registers two shallow ssl_3_2 git submodules, fixes PredefinedValueConverter to parse a new "content" XML node as predefined child values, adds a regenerateFixture utility to MDTestUtils, and extends all SSL-parameterized tests across ~40 test classes plus ConfigurationTest, RightsTest, and MDOReaderTest to cover the new ssl_3_2 fixture.

Changes

SSL 3.2 Fixture Integration

Layer / File(s) Summary
Submodule registration and PredefinedValueConverter fix
.gitmodules, src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java
Two shallow ssl_3_2 submodule entries added; PredefinedValueConverter gains a CONTENT_NODE constant and extends the unmarshal switch to parse "content" nodes the same as "items".
MDTestUtils fixture regeneration utility
src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java
Adds @Slf4j and a new regenerateFixture(...) method that reads an MDO, serializes to JSON, writes a fixture file, and logs the result.
MDOReaderTest and MDClassesTest ssl_3_2 coverage
src/test/java/com/github/_1c_syntax/bsl/reader/MDOReaderTest.java, src/test/java/com/github/_1c_syntax/bsl/mdclasses/MDClassesTest.java
Six new MDOReaderTest methods cover ssl_3_2 EDT and designer reads; MDClassesTest updates expected configuration counts from 15→17 and 19→21, and asserts ssl_3_2 external sources are empty.
ConfigurationTest ssl_3_2 full and skip-all tests
src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java
Adds predefinedCount32/nonPredefinedCount helpers, updates ssl_3_1 assertions, adds testFullSSL32 and testFullSSLSkipAll32 methods, and revises checkChildrenSSL/checkChildrenSSL32 expected sizes across all module categories.
RightsTest ssl_3_2 coverage
src/test/java/com/github/_1c_syntax/bsl/mdclasses/helpers/RightsTest.java
Adds rightAccessCf32 test and updates rolesAccessCf32 expected ANALYTICS_SYSTEM_CLIENT role count from 103 to 106.
MDO parameterized test ssl_3_2 expansions
src/test/java/com/github/_1c_syntax/bsl/mdo/*, src/test/java/com/github/_1c_syntax/bsl/examples/ValueTypeTest.java
@CsvSource datasets across ~35 MDO test classes extended to include ssl_3_2 true/false cases alongside existing ssl_3_1 entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • 1c-syntax/mdclasses#610: Directly related — both PRs touch PredefinedValueConverter XML unmarshalling logic for predefined value node handling.

Poem

🐇 Hop hop, a new fixture arrives,
ssl_3_2 joins the hive!
Content nodes now properly read,
Thirty-five tests updated with speed.
The rabbit checks each CSV row,
And watches the green test suite glow!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.49% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the fixture updates and predefined-value reader fix shown in the PR.
Linked Issues check ✅ Passed The PR adds ssl_3_2 submodule entries and related test/fix updates, matching the goal of connecting 8.5 fixtures in #584.
Out of Scope Changes check ✅ Passed The visible changes all support fixture migration or the predefined-value parsing fix, with no clear unrelated additions.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/newFixtures

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.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Test Results

  402 files  ±  0    402 suites  ±0   8m 14s ⏱️ + 2m 44s
  372 tests + 86    372 ✅ + 86  0 💤 ±0  0 ❌ ±0 
2 316 runs  +540  2 316 ✅ +540  0 💤 ±0  0 ❌ ±0 

Results for commit e2354b3. ± Comparison against base commit 6e0bfc7.

♻️ This comment has been updated with latest results.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java (1)

135-143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Annotate the new public API with jspecify nullness.

fixturePostfix is nullable by design here, but the signature leaves that contract implicit. Please expose it with @Nullable/@NonNull at the method boundary. As per coding guidelines, "Use @Nullable and @NonNull annotations from org.jspecify for null safety."

Proposed fix
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
...
-  public static void regenerateFixture(String examplePackName, String mdoRef, boolean isEdt, String fixturePostfix) throws java.io.IOException {
+  public static void regenerateFixture(`@NonNull` String examplePackName,
+                                       `@NonNull` String mdoRef,
+                                       boolean isEdt,
+                                       `@Nullable` String fixturePostfix) throws java.io.IOException {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java` around
lines 135 - 143, The new public API in MDTestUtils.regenerateFixture has an
implicit nullable contract for fixturePostfix, so annotate the method boundary
with org.jspecify nullness annotations. Mark fixturePostfix as `@Nullable` and add
`@NonNull` to the non-null parameters/return contract as appropriate, keeping the
signature explicit and consistent with the rest of the public test utility API.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java`:
- Around line 225-227: Replace the tautological size check in ConfigurationTest
with a real expected-size assertion for the ssl_3_2 plain children fixture: in
the test around cf.getPlainChildren(), assert against a fixed expected count (or
a separately defined fixture-specific constant) instead of recomputing the size
from the same collection. Apply the same correction to the other matching test
near the second plain-children assertion, and keep the
SupportVariant.NOT_EDITABLE check unchanged.

In `@src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java`:
- Around line 139-140: MDOReader.read(...) can return null, so the current
createJson(...) path in MDTestUtils should fail fast with a clear assertion
instead of allowing a later NPE. Update the logic around mdo and mdoRef to
explicitly check the result of MDOReader.read(...) and stop immediately with a
descriptive failure when the lookup misses, keeping the existing createJson(...)
flow only for non-null MDOs.

---

Nitpick comments:
In `@src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java`:
- Around line 135-143: The new public API in MDTestUtils.regenerateFixture has
an implicit nullable contract for fixturePostfix, so annotate the method
boundary with org.jspecify nullness annotations. Mark fixturePostfix as
`@Nullable` and add `@NonNull` to the non-null parameters/return contract as
appropriate, keeping the signature explicit and consistent with the rest of the
public test utility API.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1916b3a9-0d89-488e-9598-84798cb0529d

📥 Commits

Reviewing files that changed from the base of the PR and between 6e0bfc7 and e2354b3.

⛔ Files ignored due to path filters (66)
  • src/test/resources/ext/designer/ssl_3_1 is excluded by !src/test/resources/**
  • src/test/resources/ext/designer/ssl_3_2 is excluded by !src/test/resources/**
  • src/test/resources/ext/edt/ssl_3_1 is excluded by !src/test/resources/**
  • src/test/resources/ext/edt/ssl_3_2 is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Catalogs.ВерсииФайлов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Roles.БазовыеПраваБСП.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/BusinessProcesses.Задание.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/BusinessProcesses.Задание_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.ВерсииФайлов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.ВерсииФайлов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.Заметки.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Catalogs.Заметки_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommandGroups.Печать.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonAttributes.ОбластьДанныхВспомогательныеДанные.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonCommands.ОтправитьПисьмо.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonCommands.ОтправитьПисьмо_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonForms.Вопрос.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonForms.Вопрос_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonModules.АвтономнаяРабота.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonModules.АвтономнаяРабота_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonPictures.GoogleMaps.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/CommonTemplates.СтруктураПодчиненности.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Constants.ЗаголовокСистемы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DataProcessors.ЗагрузкаКурсовВалют.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DataProcessors.ЗагрузкаКурсовВалют_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DefinedTypes.ВладелецФайлов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DocumentJournals.Взаимодействия.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/DocumentJournals.Взаимодействия_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Documents.Анкета.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Documents.Анкета_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Enums.СтатусыОбработчиковОбновления.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Enums.СтатусыОбработчиковОбновления_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/EventSubscriptions.ВариантыОтчетовПередУдалениемИдентификатораОбъектаМетаданных.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ExchangePlans.ОбновлениеИнформационнойБазы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ExchangePlans.ОбновлениеИнформационнойБазы_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/FilterCriteria.СвязанныеДокументы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/FilterCriteria.СвязанныеДокументы_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/FunctionalOptions.ИспользоватьАнкетирование.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/FunctionalOptionsParameters.ТипВерсионируемогоОбъекта.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.СклоненияПредставленийОбъектов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.СклоненияПредставленийОбъектов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.ЭлектронныеПодписи.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/InformationRegisters.ЭлектронныеПодписи_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Languages.Русский.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Reports.АнализВерсийОбъектов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Reports.АнализВерсийОбъектов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Roles.БазовыеПраваБСП.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/ScheduledJobs.ОбновлениеАгрегатов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/SessionParameters.ТекущийПользователь.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/SettingsStorages.ХранилищеВариантовОтчетов.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/SettingsStorages.ХранилищеВариантовОтчетов_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/StyleItems.ВажнаяНадписьШрифт.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/StyleItems.ВидДняПроизводственногоКалендаряВоскресеньеЦвет.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Subsystems.Администрирование.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Tasks.ЗадачаИсполнителя.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Tasks.ЗадачаИсполнителя_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/WebServices.EnterpriseDataExchange_1_0_1_1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/WebServices.EnterpriseDataExchange_1_0_1_1_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/XDTOPackages.ApdexExport_1_0_0_4.json is excluded by !src/test/resources/**
📒 Files selected for processing (41)
  • .gitmodules
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/PredefinedValueConverter.java
  • src/test/java/com/github/_1c_syntax/bsl/examples/ValueTypeTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/MDClassesTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdclasses/helpers/RightsTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/BusinessProcessTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CommandGroupTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CommonAttributeTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CommonCommandTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CommonFormTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CommonModuleTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CommonPictureTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CommonTemplateTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ConstantTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DataProcessorTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DefinedTypeTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DocumentJournalTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DocumentTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/EnumTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/EventSubscriptionTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ExchangePlanTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/FilterCriterionTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/FunctionalOptionTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/FunctionalOptionsParameterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/InformationRegisterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/LanguageTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ReportTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/RoleTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/ScheduledJobTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/SessionParameterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/SettingsStorageTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/StyleItemTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/SubsystemTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/TasksTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/WebServiceTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/XDTOPackageTest.java
  • src/test/java/com/github/_1c_syntax/bsl/reader/MDOReaderTest.java
  • src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java

Comment on lines +225 to +227
assertThat(cf.getPlainChildren())
.hasSize(nonPredefinedCount(cf.getPlainChildren()) + predefinedCount32(cf.getPlainChildren()))
.allMatch(md -> md.getSupportVariant().equals(SupportVariant.NOT_EDITABLE));

Copy link
Copy Markdown

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

Restore a real expected-size assertion for ssl_3_2 plain children.

Both assertions are tautologies: they compare cf.getPlainChildren().size() to a sum recomputed from that same list. If the parser drops or adds children, these tests still pass, so the new ssl_3_2 coverage no longer guards the fixture contract.

Also applies to: 433-435

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/java/com/github/_1c_syntax/bsl/mdclasses/ConfigurationTest.java`
around lines 225 - 227, Replace the tautological size check in ConfigurationTest
with a real expected-size assertion for the ssl_3_2 plain children fixture: in
the test around cf.getPlainChildren(), assert against a fixed expected count (or
a separately defined fixture-specific constant) instead of recomputing the size
from the same collection. Apply the same correction to the other matching test
near the second plain-children assertion, and keep the
SupportVariant.NOT_EDITABLE check unchanged.

Comment on lines +139 to +140
var mdo = MDOReader.read(configurationPath, mdoRef, MDCReadSettings.DEFAULT);
var json = createJson(mdo);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Fail fast when the MDO lookup misses.

MDOReader.read(...) is nullable, and the existing reader tests already exercise null for unknown references. A typo in mdoRef will currently fall through to createJson(...) and blow up as a bare NPE.

Proposed fix
     var mdo = MDOReader.read(configurationPath, mdoRef, MDCReadSettings.DEFAULT);
+    if (mdo == null) {
+      throw new IllegalArgumentException("MDO not found: " + mdoRef + " in " + configurationPath);
+    }
     var json = createJson(mdo);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var mdo = MDOReader.read(configurationPath, mdoRef, MDCReadSettings.DEFAULT);
var json = createJson(mdo);
var mdo = MDOReader.read(configurationPath, mdoRef, MDCReadSettings.DEFAULT);
if (mdo == null) {
throw new IllegalArgumentException("MDO not found: " + mdoRef + " in " + configurationPath);
}
var json = createJson(mdo);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java` around
lines 139 - 140, MDOReader.read(...) can return null, so the current
createJson(...) path in MDTestUtils should fail fast with a clear assertion
instead of allowing a later NPE. Update the logic around mdo and mdoRef to
explicitly check the result of MDOReader.read(...) and stop immediately with a
descriptive failure when the lookup misses, keeping the existing createJson(...)
flow only for non-null MDOs.

@theshadowco theshadowco merged commit 1afb906 into develop Jun 29, 2026
19 checks passed
@theshadowco theshadowco deleted the feature/newFixtures branch June 29, 2026 15:37
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.

[NEW] Подключить фикстуры 8.5

1 participant