Skip to content

Добавлена обработка ошибки чтения содержимого xdto пакета#559

Merged
theshadowco merged 2 commits into
developfrom
feature/fixXDTOPackage
Dec 29, 2025
Merged

Добавлена обработка ошибки чтения содержимого xdto пакета#559
theshadowco merged 2 commits into
developfrom
feature/fixXDTOPackage

Conversation

@theshadowco

@theshadowco theshadowco commented Dec 29, 2025

Copy link
Copy Markdown
Member

Описание

Добавлена обработка ошибки чтения содержимого xdto пакета

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

Closes

Чеклист

Общие

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

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

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced handling of XDTO package data to gracefully manage parsing failures. When corrupted or unreadable package data is encountered, the application now defaults to an empty dataset instead of throwing errors, ensuring uninterrupted operation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 29, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Two XDTOPackageConverter classes now include try-catch error handling around ExtendXStream.read operations. On exceptions, both default to XdtoPackageData.EMPTY instead of propagating errors, enabling graceful degradation when package data is corrupted or unreadable.

Changes

Cohort / File(s) Summary
XDTO Package Conversion Error Handling
src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/XDTOPackageConverter.java, src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/XDTOPackageConverter.java
Added try-catch blocks wrapping ExtendXStream.read calls; on exception, assigns XdtoPackageData.EMPTY as fallback. Introduced XdtoPackageData import and conditional DATA_FIELD assignment. EDTConverter includes Russian comment documenting corrupted file fallback behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 When data breaks and streams do fail,
A rabbit adds a safety sail—
With try-catch blocks and EMPTY grace,
Corruption finds its gentle place.
No thrown exceptions spoil our day,
Just defaults smooth to save the way! 🌟

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Добавлена обработка ошибки чтения содержимого xdto пакета' (Error handling added for reading xdto package contents) directly aligns with the main change: adding error handling for xdto package data reading in both converter classes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/fixXDTOPackage

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 and usage tips.

@github-actions

github-actions Bot commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

Test Results

  549 files  ±0    549 suites  ±0   7m 51s ⏱️ -10s
  239 tests ±0    239 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 241 runs  ±0  2 241 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit b4a3219. ± Comparison against base commit 953217c.

♻️ 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: 3

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 953217c and ad64a2f.

⛔ Files ignored due to path filters (5)
  • src/test/resources/ext/designer/mdclasses/src/cf/XDTOPackages/ПакетXDTO1/Ext/Package.bin is excluded by !**/*.bin, !src/test/resources/**
  • src/test/resources/ext/edt/mdclasses/configuration/src/XDTOPackages/ПакетXDTO1/Package.xdto 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/XDTOPackages.ПакетXDTO1.json is excluded by !src/test/resources/**
📒 Files selected for processing (2)
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/XDTOPackageConverter.java
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/XDTOPackageConverter.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: publish-test-results
🔇 Additional comments (4)
src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/XDTOPackageConverter.java (2)

25-25: LGTM - Import supports error handling fallback.

The import is necessary for the XdtoPackageData.EMPTY constant used in the error handling logic.


51-51: LGTM - Field is set consistently.

The setValue call is correctly placed outside the try-catch block, ensuring the field is always populated with either valid data or the EMPTY fallback.

src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/XDTOPackageConverter.java (2)

25-25: LGTM - Import supports error handling fallback.

The import is necessary for the XdtoPackageData.EMPTY constant used in the error handling logic.


49-49: LGTM - Field is set consistently.

The setValue call is correctly placed outside the try-catch block, ensuring the field is always populated with either valid data or the EMPTY fallback.

@1c-syntax 1c-syntax deleted a comment from coderabbitai Bot Dec 29, 2025
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
63.6% Coverage on New Code (required ≥ 80%)
B Maintainability 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 bc9178a into develop Dec 29, 2025
24 of 25 checks passed
@theshadowco
theshadowco deleted the feature/fixXDTOPackage branch December 29, 2025 06:15
@coderabbitai coderabbitai Bot mentioned this pull request Dec 29, 2025
4 tasks
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.

1 participant