Skip to content

Чтение характеристик - #668

Merged
theshadowco merged 2 commits into
developfrom
feature/Feature-655
Jul 28, 2026
Merged

Чтение характеристик#668
theshadowco merged 2 commits into
developfrom
feature/Feature-655

Conversation

@theshadowco

@theshadowco theshadowco commented Jul 28, 2026

Copy link
Copy Markdown
Member

Описание

Реализовано чтение описания характеристик объектов метаданных

  • создан интерфейс для объектов, которые могут иметь характеристики
  • создан класс, хранящий описание характеристики
  • объектам добавлены поля со списком характеристик

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

Closes #655

Чеклист

Общие

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

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

Summary by CodeRabbit

  • New Features
    • Added support for object characteristics across documents, catalogs, tasks, business processes, enums, exchange plans, and other metadata types.
    • Added characteristic metadata, including type, value, field mapping, filtering, and multiple-value configuration.
    • Added support for reading characteristics from Designer and EDT XML formats.
    • Objects without configured characteristics continue to expose an empty collection.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@theshadowco, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 868d0278-27ff-495e-939b-57f5f920cc8d

📥 Commits

Reviewing files that changed from the base of the PR and between b6c4b14 and 69bfbbf.

📒 Files selected for processing (1)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/Characteristic.java
📝 Walkthrough

Walkthrough

Adds a Characteristic metadata model and CharacteristicOwner contract, exposes characteristics on multiple metadata objects, parses Designer and EDT XML characteristic nodes, and validates populated and empty collections with parameterized fixture tests.

Changes

Object characteristics support

Layer / File(s) Summary
Characteristic model and owner contract
src/main/java/com/github/_1c_syntax/bsl/mdo/CharacteristicOwner.java, src/main/java/com/github/_1c_syntax/bsl/mdo/storage/Characteristic.java, src/main/java/com/github/_1c_syntax/bsl/mdo/{BusinessProcess,Catalog,ChartOfAccounts,ChartOfCalculationTypes,ChartOfCharacteristicTypes,Document,Enum,ExchangePlan,Task}.java
Defines the CharacteristicOwner interface and immutable Characteristic metadata, then adds characteristic collections to supported metadata models.
Designer and EDT characteristic conversion
src/main/java/com/github/_1c_syntax/bsl/reader/{designer,edt}/converter/CharacteristicConverter.java
Parses characteristic nodes, maps reference fields, handles optional sources, and substitutes MdoReference.EMPTY for invalid references.
Characteristic parsing validation
src/test/java/com/github/_1c_syntax/bsl/mdo/CharacteristicOwnerTest.java
Validates characteristic counts and reference values for documents and catalogs, plus empty characteristic collections.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MetadataXML
  participant CharacteristicConverter
  participant Characteristic
  participant MetadataObject
  MetadataXML->>CharacteristicConverter: provide characteristic nodes
  CharacteristicConverter->>Characteristic: map fields to MdoReference values
  CharacteristicConverter->>MetadataObject: return characteristic collection
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Most required metadata objects gained Characteristics, but support for the external source table is not shown. Add Characteristics support for the external source table model required by #655, with parser and test coverage.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: adding characteristics support.
Out of Scope Changes check ✅ Passed The diff is centered on characteristics support, its model, converters, and tests, with no obvious unrelated changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/Feature-655

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.

@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: 3

🤖 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/main/java/com/github/_1c_syntax/bsl/mdo/CharacteristicOwner.java`:
- Line 35: Declare nullness consistently across the characteristics model:
update getCharacteristics() in CharacteristicOwner.java and the affected
List<Characteristic>/MdoReference members in Characteristic.java (lines 43-104),
BusinessProcess.java (235-236), Catalog.java (319-320), ChartOfAccounts.java
(269-270), ChartOfCalculationTypes.java (234-235), and
ChartOfCharacteristicTypes.java (301-302 and 304-308). Use `@NonNull` for values
that are always present, or `@Nullable` where absence is intentional, matching the
existing project annotations.

In `@src/main/java/com/github/_1c_syntax/bsl/mdo/storage/Characteristic.java`:
- Around line 36-37: Update the EqualsAndHashCode configuration on
Characteristic to include every field that defines a characteristic description,
not only characteristicTypes and characteristicValues; ensure mappings differing
in key, object, type, or value fields compare as unequal while preserving the
existing string representation configuration.
- Around line 43-44: Annotate the characteristicTypes field with JSpecify
org.jspecify.annotations.NonNull because it defaults to MdoReference.EMPTY and
is not nullable; use `@Nullable` only if this field can intentionally receive
null.
🪄 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 Plus

Run ID: d40de3f7-3298-49de-b81b-152accc6959d

📥 Commits

Reviewing files that changed from the base of the PR and between 96257ed and b6c4b14.

⛔ Files ignored due to path filters (33)
  • src/test/resources/fixtures/mdclasses/BusinessProcesses.БизнесПроцесс1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCalculationTypes.ПланВидовРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Documents.Документ1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Enums.Перечисление1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/Tasks.Задача1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_18/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_25/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_27/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_5_1/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_ext/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/BusinessProcesses.Задание.json 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.Заметки.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Configuration.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Documents.Анкета.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_1/Enums.СтатусыОбработчиковОбновления.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/Tasks.ЗадачаИсполнителя.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/Catalogs.ВерсииФайлов.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/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.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/Documents.Анкета.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/ExchangePlans.ОбновлениеИнформационнойБазы.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/ssl_3_2/Tasks.ЗадачаИсполнителя.json is excluded by !src/test/resources/**
📒 Files selected for processing (14)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/BusinessProcess.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Catalog.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/CharacteristicOwner.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCalculationTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Document.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Enum.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/ExchangePlan.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Task.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/storage/Characteristic.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/CharacteristicConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/CharacteristicConverter.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CharacteristicOwnerTest.java

Comment thread src/main/java/com/github/_1c_syntax/bsl/mdo/storage/Characteristic.java Outdated
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Test Results

  528 files  + 6    528 suites  +6   12m 23s ⏱️ + 1m 46s
1 283 tests +14  1 280 ✅ +14   3 💤 ±0  0 ❌ ±0 
7 722 runs  +84  7 704 ✅ +84  18 💤 ±0  0 ❌ ±0 

Results for commit 69bfbbf. ± Comparison against base commit 96257ed.

♻️ This comment has been updated with latest results.

@sonarqubecloud

Copy link
Copy Markdown

@theshadowco
theshadowco merged commit 0152f2b into develop Jul 28, 2026
19 checks passed
@theshadowco
theshadowco deleted the feature/Feature-655 branch July 28, 2026 13:01
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] Описания характеристик объектов метаданных

1 participant