Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Защищенные модули #437

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Conversation

theshadowco
Copy link
Member

@theshadowco theshadowco commented Dec 19, 2023

Описание

Реализация поддержки признака "защищенный" для модулей (переосмысление реализации #413)

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

Closes: #414

Чеклист

Общие

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

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

Summary by CodeRabbit

  • New Features

    • Introduced protection status indication for modules, enhancing security and access control.
  • Documentation

    • Updated internal documentation to reflect the introduction of the protection status for modules.
  • Refactor

    • Improved module information reading mechanism for better performance and reliability.

Copy link
Contributor

github-actions bot commented Dec 19, 2023

Test Results

  53 files  ±0    53 suites  ±0   28s ⏱️ +12s
206 tests ±0  206 ✔️ ±0  0 💤 ±0  0 ±0 
208 runs  ±0  208 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 1bd4adc. ± Comparison against base commit cebac38.

♻️ This comment has been updated with latest results.

@theshadowco theshadowco added this to the 0.12.0 milestone Dec 19, 2023
@theshadowco theshadowco force-pushed the feature/protectedModules branch from db2f01f to 1bd4adc Compare December 20, 2023 14:32
Copy link

coderabbitai bot commented Dec 20, 2023

Walkthrough

The update introduces a mechanism to identify whether a module is protected (e.g., password-protected) across various Java classes. A new isProtected property has been added to module-related classes, and the ReaderUtils class now includes functionality to determine if a module is protected. The TransformationUtils and module converter classes have been modified to utilize this new information.

Changes

File Path Change Summary
.../bsl/mdo/CommonModule.java
.../bsl/mdo/Module.java
.../bsl/mdo/children/ObjectModule.java
Added isProtected boolean field
.../bsl/reader/common/ReaderUtils.java Added ReaderUtils class with readProtectedModuleInfo method and ProtectedModuleInfo inner class
.../bsl/reader/common/TransformationUtils.java Modified addModules method to include protection info
.../bsl/reader/designer/converter/CommonModuleConverter.java
.../bsl/reader/edt/converter/CommonModuleConverter.java
Added IS_PROTECTED_FIELD and modified unmarshal method to set protection info
src/test/java/com/github/_1c_syntax/bsl/mdo/... No changes to tests regarding public or exported entities

Assessment against linked issues

Objective Addressed Explanation
Detect if a module is protected or password-protected (#414) The addition of isProtected across module classes and the implementation in ReaderUtils indicate that the code can now detect protected modules.

Poem

In the realm of code, where secrets hide,
A rabbit hops, with eyes open wide.
🐾 Modules locked away, with a password shield,
🗝️ Now their protection is gracefully revealed.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can reply to a review comment made by CodeRabbit.
  • You can tag CodeRabbit on specific lines of code or files in the PR by tagging @coderabbitai in a comment.
  • You can tag @coderabbitai in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
91.5% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cebac38 and 1bd4adc.
Files ignored due to filter (90)
  • src/test/resources/ext/designer/mdclasses/src/cf/CalculationRegisters/РегистрРасчета1/Recalculations/Перерасчет/Ext/RecordSetModule.bin
  • src/test/resources/ext/designer/mdclasses/src/cf/Catalogs/Справочник1/Ext/ObjectModule.bin
  • src/test/resources/fixtures/mdclasses/BusinessProcesses.БизнесПроцесс1.json
  • src/test/resources/fixtures/mdclasses/BusinessProcesses.БизнесПроцесс1_edt.json
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1.json
  • src/test/resources/fixtures/mdclasses/CalculationRegisters.РегистрРасчета1_edt.json
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1.json
  • src/test/resources/fixtures/mdclasses/Catalogs.Справочник1_edt.json
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1.json
  • src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1_edt.json
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1.json
  • src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1_edt.json
  • src/test/resources/fixtures/mdclasses/CommonCommands.ОбщаяКоманда1.json
  • src/test/resources/fixtures/mdclasses/CommonCommands.ОбщаяКоманда1_edt.json
  • src/test/resources/fixtures/mdclasses/CommonForms.Форма.json
  • src/test/resources/fixtures/mdclasses/CommonForms.Форма_edt.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ГлобальныйОбщийМодуль.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ГлобальныйОбщийМодуль_edt.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульВызовСервера.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульВызовСервера_edt.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульПовтИспВызов.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульПовтИспВызов_edt.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульПовтИспСеанс.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульПовтИспСеанс_edt.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульПолныйеПрава.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ОбщийМодульПолныйеПрава_edt.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ПростойОбщийМодуль.json
  • src/test/resources/fixtures/mdclasses/CommonModules.ПростойОбщийМодуль_edt.json
  • src/test/resources/fixtures/mdclasses/Constants.Константа1.json
  • src/test/resources/fixtures/mdclasses/Constants.Константа1_edt.json
  • src/test/resources/fixtures/mdclasses/DataProcessors.Обработка1.json
  • src/test/resources/fixtures/mdclasses/DataProcessors.Обработка1_edt.json
  • src/test/resources/fixtures/mdclasses/DocumentJournals.ЖурналДокументов1.json
  • src/test/resources/fixtures/mdclasses/DocumentJournals.ЖурналДокументов1_edt.json
  • src/test/resources/fixtures/mdclasses/Documents.Документ1.json
  • src/test/resources/fixtures/mdclasses/Documents.Документ1_edt.json
  • src/test/resources/fixtures/mdclasses/Enums.Перечисление1.json
  • src/test/resources/fixtures/mdclasses/Enums.Перечисление1_edt.json
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1.json
  • src/test/resources/fixtures/mdclasses/ExchangePlans.ПланОбмена1_edt.json
  • src/test/resources/fixtures/mdclasses/ExternalDataSources.ТекущаяСУБД.json
  • src/test/resources/fixtures/mdclasses/ExternalDataSources.ТекущаяСУБД_edt.json
  • src/test/resources/fixtures/mdclasses/FilterCriteria.КритерийОтбора1.json
  • src/test/resources/fixtures/mdclasses/FilterCriteria.КритерийОтбора1_edt.json
  • src/test/resources/fixtures/mdclasses/HTTPServices.HTTPСервис1.json
  • src/test/resources/fixtures/mdclasses/HTTPServices.HTTPСервис1_edt.json
  • src/test/resources/fixtures/mdclasses/InformationRegisters.РегистрСведений1.json
  • src/test/resources/fixtures/mdclasses/InformationRegisters.РегистрСведений1_edt.json
  • src/test/resources/fixtures/mdclasses/Reports.Отчет1.json
  • src/test/resources/fixtures/mdclasses/Reports.Отчет1_edt.json
  • src/test/resources/fixtures/mdclasses/Sequences.Последовательность1.json
  • src/test/resources/fixtures/mdclasses/Sequences.Последовательность1_edt.json
  • src/test/resources/fixtures/mdclasses/WebServices.WebСервис1.json
  • src/test/resources/fixtures/mdclasses/WebServices.WebСервис1_edt.json
  • src/test/resources/fixtures/mdclasses_3_18/Bots.Бот1.json
  • src/test/resources/fixtures/mdclasses_3_18/Bots.Бот1_edt.json
  • src/test/resources/fixtures/mdclasses_3_18/Configuration.json
  • src/test/resources/fixtures/mdclasses_3_18/Configuration_edt.json
  • src/test/resources/fixtures/mdclasses_3_18/IntegrationServices.СервисИнтеграции1.json
  • src/test/resources/fixtures/mdclasses_3_18/IntegrationServices.СервисИнтеграции1_edt.json
  • src/test/resources/fixtures/ssl_3_1/BusinessProcesses.Задание.json
  • src/test/resources/fixtures/ssl_3_1/BusinessProcesses.Задание_edt.json
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки.json
  • src/test/resources/fixtures/ssl_3_1/Catalogs.Заметки_edt.json
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.json
  • src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения_edt.json
  • src/test/resources/fixtures/ssl_3_1/CommonCommands.ОтправитьПисьмо.json
  • src/test/resources/fixtures/ssl_3_1/CommonCommands.ОтправитьПисьмо_edt.json
  • src/test/resources/fixtures/ssl_3_1/CommonForms.Вопрос.json
  • src/test/resources/fixtures/ssl_3_1/CommonForms.Вопрос_edt.json
  • src/test/resources/fixtures/ssl_3_1/CommonModules.АвтономнаяРабота.json
  • src/test/resources/fixtures/ssl_3_1/CommonModules.АвтономнаяРабота_edt.json
  • src/test/resources/fixtures/ssl_3_1/DataProcessors.ЗагрузкаКурсовВалют.json
  • src/test/resources/fixtures/ssl_3_1/DataProcessors.ЗагрузкаКурсовВалют_edt.json
  • src/test/resources/fixtures/ssl_3_1/DocumentJournals.Взаимодействия.json
  • src/test/resources/fixtures/ssl_3_1/DocumentJournals.Взаимодействия_edt.json
  • src/test/resources/fixtures/ssl_3_1/Documents.Анкета.json
  • src/test/resources/fixtures/ssl_3_1/Documents.Анкета_edt.json
  • src/test/resources/fixtures/ssl_3_1/Enums.СтатусыОбработчиковОбновления.json
  • src/test/resources/fixtures/ssl_3_1/Enums.СтатусыОбработчиковОбновления_edt.json
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы.json
  • src/test/resources/fixtures/ssl_3_1/ExchangePlans.ОбновлениеИнформационнойБазы_edt.json
  • src/test/resources/fixtures/ssl_3_1/InformationRegisters.ЭлектронныеПодписи.json
  • src/test/resources/fixtures/ssl_3_1/InformationRegisters.ЭлектронныеПодписи_edt.json
  • src/test/resources/fixtures/ssl_3_1/SettingsStorages.ХранилищеВариантовОтчетов.json
  • src/test/resources/fixtures/ssl_3_1/SettingsStorages.ХранилищеВариантовОтчетов_edt.json
  • src/test/resources/fixtures/ssl_3_1/Tasks.ЗадачаИсполнителя.json
  • src/test/resources/fixtures/ssl_3_1/Tasks.ЗадачаИсполнителя_edt.json
  • src/test/resources/fixtures/ssl_3_1/WebServices.EnterpriseDataExchange_1_0_1_1.json
  • src/test/resources/fixtures/ssl_3_1/WebServices.EnterpriseDataExchange_1_0_1_1_edt.json
Files selected for processing (10)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/CommonModule.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/Module.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/mdo/children/ObjectModule.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/ReaderUtils.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/common/TransformationUtils.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/CommonModuleConverter.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/CommonModuleConverter.java (2 hunks)
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CalculationRegisterTest.java (1 hunks)
  • src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java (1 hunks)
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DocumentTest.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/test/java/com/github/_1c_syntax/bsl/mdo/DocumentTest.java
Additional comments: 9
src/main/java/com/github/_1c_syntax/bsl/mdo/CommonModule.java (1)
  • 73-73: The addition of the isProtected field aligns with the PR objectives to track module protection status.
src/main/java/com/github/_1c_syntax/bsl/mdo/Module.java (1)
  • 51-51: The addition of the isProtected() method in the Module interface is consistent with the PR's goal to determine module protection.
src/main/java/com/github/_1c_syntax/bsl/mdo/children/ObjectModule.java (1)
  • 50-50: The addition of the isProtected field in the ObjectModule class is consistent with the PR's goal to track module protection status.
src/main/java/com/github/_1c_syntax/bsl/reader/common/ReaderUtils.java (1)
  • 37-81: The ReaderUtils class and its method readProtectedModuleInfo along with the inner class ProtectedModuleInfo are well-implemented to handle the detection of protected modules.
src/main/java/com/github/_1c_syntax/bsl/reader/common/TransformationUtils.java (1)
  • 365-372: The changes to the addModules method in TransformationUtils correctly utilize ReaderUtils.readProtectedModuleInfo to set the isProtected property for ObjectModule instances.
src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/CommonModuleConverter.java (1)
  • 46-57: The unmarshal method in CommonModuleConverter has been updated to correctly determine and set the isProtected status of a module.
src/main/java/com/github/_1c_syntax/bsl/reader/edt/converter/CommonModuleConverter.java (1)
  • 46-48: The unmarshal method in CommonModuleConverter for the EDT package has been correctly updated to handle the isProtected status of modules using ReaderUtils.readProtectedModuleInfo.
src/test/java/com/github/_1c_syntax/bsl/mdo/CalculationRegisterTest.java (1)
  • 49-52: The new assertion in CalculationRegisterTest correctly verifies that all modules in a recalculation are protected, aligning with the PR's functionality.
src/test/java/com/github/_1c_syntax/bsl/mdo/CatalogTest.java (1)
  • 60-62: The modified assertion in CatalogTest correctly checks if any of the modules are protected, aligning with the PR's functionality.

@theshadowco theshadowco merged commit c37b246 into develop Dec 20, 2023
15 checks passed
@theshadowco theshadowco deleted the feature/protectedModules branch December 20, 2023 14: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] Данные о защищенных, запароленных модулях
3 participants