Skip to content

Переработанная модель содержимого формы из mdclasses - #4331

Merged
nixel2007 merged 1 commit into
developfrom
feature/mdclasses-form-model
Jul 31, 2026
Merged

Переработанная модель содержимого формы из mdclasses#4331
nixel2007 merged 1 commit into
developfrom
feature/mdclasses-form-model

Conversation

@sfaqer

@sfaqer sfaqer commented Jul 31, 2026

Copy link
Copy Markdown
Member

Подъём mdclasses на переработанную модель содержимого формы (mdclasses#674) и адаптация к ней.

Вместо плоского FormItem — иерархия FormElement с наследниками (FormField, FormGroup, FormTable, FormButton, FormDecoration, FormAddition) и интерфейсами-ролями (FormElementOwner, FormDataPathOwner, FormEventHandlerOwner). Здесь только подъём и адаптация к переименованиям; новые данные (команды и параметры формы, признак основного реквизита, колонки реквизитов, события элементов) пока не используются — это отдельная работа.

Что поменялось в коде:

  • FormData.getPlainItems()getPlainElements();
  • ПутьКДанным спрашивается через FormDataPathOwner: у элементов, у которых его быть не может, метода больше нет — раньше он возвращал пустую строку.

Два неочевидных момента:

  • bsl-common-library поднята вынужденно. Новая mdclasses требует 0.12.4; на 0.12.3 падает чтение конфигурации целиком — NoSuchFieldError: V8ValueType.DATA_COMPOSITION_FIELD, то есть метаданные не читаются вовсе, а не только формы.
  • ForbiddenMetadataNameDiagnosticTest: 19 → 17. Реализовано чтение иерархии справочника (mdclasses#656), и у неиерархического справочника фикстуры больше нет стандартных реквизитов Родитель и ЭтоГруппа — их и не должно быть.

Версия mdclasses пока снапшотная: правка влита в develop, релиза ещё нет. Перед вливанием заменить на релизную.

Проверка: полный check зелёный, 639 тестовых классов.

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation of form element data paths, providing more accurate diagnostics for applicable elements.
    • Updated diagnostic expectations to reflect corrected validation results.

mdclasses переехала на новую иерархию элементов формы (mdclasses#674): вместо
плоского `FormItem` — `FormElement` с наследниками (`FormField`, `FormGroup`,
`FormTable`, `FormButton`, `FormDecoration`, `FormAddition`) и интерфейсами-ролями
(`FormElementOwner`, `FormDataPathOwner`, `FormEventHandlerOwner`). Заодно
появились команды и параметры формы, признак основного реквизита, колонки
реквизитов и события элементов — то, ради чего заводились mdclasses#648-#651,
#657, #665, #666.

Здесь только подъём зависимости и адаптация к переименованиям: `getPlainItems`
→ `getPlainElements`, `ПутьКДанным` спрашивается через `FormDataPathOwner` —
у элементов, у которых его быть не может, метода больше нет.

`bsl-common-library` поднята вместе с ней вынужденно: новая mdclasses требует
0.12.4, а на 0.12.3 падает чтение конфигурации целиком
(`NoSuchFieldError: V8ValueType.DATA_COMPOSITION_FIELD`).

`ForbiddenMetadataNameDiagnosticTest` ждал 19 диагностик, стало 17: реализовано
чтение иерархии справочника (mdclasses#656), и у неиерархического справочника
фикстуры больше нет стандартных реквизитов `Родитель` и `ЭтоГруппа`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The project updates two dependencies. The form-element diagnostic now uses FormElement traversal and checks paths for FormDataPathOwner elements. A diagnostic catalog test now expects 17 diagnostics.

Changes

Form model alignment

Layer / File(s) Summary
Dependency version alignment
build.gradle.kts
The mdclasses and bsl-common-library dependency versions were updated.
Form diagnostic traversal update
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/WrongDataPathForFormElementsDiagnostic.java, src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ForbiddenMetadataNameDiagnosticTest.java
The diagnostic now traverses plain form elements and validates paths only for elements implementing FormDataPathOwner. The catalog assertion now expects 17 diagnostics.

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

Possibly related PRs

Suggested reviewers: nixel2007

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно описывает основное изменение: переход на переработанную модель содержимого формы из mdclasses.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/mdclasses-form-model

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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@build.gradle.kts`:
- Around line 101-102: Update the mdclasses dependency declaration in
build.gradle.kts from the mutable 0.19.0.82-SNAPSHOT snapshot to the released
0.20.0 version containing mdclasses#674, then run the dependency and test checks
defined by the Gradle build.
🪄 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: 233c781f-fed4-4bcd-b6a2-a68621f06846

📥 Commits

Reviewing files that changed from the base of the PR and between a7b0af8 and 39ac33c.

📒 Files selected for processing (3)
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/WrongDataPathForFormElementsDiagnostic.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ForbiddenMetadataNameDiagnosticTest.java

Comment thread build.gradle.kts
Comment on lines +101 to +102
api("io.github.1c-syntax:mdclasses:0.19.0.82-SNAPSHOT")
api("io.github.1c-syntax:bsl-common-library:0.12.4")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n 'mdclasses|bsl-common-library|mavenCentral|snapshot|repositories' \
  --glob '*.gradle' --glob '*.gradle.kts' --glob 'settings.gradle*'

curl -fsSL \
  'https://repo1.maven.org/maven2/io/github/1c-syntax/mdclasses/maven-metadata.xml' \
  | grep -E '0\.19\.0\.82|0\.19\.1|0\.20\.0' || true

Repository: 1c-syntax/bsl-language-server

Length of output: 255


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== gradle files =="
git ls-files '*gradle*' '*.gradle*' 'settings.gradle*'

echo "== build.gradle.kts relevant lines =="
cat -n build.gradle.kts | sed -n '85,110p'

echo "== mdclasses versions on Maven Central =="
curl -fsSL 'https://repo1.maven.org/maven2/io/github/1c-syntax/mdclasses/maven-metadata.xml'
echo

echo "== bsl-common-library versions on Maven Central =="
curl -fsSL 'https://repo1.maven.org/maven2/io/github/1c-syntax/bsl-common-library/maven-metadata.xml'
echo

Repository: 1c-syntax/bsl-language-server

Length of output: 3931


Replace the mdclasses snapshot before merging.

0.19.0.82-SNAPSHOT is mutable and not available on Maven Central; the nearest release is 0.20.0. Use the released version that contains mdclasses#674, then run the dependency and test checks required by build.gradle.kts.

🤖 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 `@build.gradle.kts` around lines 101 - 102, Update the mdclasses dependency
declaration in build.gradle.kts from the mutable 0.19.0.82-SNAPSHOT snapshot to
the released 0.20.0 version containing mdclasses#674, then run the dependency
and test checks defined by the Gradle build.

Source: Coding guidelines

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Test Results

 3 834 files  ±0   3 834 suites  ±0   57m 13s ⏱️ - 7m 55s
 3 876 tests ±0   3 847 ✅ ±0   29 💤 ±0  0 ❌ ±0 
23 256 runs  ±0  23 078 ✅ ±0  178 💤 ±0  0 ❌ ±0 

Results for commit 39ac33c. ± Comparison against base commit af362ca.

♻️ This comment has been updated with latest results.

@nixel2007
nixel2007 merged commit e7a5bae into develop Jul 31, 2026
44 checks passed
@nixel2007
nixel2007 deleted the feature/mdclasses-form-model branch July 31, 2026 06:54
@nixel2007
nixel2007 restored the feature/mdclasses-form-model branch July 31, 2026 06:59
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