Skip to content

добавлено чтение измерений перерасчетов#630

Merged
theshadowco merged 2 commits into
developfrom
feature/recalculation
Jun 30, 2026
Merged

добавлено чтение измерений перерасчетов#630
theshadowco merged 2 commits into
developfrom
feature/recalculation

Conversation

@theshadowco

@theshadowco theshadowco commented Jun 30, 2026

Copy link
Copy Markdown
Member

Описание

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

Closes #251

Чеклист

Общие

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

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

Summary by CodeRabbit

  • New Features
    • Added support for recalculation dimensions, including correct metadata recognition during import.
    • Expanded recalculation-related field handling by supporting an additional “LeadingRegisterData” node.
  • Bug Fixes
    • Improved XML hierarchy context tracking to more reliably resolve nested items during reading.
    • Updated build settings to Java 21 and refreshed a core library dependency.
  • Tests
    • Extended coverage for recalculation dimensions and adjusted assertions to match updated collection access.
    • Updated test utilities/fixtures and right/serialization expectations.

@coderabbitai

coderabbitai Bot commented Jun 30, 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: 49 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

Run ID: c74e8f45-5f76-48e3-9b31-84aaa8e01122

📥 Commits

Reviewing files that changed from the base of the PR and between 5ee1081 and 45146c9.

