-
Notifications
You must be signed in to change notification settings - Fork 7
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
Переделаны предопределенные значения на механизм общих модулей, добавлены параметры REST в методах интеграции #64
Conversation
…раметры REST для методов интеграции
WalkthroughThe recent updates encompass improvements in managing predefined values and integration settings in a 1C:Enterprise 8 architecture development project. These changes enhance the configurability and functionality of the system by introducing new functions and entities across multiple modules. Changes
Poem
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (3)
Additional Context UsedGitHub Check Runs (1)
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This comment has been minimized.
This comment has been minimized.
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: 7
Out of diff range and nitpick comments (8)
src/Catalogs/__МетодыИнтеграции/Forms/ФормаСписка/Ext/Form/Module.bsl (1)
21-23
: Empty event handlers section.Consider removing the "ОбработчикиСобытийФормы" region if no event handlers are planned to be added, to clean up the code.
src/Catalogs/__НастройкиИнтеграции/Forms/ФормаСписка/Ext/Form/Module.bsl (1)
21-23
: Empty event handlers section.Consider removing the "ОбработчикиСобытийФормы" region if no event handlers are planned to be added, to clean up the code.
src/Catalogs/__ИнтегрируемыеСистемы/Forms/ФормаСписка/Ext/Form/Module.bsl (1)
21-23
: Empty event handlers section.Consider removing the "ОбработчикиСобытийФормы" region if no event handlers are planned to be added, to clean up the code.
src/Catalogs/__НастройкиИнтеграции/Ext/ManagerModule.bsl (1)
25-39
: Add method description for better maintainability.Consider adding a description for the
ЗаполнитьПредопределенныеСоответствия
procedure to improve code documentation and maintainability.src/Catalogs/__ИнтегрируемыеСистемы/Ext/ManagerModule.bsl (1)
25-39
: Add method description for better maintainability.Consider adding a description for the
ЗаполнитьПредопределенныеСоответствия
procedure to improve code documentation and maintainability.src/CommonModules/__ИнтеграцииПереопределяемый/Ext/Module.bsl (3)
25-37
: Add method description for better maintainability.Consider adding a description for the
ПредопределенныеЗначенияИнтегрируемыеСистемы
function to improve code documentation and maintainability.
39-51
: Add method description for better maintainability.Consider adding a description for the
ПредопределенныеЗначенияМетодыИнтеграции
function to improve code documentation and maintainability.
53-65
: Add method description for better maintainability.Consider adding a description for the
ПредопределенныеЗначенияНастройкиИнтеграции
function to improve code documentation and maintainability.
// **Истина - возвращает структуру вида ИмяПараметра<Строка>:ЗначениеПоУмолчанию<Строка> | ||
// Возвращаемое значение: | ||
// Структура | ||
Функция ПолучитьСтруткуруПараметровREST(МетодИнтеграции, ЗаполнятьПоУмолчанию = Ложь) Экспорт |
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.
Correct the typo in the function name from ПолучитьСтруткуруПараметровREST
to ПолучитьСтруктуруПараметровREST
.
- Функция ПолучитьСтруткуруПараметровREST(МетодИнтеграции, ЗаполнятьПоУмолчанию = Ложь) Экспорт
+ Функция ПолучитьСтруктуруПараметровREST(МетодИнтеграции, ЗаполнятьПоУмолчанию = Ложь) Экспорт
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
Функция ПолучитьСтруткуруПараметровREST(МетодИнтеграции, ЗаполнятьПоУмолчанию = Ложь) Экспорт | |
Функция ПолучитьСтруктуруПараметровREST(МетодИнтеграции, ЗаполнятьПоУмолчанию = Ложь) Экспорт |
Add descriptions for all parameters and the return value of the ПолучитьСтруктуруПараметровREST
function to enhance code readability and maintainability.
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.
@winstonobyman надо поправить очепятку
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
&НаСервереБезКонтекста | ||
Процедура ЗаполнитьПредопределенныеНаСервере() | ||
|
||
Справочники.__НастройкиИнтеграции.ЗаполнитьПредопределенныеСоответствия(); | ||
|
||
КонецПроцедуры |
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.
Tip
Codebase Verification
The output from the rg
command clearly shows the content of the procedure ЗаполнитьПредопределенныеНаСервере
. From the provided context, it is evident that there is no exception handling within this procedure. The procedure simply calls another method without any try-catch blocks surrounding this call or within the procedure itself.
Given this information, it is confirmed that the original review comment about ensuring server-side procedures handle exceptions is valid, as the specific procedure in question lacks exception handling mechanisms.
Conclusion:
- The procedure
ЗаполнитьПредопределенныеНаСервере
does not include exception handling. - It is recommended to add try-catch blocks to manage potential exceptions that might occur during the execution of the inner method calls.
Analysis chain
Ensure server-side procedures handle exceptions.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that the server-side procedure `ЗаполнитьПредопределенныеНаСервере` has exception handling.
# Search for the procedure definition and check for exception handling.
ast-grep --lang bsl --pattern $'Процедура ЗаполнитьПредопределенныеНаСервере() {
$$$
try {
$$$
} catch ($_) {
$$$
}
}' "src/Catalogs/__НастройкиИнтеграции/Forms/ФормаСписка/Ext/Form/Module.bsl"
Length of output: 528
Script:
#!/bin/bash
# Description: Manually verify that the server-side procedure `ЗаполнитьПредопределенныеНаСервере` has exception handling by searching for the procedure and any try-catch blocks within it.
# Use ripgrep to search for the procedure and any surrounding try-catch blocks
rg --context 10 'Процедура ЗаполнитьПредопределенныеНаСервере' "src/Catalogs/__НастройкиИнтеграции/Forms/ФормаСписка/Ext/Form/Module.bsl"
Length of output: 758
Что ещё нужно сделать:
|
|
||
КонецФункции | ||
|
||
|
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.
Удалить лишний перевод строки
…еграции и прокси-метод для получения параметров
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: 13
|
||
#Область ПрограммныйИнтерфейс | ||
|
||
Функция ПредопределенныеЗначенияИнтегрируемыеСистемы() Экспорт |
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.
Add a description for the ПредопределенныеЗначенияИнтегрируемыеСистемы
function to clarify its purpose and usage.
|
||
КонецФункции | ||
|
||
Функция ПредопределенныеЗначенияМетодыИнтеграции() Экспорт |
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.
Add a description for the ПредопределенныеЗначенияМетодыИнтеграции
function to clarify its purpose and usage.
|
||
КонецФункции | ||
|
||
Функция ПредопределенныеЗначенияНастройкиИнтеграции() Экспорт |
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.
Add a description for the ПредопределенныеЗначенияНастройкиИнтеграции
function to clarify its purpose and usage.
|
||
Результат = Новый ТаблицаЗначений; | ||
|
||
ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150)); |
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.
Correct formatting issues.
- ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150));
+ ОписаниеСтрока = Новый ОписаниеТипов("Строка", , , , Новый КвалификаторыСтроки(150));
Ensure proper spacing after commas for better readability and adherence to coding standards.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150)); | |
ОписаниеСтрока = Новый ОписаниеТипов("Строка", , , , Новый КвалификаторыСтроки(150)); |
|
||
Результат = Новый ТаблицаЗначений; | ||
|
||
ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150)); |
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.
Correct formatting issues.
- ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150));
+ ОписаниеСтрока = Новый ОписаниеТипов("Строка", , , , Новый КвалификаторыСтроки(150));
Ensure proper spacing after commas for better readability and adherence to coding standards.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150)); | |
ОписаниеСтрока = Новый ОписаниеТипов("Строка", , , , Новый КвалификаторыСтроки(150)); |
|
||
Результат = Новый ТаблицаЗначений; | ||
|
||
ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150)); |
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.
Correct formatting issues.
- ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150));
+ ОписаниеСтрока = Новый ОписаниеТипов("Строка", , , , Новый КвалификаторыСтроки(150));
Ensure proper spacing after commas for better readability and adherence to coding standards.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
ОписаниеСтрока = Новый ОписаниеТипов("Строка",,,, Новый КвалификаторыСтроки(150)); | |
ОписаниеСтрока = Новый ОписаниеТипов("Строка", , , , Новый КвалификаторыСтроки(150)); |
|
||
#Область ПрограммныйИнтерфейс | ||
|
||
Процедура ЗаполнитьПредопределенныеСоответствия() Экспорт |
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.
Add a description for the ЗаполнитьПредопределенныеСоответствия
procedure to clarify its purpose and usage.
// **Истина - возвращает структуру вида ИмяПараметра<Строка>:ЗначениеПоУмолчанию<Строка> | ||
// Возвращаемое значение: | ||
// Структура | ||
Функция ПолучитьСтруктуруПараметровREST(МетодИнтеграции, ЗаполнятьПоУмолчанию = Ложь) Экспорт |
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.
Add descriptions for all parameters and the return value of the ПолучитьСтруктуруПараметровREST
function to enhance code readability and maintainability.
// | ||
// Возвращаемое значение: | ||
// Строка - приведенное к JSON поле типа | ||
Функция ПривестиЗначениеПоУмолчаниюREST(Значение, ТипJSON) Экспорт |
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.
Ensure that all execution paths in ПривестиЗначениеПоУмолчаниюREST
return a value to avoid runtime errors.
Возврат Формат(Значение, "ДФ=yyyy-MM-dd"); | ||
ИначеЕсли ТипJSON = Перечисления.__ТипыJSON.Число Тогда | ||
Возврат Формат(Значение, "ЧГ=0"); | ||
КонецЕсли; |
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.
Consider adding an 'else' branch to the conditional structure in ПривестиЗначениеПоУмолчаниюREST
to handle unexpected ТипJSON
values.
Изменено добавление предопределенных через общий модуль, добавлена ТЧ "Параметры REST" в справочник "Методы интеграции", для методов интеграции в модуль менеджера справочника добавлены функции по работе с параметрами.
Summary by CodeRabbit
New Features
Enhancements
Documentation