Skip to content

refactor(types): массовые свойства объектов читаются через интерфейсы владельцев - #4537

Merged
nixel2007 merged 2 commits into
developfrom
refactor/types-mdo-owner-interfaces
Sep 26, 2026
Merged

nixel2007 merged 2 commits into
developfrom
refactor/types-mdo-owner-interfaces

Conversation

@sfaqer

@sfaqer sfaqer commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Что было

«Вводится на основании», «ввод по строке», «поля блокировки данных» и дополнительные индексы читались в MdoPropertyAccessors перечислением видов объектов (switch по восьми, а у индексов — по четырнадцати классам): общего интерфейса у этих свойств в mdclasses не было.

Изменение

С mdclasses 0.19.0.104 интерфейсы-владельцы есть (mdclasses#677): BasedOnOwner, InputByStringOwner, DataLockFieldsOwner, AdditionalIndexOwner. MdoPropertyAccessors теперь — четыре instanceof по этим интерфейсам вместо перечисления видов. Поведение не меняется.

Класс оставлен, а не растворён в MetadataChildrenExtractor: четыре интерфейса там подняли бы число зависимостей класса до 23 при пороге 20 (Sonar S1200, первая версия PR).

MetadataChildrenExtractorTest по-прежнему проверяет каждый вид объекта: состав видов с интерфейсом задан в mdclasses, и вид, потерявший интерфейс, иначе замолчал бы.

Проверка

  • MetadataChildrenExtractorTest, FormParametersHbkTest (с синтакс-помощником).
  • cleanTest check — зелёный.

Одна из четырёх частей переноса работы под mdclasses 0.19.0.104 на текущий develop; остальные — независимые PR.

🤖 Generated with Claude Code

… владельцев

«Вводится на основании», «ввод по строке», «поля блокировки данных» и
дополнительные индексы доставались рефлексией (MdoPropertyAccessors): у
этих свойств в mdclasses не было общего интерфейса, и виды объектов
перечислялись поимённо. С mdclasses 0.19.0.104 интерфейсы есть
(BasedOnOwner, InputByStringOwner, DataLockFieldsOwner, AdditionalIndexOwner,
mdclasses#677) - свойства читаются через них, а MdoPropertyAccessors удалён.

Тест по-прежнему проверяет каждый вид объекта: состав видов с интерфейсом
задан в mdclasses, и вид, потерявший интерфейс, иначе замолчал бы.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: 1c-syntax/bsl-language-server/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 8cd32109-ddee-4c14-8184-45783dd23ba0

📥 Commits

Reviewing files that changed from the base of the PR and between 67d2fbc and 6bc72c8.

📒 Files selected for processing (4)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/types/registry/FormParametersRegistrar.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/types/registry/MdoPropertyAccessors.java
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/types/registry/MetadataChildrenExtractor.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/types/registry/MetadataChildrenExtractorTest.java
💤 Files with no reviewable changes (1)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/types/registry/MdoPropertyAccessors.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The metadata registry now reads supported metadata properties through MDO owner interfaces. The change removes MdoPropertyAccessors and updates basisTypes to return Неопределено when its owner does not implement BasedOnOwner.

Changes

Metadata owner-interface lookups

Layer / File(s) Summary
Replace metadata accessor dispatch
src/main/java/com/github/_1c_syntax/bsl/languageserver/types/registry/*, src/test/java/com/github/_1c_syntax/bsl/languageserver/types/registry/MetadataChildrenExtractorTest.java
MetadataChildrenExtractor reads based-on references, input-by-string fields, data-lock fields, and additional indexes through owner interfaces. FormParametersRegistrar.basisTypes reads based-on references through BasedOnOwner. The change removes MdoPropertyAccessors and updates a test comment about owner-interface coverage.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to 6bc72

The metadata lookup migration preserves the previously supported kinds in the inspected dependency snapshot. No merge-blocking issue is established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 6bc72

The change does not show a new external entry point or privilege path. Existing tests cover the supported metadata kinds, while compatibility with the owner-interface definitions remains the main uncertainty.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The identified effect is on metadata-child extraction and form-parameter type resolution within the language server. The inspected changes do not establish a new attacker-accessible entry point or expanded privilege.

Trust Boundaries and Controls

  • observed — The owner-interface checks gate which metadata getters are called and provide empty or undefined fallbacks. They are type checks, not evidenced authorization controls.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: mass object properties now use owner interfaces instead of reflective access.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

…ейсах

Четыре интерфейса-владельца прямо в MetadataChildrenExtractor подняли число
его зависимостей до 23 при пороге 20 (Sonar S1200). MdoPropertyAccessors
возвращён, но вместо перечисления видов объектов в нём четыре instanceof
по интерфейсам mdclasses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 4 170 files   4 170 suites   1h 5m 57s ⏱️
 4 368 tests  4 295 ✅  73 💤 0 ❌
26 208 runs  25 762 ✅ 446 💤 0 ❌

Results for commit 5c248b0.

♻️ This comment has been updated with latest results.

@sfaqer
sfaqer requested a review from nixel2007 September 26, 2026 05:03
@sonarqubecloud

Copy link
Copy Markdown

@nixel2007
nixel2007 merged commit 43f3d76 into develop Sep 26, 2026
37 checks passed
@nixel2007
nixel2007 deleted the refactor/types-mdo-owner-interfaces branch September 26, 2026 07:21
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.

2 participants