⛔ Files ignored due to path filters (7)
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1_edt.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/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_24/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_25/CalculationRegisters.РегистрРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_25/CalculationRegisters.РегистрРасчета1_edt.json is excluded by !src/test/resources/**
📒 Files selected for processing (12)
  • .idea/gradle.xml
  • .idea/vcs.xml
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/Recalculation.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/RecalculationDimension.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendReaderWrapper.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/MdoReferenceConverter.java
  • src/test/java/com/github/_1c_syntax/bsl/examples/ValueTypeTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CalculationRegisterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/smoke/RightTest.java
  • src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java
📝 Walkthrough

Walkthrough

Adds RecalculationDimension as a new Attribute/AccessRightsOwner type, updates Recalculation to hold dimensions, extends XML reading to remap recalculation dimensions, updates tests and fixture utilities, and changes Gradle and IDE configuration.

Changes

RecalculationDimension Feature

Layer / File(s) Summary
RecalculationDimension model and Recalculation AttributeOwner
src/main/java/com/github/_1c_syntax/bsl/mdo/children/RecalculationDimension.java, src/main/java/com/github/_1c_syntax/bsl/mdo/children/Recalculation.java
RecalculationDimension is added as an immutable Attribute and AccessRightsOwner with default metadata fields and value-type/right helpers. Recalculation now implements AttributeOwner, stores dimensions, and returns them from getAllAttributes() and getChildren().
XML parent tracking and dimension remapping
src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendReaderWrapper.java, src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java, src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/MdoReferenceConverter.java
ExtendReaderWrapper tracks parent node names while reading XML. MDReaderContext uses that path data to remap Dimension to RecalculationDimension and assign MDOType.RECALCULATION_DIMENSION. MdoReferenceConverter adds LeadingRegisterData handling.
Dimension tests and fixture utilities
src/test/java/com/github/_1c_syntax/bsl/mdo/CalculationRegisterTest.java, src/test/java/com/github/_1c_syntax/bsl/smoke/RightTest.java, src/test/java/com/github/_1c_syntax/bsl/examples/ValueTypeTest.java, src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java
Tests now assert recalculation dimensions, updated right counts, and first-element access. MDTestUtils expands qualifier serialization support and changes fixture regeneration to write a provided object to a provided path.

Build and IDE Config

Layer / File(s) Summary
Dependency, JVM, and VCS config
build.gradle.kts, .idea/gradle.xml, .idea/vcs.xml
bsl-common-library is bumped to 0.12.1, gradleJvm is set to 21, and VCS mappings are added for the new ssl_3_2 test resource directories.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐇 Hop hop, a dimension takes its place,
Through XML paths, we now trace.
Recalculation wakes,
New tests and right counts it makes,
And fixtures dance at a brisker pace! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR also includes unrelated changes like dependency bumps, .idea updates, and test utility refactors. Split unrelated housekeeping and test utility changes into separate PRs, or justify them explicitly in the issue scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% 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 Title clearly matches the main change: adding support for reading recalculation dimensions.
Linked Issues check ✅ Passed The PR implements reading recalculation dimensions and adds tests, satisfying #251.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/recalculation

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 30, 2026

Copy link
Copy Markdown
Contributor

Test Results

  402 files  ± 0    402 suites  ±0   8m 0s ⏱️ -52s
  374 tests + 2    374 ✅ + 2  0 💤 ±0  0 ❌ ±0 
2 328 runs  +12  2 328 ✅ +12  0 💤 ±0  0 ❌ ±0 

Results for commit 45146c9. ± Comparison against base commit b3afb23.

♻️ This comment has been updated with latest results.

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

🧹 Nitpick comments (1)
src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java (1)

104-120: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reduce repeated MDOType.fromValue(...) lookups.

Both branches call MDOType.fromValue(...) twice for the same key. Resolving once into a local improves readability and avoids redundant work.

♻️ Example for the DESIGNER branch
-        var parentFolder = currentPath.getParent().getFileName().toString();
-        if (MDOType.fromValue(parentFolder).isPresent()
-          && MDOType.fromValue(parentFolder).get() == MDOType.RECALCULATION) {
+        var parentFolder = currentPath.getParent().getFileName().toString();
+        if (MDOType.fromValue(parentFolder).filter(t -> t == MDOType.RECALCULATION).isPresent()) {
           realClass = RecalculationDimension.class;
           realClassName = realClass.getSimpleName();
         }
🤖 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/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java`
around lines 104 - 120, The `MDReaderContext` dimension-type resolution repeats
`MDOType.fromValue(...)` for the same value in both the DESIGNER and
non-DESIGNER branches. Update the logic around `realClass`/`realClassName` to
resolve the `MDOType` once into a local variable for `parentFolder` and
`lastParent`, then reuse that result in the `RECALCULATION` check to make the
code clearer and avoid redundant lookups.
🤖 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/examples/ValueTypeTest.java`:
- Around line 120-122: Replace the Java assert-based null checks in
ValueTypeTest with AssertJ assertions so they always execute during tests.
Update the checks around isEDT and examplePackName to use the existing AssertJ
style used in the test suite, keeping the same validation intent inside the test
method that reads values from ArgumentsAccessor.

---

Nitpick comments:
In
`@src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java`:
- Around line 104-120: The `MDReaderContext` dimension-type resolution repeats
`MDOType.fromValue(...)` for the same value in both the DESIGNER and
non-DESIGNER branches. Update the logic around `realClass`/`realClassName` to
resolve the `MDOType` once into a local variable for `parentFolder` and
`lastParent`, then reuse that result in the `RECALCULATION` check to make the
code clearer and avoid redundant lookups.
🪄 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: ea6e6231-d8b0-45c9-a77b-d3a6816a25f0

📥 Commits

Reviewing files that changed from the base of the PR and between b3afb23 and 4468e87.

⛔ Files ignored due to path filters (7)
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1_edt.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/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_24/Configuration_edt.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_25/CalculationRegisters.РегистрРасчета1.json is excluded by !src/test/resources/**
  • src/test/resources/fixtures/mdclasses_3_25/CalculationRegisters.РегистрРасчета1_edt.json is excluded by !src/test/resources/**
📒 Files selected for processing (12)
  • .idea/gradle.xml
  • .idea/vcs.xml
  • build.gradle.kts
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/Recalculation.java
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/RecalculationDimension.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendReaderWrapper.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/MdoReferenceConverter.java
  • src/test/java/com/github/_1c_syntax/bsl/examples/ValueTypeTest.java
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CalculationRegisterTest.java
  • src/test/java/com/github/_1c_syntax/bsl/smoke/RightTest.java
  • src/test/java/com/github/_1c_syntax/bsl/test_utils/MDTestUtils.java

Comment thread src/test/java/com/github/_1c_syntax/bsl/examples/ValueTypeTest.java Outdated
@nixel2007

Copy link
Copy Markdown
Member

Cc @sfaqer

@theshadowco theshadowco force-pushed the feature/recalculation branch from 5ee1081 to 45146c9 Compare June 30, 2026 12:26
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
76.4% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@theshadowco theshadowco merged commit d25c361 into develop Jun 30, 2026
18 of 19 checks passed
@theshadowco theshadowco deleted the feature/recalculation branch June 30, 2026 12:39
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] Recalculation. Измерения

2 participants