Skip to content

Commit ab85c11

Browse files
Copilotnixel2007
andauthored
Исправление пропущенного мержа ПлановОбмена в MDMerger (#580)
* Initial plan * fix: add missing ExchangePlans merge in MDMerger ExchangePlans (ПланОбмена) were not merged when combining configuration with extensions in multi-root mode, causing false positives in QueryToMissingMetadata diagnostic. Fixes #579 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Nikita Fedkin <nixel2007@gmail.com> Co-authored-by: Nikita Fedkin <nikita.fedkin@booking.com>
1 parent 6184df7 commit ab85c11

6 files changed

Lines changed: 52 additions & 2 deletions

File tree

src/main/java/com/github/_1c_syntax/bsl/reader/MDMerger.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public static Configuration merge(Configuration cf, ConfigurationExtension exten
106106
.clearWebSocketClients().webSocketClients(mergeMD(cf, extension, CF::getWebSocketClients, newChildren))
107107
.clearHttpServices().httpServices(mergeMD(cf, extension, CF::getHttpServices, newChildren))
108108
.clearIntegrationServices().integrationServices(mergeMD(cf, extension, CF::getIntegrationServices, newChildren))
109+
.clearExchangePlans().exchangePlans(mergeMD(cf, extension, CF::getExchangePlans, newChildren))
109110
.clearConstants().constants(mergeMD(cf, extension, CF::getConstants, newChildren))
110111
.clearCatalogs().catalogs(mergeMD(cf, extension, CF::getCatalogs, newChildren))
111112
.clearDocuments().documents(mergeMD(cf, extension, CF::getDocuments, newChildren))

src/test/java/com/github/_1c_syntax/bsl/mdclasses/MDClassesSolutionTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,19 @@ void createSolutionCf_2_exts() {
6767
var cf = (Configuration) solution;
6868
assertThat(cf.getSupportVariant()).isEqualTo(SupportVariant.NONE);
6969
assertThat(cf.getModules()).hasSize(3);
70-
assertThat(cf.getChildren()).hasSize(10);
70+
assertThat(cf.getChildren()).hasSize(12);
7171

7272
assertThat(cf.getAllModules()).hasSize(7);
7373

7474
assertThat(cf.getRoles()).hasSize(2);
7575
assertThat(cf.getLanguages()).hasSize(1);
76+
assertThat(cf.getExchangePlans()).hasSize(2);
7677
assertThat(cf.getConstants()).hasSize(1);
7778
assertThat(cf.getCatalogs()).hasSize(3);
7879
assertThat(cf.getDocuments()).hasSize(1);
7980
assertThat(cf.getEnums()).hasSize(1);
8081
assertThat(cf.getDataProcessors()).hasSize(1);
81-
assertThat(cf.getPlainChildren().stream().map(MD::getMdoRef).sorted()).hasSize(53);
82+
assertThat(cf.getPlainChildren().stream().map(MD::getMdoRef).sorted()).hasSize(71);
8283

8384
assertThat(cf.getModulesByType()).hasSize(7)
8485
.containsValue(ModuleType.FormModule)

src/test/resources/solutions/sol1/Конфигурация/src/Configuration/Configuration.mdo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
</synonym>
3939
<languageCode>ru</languageCode>
4040
</languages>
41+
<exchangePlans>ExchangePlan.ПланОбмена1</exchangePlans>
4142
<catalogs>Catalog.Справочник1</catalogs>
4243
<catalogs>Catalog.Справочник2</catalogs>
4344
<documents>Document.Документ1</documents>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mdclass:ExchangePlan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:core="http://g5.1c.ru/v8/dt/mcore" xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="a1b2c3d4-e5f6-7890-abcd-ef1234567890" thisNode="11111111-2222-3333-4444-555555555555">
3+
<producedTypes>
4+
<objectType typeId="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" valueTypeId="11111111-bbbb-cccc-dddd-eeeeeeeeeeee"/>
5+
<refType typeId="22222222-bbbb-cccc-dddd-eeeeeeeeeeee" valueTypeId="33333333-bbbb-cccc-dddd-eeeeeeeeeeee"/>
6+
<selectionType typeId="44444444-bbbb-cccc-dddd-eeeeeeeeeeee" valueTypeId="55555555-bbbb-cccc-dddd-eeeeeeeeeeee"/>
7+
<listType typeId="66666666-bbbb-cccc-dddd-eeeeeeeeeeee" valueTypeId="77777777-bbbb-cccc-dddd-eeeeeeeeeeee"/>
8+
<managerType typeId="88888888-bbbb-cccc-dddd-eeeeeeeeeeee" valueTypeId="99999999-bbbb-cccc-dddd-eeeeeeeeeeee"/>
9+
</producedTypes>
10+
<name>ПланОбмена1</name>
11+
<useStandardCommands>true</useStandardCommands>
12+
<inputByString>ExchangePlan.ПланОбмена1.StandardAttribute.Description</inputByString>
13+
<inputByString>ExchangePlan.ПланОбмена1.StandardAttribute.Code</inputByString>
14+
<fullTextSearchOnInputByString>DontUse</fullTextSearchOnInputByString>
15+
<createOnInput>DontUse</createOnInput>
16+
<dataLockControlMode>Managed</dataLockControlMode>
17+
<fullTextSearch>Use</fullTextSearch>
18+
<codeLength>9</codeLength>
19+
<codeAllowedLength>Variable</codeAllowedLength>
20+
<descriptionLength>25</descriptionLength>
21+
<editType>InDialog</editType>
22+
<choiceMode>BothWays</choiceMode>
23+
</mdclass:ExchangePlan>

src/test/resources/solutions/sol1/Расширение1/src/Configuration/Configuration.mdo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<languageCode>ru</languageCode>
4444
</languages>
4545
<roles>Role.Расш1_ОсновнаяРоль</roles>
46+
<exchangePlans>ExchangePlan.Расш1_ПланОбмена2</exchangePlans>
4647
<constants>Constant.Расш1_Константа1</constants>
4748
<catalogs>Catalog.Расш1_Справочник3</catalogs>
4849
<documents>Document.Документ1</documents>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mdclass:ExchangePlan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:core="http://g5.1c.ru/v8/dt/mcore" xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="b2c3d4e5-f6a7-8901-bcde-f12345678901" thisNode="22222222-3333-4444-5555-666666666666">
3+
<producedTypes>
4+
<objectType typeId="aabbccdd-1111-2222-3333-444444444444" valueTypeId="aabbccdd-5555-6666-7777-888888888888"/>
5+
<refType typeId="aabbccdd-9999-aaaa-bbbb-cccccccccccc" valueTypeId="aabbccdd-dddd-eeee-ffff-000000000000"/>
6+
<selectionType typeId="11223344-1111-2222-3333-444444444444" valueTypeId="11223344-5555-6666-7777-888888888888"/>
7+
<listType typeId="11223344-9999-aaaa-bbbb-cccccccccccc" valueTypeId="11223344-dddd-eeee-ffff-000000000000"/>
8+
<managerType typeId="55667788-1111-2222-3333-444444444444" valueTypeId="55667788-5555-6666-7777-888888888888"/>
9+
</producedTypes>
10+
<name>Расш1_ПланОбмена2</name>
11+
<useStandardCommands>true</useStandardCommands>
12+
<inputByString>ExchangePlan.Расш1_ПланОбмена2.StandardAttribute.Description</inputByString>
13+
<inputByString>ExchangePlan.Расш1_ПланОбмена2.StandardAttribute.Code</inputByString>
14+
<fullTextSearchOnInputByString>DontUse</fullTextSearchOnInputByString>
15+
<createOnInput>DontUse</createOnInput>
16+
<dataLockControlMode>Managed</dataLockControlMode>
17+
<fullTextSearch>Use</fullTextSearch>
18+
<codeLength>9</codeLength>
19+
<codeAllowedLength>Variable</codeAllowedLength>
20+
<descriptionLength>25</descriptionLength>
21+
<editType>InDialog</editType>
22+
<choiceMode>BothWays</choiceMode>
23+
</mdclass:ExchangePlan>

0 commit comments

Comments
 (0)