-
Notifications
You must be signed in to change notification settings - Fork 109
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
Feature/protected module #3408
Feature/protected module #3408
Conversation
Warning Rate limit exceeded@theshadowco has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 15 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughВ этом пулл-реквесте добавлена документация и новый диагностический механизм для определения защищённых модулей, где отсутствует исходный код из-за паролей. Внесены изменения в документацию на русском и английском языках, создан класс диагностики для BSL Language Server с соответствующей логикой проверки, добавлены свойства локализации для английской и русской версий, а также тесты и тестовые ресурсы для проверки работы нового диагностического инструмента. Changes
Sequence Diagram(s)sequenceDiagram
participant LS as Language Server
participant PM as ProtectedModuleDiagnostic
participant MO as ModuleOwner
participant DS as Diagnostic Storage
LS->>PM: Вызов метода check()
alt Отсутствует конфигурация или диапазон модуля пуст
PM-->>LS: Досрочный возврат
else Диапазон модуля валиден
PM->>MO: Итерация по владельцам модуля
alt Найден защищённый модуль
PM->>DS: Добавление диагностики (addDiagnostic)
end
PM-->>LS: Возврат списка диагностик
end
Assessment against linked issues
Suggested reviewers
Poem
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 your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnosticTest.java (1)
42-42
: Рекомендуется использовать константы для путей к тестовым ресурсамПуть к метаданным захардкожен. Лучше вынести его в общие константы тестового окружения.
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java (1)
73-83
: Оптимизировать stream операцииТекущая реализация stream можно упростить:
- configuration.getChildren().stream() - .filter(md -> md instanceof ModuleOwner) - .map(md -> (ModuleOwner) md) - .forEach((ModuleOwner moduleOwner) -> { - var hasProtected = moduleOwner.getModules().stream() - .filter(Module::isProtected) - .findAny(); - if (hasProtected.isPresent()) { - addDiagnostic(moduleOwner); - } - }); + configuration.getChildren().stream() + .filter(md -> md instanceof ModuleOwner) + .map(md -> (ModuleOwner) md) + .filter(moduleOwner -> moduleOwner.getModules().stream() + .anyMatch(Module::isProtected)) + .forEach(this::addDiagnostic);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json
is excluded by!**/*.json
src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json
is excluded by!**/*.json
src/test/resources/metadata/subSystemFilter/CommonModules/ОбщийМодуль1/Ext/Module.bin
is excluded by!**/*.bin
,!**/*.bin
📒 Files selected for processing (7)
docs/diagnostics/ProtectedModule.md
(1 hunks)docs/en/diagnostics/ProtectedModule.md
(1 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java
(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic_en.properties
(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic_ru.properties
(1 hunks)src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnosticTest.java
(1 hunks)src/test/resources/diagnostics/ProtectedModuleDiagnostic.bsl
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- src/test/resources/diagnostics/ProtectedModuleDiagnostic.bsl
- src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic_ru.properties
- docs/en/diagnostics/ProtectedModule.md
🔇 Additional comments (3)
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic_en.properties (1)
1-2
: Перевод соответствует требованиямНесмотря на то, что согласно целям PR английский перевод можно пропустить, предоставленный перевод корректен и понятен.
docs/diagnostics/ProtectedModule.md (2)
9-11
: Необходимо добавить примерыРаздел примеров пуст. Следует добавить:
- Пример кода с защищенным модулем
- Рекомендации по исправлению ситуации
- Возможные альтернативные решения
12-18
: Дополнить раздел источниковНеобходимо указать источники информации, на основе которых была создана диагностика. Например:
- Стандарты разработки 1С
- Документация по безопасности
- Лучшие практики по управлению исходным кодом
...java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnosticTest.java
Show resolved
Hide resolved
...ain/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java
Show resolved
Hide resolved
...ain/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContext.java (1)
265-268
: Улучшение контракта метода с помощью @nonnullДобавление аннотации @nonnull явно указывает, что метод getConfiguration() никогда не вернет null. Это улучшает безопасность типов и помогает предотвратить NullPointerException.
Рекомендуется также добавить документацию JavaDoc для метода getConfiguration(), описывающую его контракт и гарантии возвращаемого значения.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContext.java
(2 hunks)
🔇 Additional comments (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContext.java (1)
36-36
: LGTM!Добавление импорта lombok.NonNull необходимо для поддержки аннотации @nonnull.
src/main/java/com/github/_1c_syntax/bsl/languageserver/context/ServerContext.java
Outdated
Show resolved
Hide resolved
Qodana for JVM78 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Detected 103 dependenciesThird-party software listThis page lists the third-party software dependencies used in bsl-language-server
Contact Qodana teamContact us at [email protected]
|
|
Описание
Реализация вместо реквеста #3081
Связанные задачи
Closes: #3076
Чеклист
Общие
gradlew precommit
)Для диагностик
Дополнительно