From 1ce5a4fab6a2757675716e10ec8ec4ca1cd80bb9 Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Mon, 20 Oct 2025 15:56:56 +0200 Subject: [PATCH 1/2] try to add microsoftInternal__NAV-217357 --- dataset/bcbench_nav.jsonl | 1 + src/bcbench/collection/collect_nav.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index e5aedfa1b..b72d13f5f 100644 --- a/dataset/bcbench_nav.jsonl +++ b/dataset/bcbench_nav.jsonl @@ -1,3 +1,4 @@ {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-210528", "base_commit": "1a672853b5e939932b2b9caff994bef826e928ff", "created_at": "2025-03-19", "environment_setup_version": "26.5", "project_paths": ["App\\Apps\\W1\\Sustainability\\app", "App\\Apps\\W1\\Sustainability\\test"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 148187, "functionName": ["VerifyEmissionFieldsMustBeEnabledWhenEnableValueChainTrackingIsEnabled"]}], "PASS_TO_PASS": [], "problem_statement": "Title: W1 2025 - Bug Bash IV [Sustainability] Value Chain Tracking Enablement\nRepro Steps:\nOpen the Sustainability Setup page Keep all fields in the Procurement FastTab disabled Enable the 'Enable Value Chain Tracking' field ===RESULT=== Only the 'Enable Value Chain Tracking' field has been enabled ===EXTECTED RESULT=== Enabling this field, it will also enable the following fields if they are not previously enabled: Use Emissions in Purchase Documents Item Emissions Resource Emissions Work/Machine Center Emissions\nDescription:\nThis is small improvement. You cannot use Value Chain tracking enabled if you didn't previously enable the following options: Use Emissions in Purchase Documents Item Emissions Resource Emissions Work/Machine Center Emissions So, just enable them when you enable the Enable Value Chain Tracking field if these fields are not previously already enabled.\n", "test_patch": "diff --git a/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al b/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al\nindex ff9b7640fa2..07bfdfa1233 100644\n--- a/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al\n+++ b/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al\n@@ -5123,6 +5123,47 @@ codeunit 148187 \"Sust. Certificate Test\"\n // [THEN] Confirmation Box should not pop up as there is no confirm Handler. \n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerYes')]\n+ procedure VerifyEmissionFieldsMustBeEnabledWhenEnableValueChainTrackingIsEnabled()\n+ var\n+ SustainabilitySetup: Record \"Sustainability Setup\";\n+ begin\n+ // [SCENARIO 569462] Verify \"Use Emissions In Purch. Doc.\", \"Item Emissions\", \"Resource Emissions\", \"Work/Machine Center Emissions\" must be enabled in Sustainability Setup.\n+ // When \"Enable Value Chain Tracking\" is enabled.\n+ LibrarySustainability.CleanUpBeforeTesting();\n+\n+ // [GIVEN] Update Sustainability Setup.\n+ SustainabilitySetup.Get();\n+ SustainabilitySetup.Validate(\"Use Emissions In Purch. Doc.\", false);\n+ SustainabilitySetup.Validate(\"Item Emissions\", false);\n+ SustainabilitySetup.Validate(\"Resource Emissions\", false);\n+ SustainabilitySetup.Validate(\"Work/Machine Center Emissions\", false);\n+ SustainabilitySetup.Validate(\"Enable Value Chain Tracking\", false);\n+ SustainabilitySetup.Modify();\n+\n+ // [WHEN] \"Enable Value Chain Tracking\" set to true in Sustainability Setup.\n+ SustainabilitySetup.Validate(\"Enable Value Chain Tracking\", true);\n+\n+ // [THEN] Verify \"Use Emissions In Purch. Doc.\", \"Item Emissions\", \"Resource Emissions\", \"Work/Machine Center Emissions\" must be enabled in Sustainability Setup.\n+ Assert.AreEqual(\n+ true,\n+ SustainabilitySetup.\"Use Emissions In Purch. Doc.\",\n+ StrSubstNo(FieldShouldBeEnabledErr, SustainabilitySetup.FieldCaption(\"Use Emissions In Purch. Doc.\"), SustainabilitySetup.TableCaption()));\n+ Assert.AreEqual(\n+ true,\n+ SustainabilitySetup.\"Item Emissions\",\n+ StrSubstNo(FieldShouldBeEnabledErr, SustainabilitySetup.FieldCaption(\"Item Emissions\"), SustainabilitySetup.TableCaption()));\n+ Assert.AreEqual(\n+ true,\n+ SustainabilitySetup.\"Resource Emissions\",\n+ StrSubstNo(FieldShouldBeEnabledErr, SustainabilitySetup.FieldCaption(\"Resource Emissions\"), SustainabilitySetup.TableCaption()));\n+ Assert.AreEqual(\n+ true,\n+ SustainabilitySetup.\"Work/Machine Center Emissions\",\n+ StrSubstNo(FieldShouldBeEnabledErr, SustainabilitySetup.FieldCaption(\"Work/Machine Center Emissions\"), SustainabilitySetup.TableCaption()));\n+ end;\n+\n local procedure CreateSustainabilityAccount(var AccountCode: Code[20]; var CategoryCode: Code[20]; var SubcategoryCode: Code[20]; i: Integer): Record \"Sustainability Account\"\n begin\n CreateSustainabilitySubcategory(CategoryCode, SubcategoryCode, i);\n", "patch": "diff --git a/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al b/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al\nindex 335c0099f4a..bf9281c17f7 100644\n--- a/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al\n+++ b/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al\n@@ -151,6 +151,8 @@ table 6217 \"Sustainability Setup\"\n if Rec.\"Enable Value Chain Tracking\" then\n if not ConfirmManagement.GetResponseOrDefault(ConfirmEnableValueChainTrackingQst, false) then\n Error('');\n+\n+ EnableEmissionsWhenValueChainTrackingIsEnabled();\n end;\n }\n }\n@@ -188,6 +190,17 @@ table 6217 \"Sustainability Setup\"\n exit(\"Enable Value Chain Tracking\");\n end;\n \n+ local procedure EnableEmissionsWhenValueChainTrackingIsEnabled()\n+ begin\n+ if not Rec.\"Enable Value Chain Tracking\" then\n+ exit;\n+\n+ Rec.Validate(\"Use Emissions In Purch. Doc.\", true);\n+ Rec.Validate(\"Item Emissions\", true);\n+ Rec.Validate(\"Resource Emissions\", true);\n+ Rec.Validate(\"Work/Machine Center Emissions\", true);\n+ end;\n+\n internal procedure GetFormat(FieldNo: Integer): Text\n begin\n GetSustainabilitySetup();\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-211710", "base_commit": "f787c24e811a24e4bd5a2d987ea406b3d2fe6ad0", "created_at": "2025-03-31", "environment_setup_version": "26.5", "project_paths": ["App\\Apps\\W1\\Shopify\\app", "App\\Apps\\W1\\Shopify\\test"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 139648, "functionName": ["UnitTestSuggestShopifyPaymentsFailedTransaction"]}], "PASS_TO_PASS": [{"codeunitID": 139648, "functionName": ["UnitTestSuggestShopifyPaymentsOneTransaction", "UnitTestSuggestShopifyPaymentsMultipleTransactions"]}], "problem_statement": "Title: [Shopify] Suggest payments matches non-success (pending, failed...) transactions\nRepro Steps:\n\nDescription:\n\n", "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\nindex d4318405610..cf234743596 100644\n--- a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n@@ -32,7 +32,7 @@ codeunit 139648 \"Shpfy Suggest Payment Test\"\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n \n // [GIVEN] Shopify transaction is imported\n- CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale);\n+ CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n \n // [WHEN] Create Shopify transactions are run\n OrderTransaction.FindFirst();\n@@ -65,8 +65,8 @@ codeunit 139648 \"Shpfy Suggest Payment Test\"\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n \n // [GIVEN] Shopify transactions are imported\n- CreateOrderTransaction(OrderId, Amount * 0.75, 'manual', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale);\n+ CreateOrderTransaction(OrderId, Amount * 0.75, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n \n // [WHEN] Create Shopify transactions are run\n OrderTransaction.SetRange(\"Shopify Order Id\", OrderId);\n@@ -86,6 +86,45 @@ codeunit 139648 \"Shpfy Suggest Payment Test\"\n until SuggestPayment.Next() = 0;\n end;\n \n+ [HandlerFunctions('SuggestShopifyPaymentsRequestPageHandler')]\n+ [Test]\n+ procedure UnitTestSuggestShopifyPaymentsFailedTransaction()\n+ var\n+ Item: Record Item;\n+ Customer: Record Customer;\n+ OrderTransaction: Record \"Shpfy Order Transaction\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ CashReceiptJournal: TestPage \"Cash Receipt Journal\";\n+ OrderId: BigInteger;\n+ SuccessTransactionId: BigInteger;\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO] Suggest Shopify payments does not create Cash Receipt Journal lines for failed transactions\n+ // [GIVEN] Invoice is posted\n+ Initialize();\n+ Amount := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(10000, 99999);\n+ CreateItem(Item, Amount);\n+ LibrarySales.CreateCustomer(Customer);\n+ CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n+\n+ // [GIVEN] One failed one success Shopify transaction is imported\n+ CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Failure);\n+ SuccessTransactionId := CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ Commit();\n+\n+ // [WHEN] Report is run\n+ CashReceiptJournal.OpenView();\n+ CashReceiptJournal.SuggestShopifyPayments.Invoke();\n+\n+ // [THEN] Only one Cash Receipt Journal line is created\n+ GenJournalLine.SetRange(\"Document Type\", GenJournalLine.\"Document Type\"::Payment);\n+ GenJournalLine.SetRange(\"Account No.\", Customer.\"No.\");\n+ LibraryAssert.RecordCount(GenJournalLine, 1);\n+ GenJournalLine.FindFirst();\n+ LibraryAssert.AreEqual(GenJournalLine.\"Shpfy Transaction Id\", SuccessTransactionId, 'Transaction Ids should match');\n+ end;\n+\n [HandlerFunctions('SuggestShopifyPaymentsRequestPageHandler')]\n [Test]\n procedure UnitTestSuggestShopifyPaymentsJournalLines()\n@@ -114,10 +153,10 @@ codeunit 139648 \"Shpfy Suggest Payment Test\"\n CreateAndPostSalesInvoice(Item, Customer, 2, OrderId3);\n \n // [GIVEN] Shopify transactions are imported\n- CreateOrderTransaction(OrderId1, Amount, 'manual', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId2, Amount * 0.75, 'manual', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId2, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId3, Amount * 2, 'bogus', OrderTransaction.Type::Sale);\n+ CreateOrderTransaction(OrderId1, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId2, Amount * 0.75, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId2, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId3, Amount * 2, 'bogus', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n Commit();\n \n // [WHEN] Report is run\n@@ -154,7 +193,7 @@ codeunit 139648 \"Shpfy Suggest Payment Test\"\n CreateAndPostSalesCreditMemo(Item, Customer, 1, RefundId);\n \n // [GIVEN] Shopify transaction is imported\n- CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Refund);\n+ CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Refund, OrderTransaction.Status::Success);\n \n // [WHEN] Create Shopify transactions are run\n OrderTransaction.FindFirst();\n@@ -210,7 +249,7 @@ codeunit 139648 \"Shpfy Suggest Payment Test\"\n Item.Modify(true);\n end;\n \n- local procedure CreateOrderTransaction(OrderId: BigInteger; Amount: Decimal; Gateway: Code[20]; TransactionType: Enum \"Shpfy Transaction Type\")\n+ local procedure CreateOrderTransaction(OrderId: BigInteger; Amount: Decimal; Gateway: Code[20]; TransactionType: Enum \"Shpfy Transaction Type\"; Status: Enum \"Shpfy Transaction Status\"): BigInteger\n var\n OrderTransaction: Record \"Shpfy Order Transaction\";\n begin\n@@ -219,7 +258,9 @@ codeunit 139648 \"Shpfy Suggest Payment Test\"\n OrderTransaction.Amount := Amount;\n OrderTransaction.Gateway := Gateway;\n OrderTransaction.Type := TransactionType;\n+ OrderTransaction.Status := Status;\n OrderTransaction.Insert();\n+ exit(OrderTransaction.\"Shopify Transaction Id\");\n end;\n \n local procedure CreateRefund(OrderId: BigInteger; RefundId: BigInteger; Amount: Decimal)\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\nindex 773ba116023..274900e6ee5 100644\n--- a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n+++ b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n@@ -17,7 +17,7 @@ report 30118 \"Shpfy Suggest Payments\"\n dataitem(OrderTransaction; \"Shpfy Order Transaction\")\n {\n RequestFilterFields = \"Created At\";\n- DataItemTableView = sorting(Type) where(Type = filter(Capture | Sale | Refund));\n+ DataItemTableView = sorting(Type) where(Type = filter(Capture | Sale | Refund), Status = filter(Success));\n \n trigger OnAfterGetRecord()\n begin\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-224668", "base_commit": "e99adb71b2355dc29eb398ab9ae0d59003a84d5d", "created_at": "2025-08-25", "environment_setup_version": "27.0", "project_paths": ["App\\Apps\\W1\\EssentialBusinessHeadlines\\app", "App\\Apps\\W1\\EssentialBusinessHeadlines\\test"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 139600, "functionName": ["TestHeadlineCanBeHidden"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [Headlines] Certain headlines are not hidden because the record Get fails while attempting to set visibility field to false\nRepro Steps:\nHeadlines are always created with a headline name + user security id as seen below.\nif not Get(HeadlineName, UserSecurityId()) then begin\n Init();\n Validate(\"Headline Name\", HeadlineName);\n Validate(\"User Id\", UserSecurityId());\n if not Insert() then exit;\nend;\nwhen a headline fx Overdue invoices are suppose to be hidden, when it tries to find the headline, it does not append the user security id to the Get(, ). It only uses Get() which will always fail.This does not error out because the error is trapped with a if/else\n in EssentialBusHeadlineMgt.Codeunit.al `if EssentialBusinessHeadline.Get(HeadlineName) then begin`\nDescription:\n\n", "test_patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\nindex db731e8675d..fb82838356c 100644\n--- a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n@@ -700,6 +700,33 @@ codeunit 139600 \"Test Essential Bus. Headlines\"\n TestRecentlyOverdueInvoiceWithOverdueInvoices(5);\n end;\n \n+ [Test]\n+ procedure TestHeadlineCanBeHidden()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ begin\n+ // [GIVEN] Initial state when no data is present\n+ Initialize();\n+\n+ // [GIVEN] One invoice that was due yesterday\n+ CreateInvoicesWithDueDateYesterday(1);\n+\n+ // [WHEN] Run the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] Recently overdue invoices headline is visible\n+ Assert.IsTrue(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be visible');\n+\n+ // [WHEN] Simulate no more overdue invoices by deleting all customer ledger entries\n+ CustLedgerEntry.DeleteAll();\n+\n+ // [WHEN] Recompute the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] The headline is hidden\n+ Assert.IsFalse(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be not visible after recompute');\n+ end;\n+\n local procedure TestRecentlyOverdueInvoiceWithOverdueInvoices(NumberOfNewlyOverdueInvoices: Integer)\n var\n OverdueInvoicesTxt: Text;\n", "patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\nindex 831aa80efcd..10436a095d8 100644\n--- a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n@@ -677,7 +677,7 @@ codeunit 1437 \"Essential Bus. Headline Mgt.\"\n var\n EssentialBusinessHeadline: Record \"Ess. Business Headline Per Usr\";\n begin\n- if EssentialBusinessHeadline.Get(HeadlineName) then begin\n+ if EssentialBusinessHeadline.Get(HeadlineName, UserSecurityId()) then begin\n EssentialBusinessHeadline.Validate(\"Headline Visible\", false);\n EssentialBusinessHeadline.Modify();\n end;\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-217357", "base_commit": "edf1235f9da52aff2f8f6a9f70ed59fb5f66cb5e", "created_at": "2025-06-04", "environment_setup_version": "26.2", "project_paths": ["App\\Apps\\W1\\Shopify\\app", "App\\Apps\\W1\\Shopify\\test"], "hints_text": "", "FAIL_TO_PASS": [], "PASS_TO_PASS": [{"codeunitID": 139567, "functionName": ["UnitTestCreateItemSKUIsItemNo"]}], "problem_statement": "Title: Shopify - unexpected Item Variant created for Default Variant\nRepro Steps:\ncreate product in Shopify (just title). No variants. No SKUs Configure sync \"From Shopify\". Auto Create Unknown Items = True Item Template - some template (I use ITEM) SKU Mapping = Variant Code Run sync. Explore Shopify Products/ Shopify Variants in BC. You can see that new item created using Item No Series. But also there is Item Variant \"V_001\" for default title. Expected - don't create item variant at all. If SKU is populate in Product in Shopify then instead of \"V_001\" it will use value from SKU. I don't think we need to create item variant in this case either as this is not a real variant.\nDescription:\n\n", "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al b/App/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al\nindex f43666b463b..11bdcf3eb64 100644\n--- a/App/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al\n@@ -17,6 +17,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n Shop: Record \"Shpfy Shop\";\n ShopifyProduct: Record \"Shpfy Product\";\n ShopifyVariant: Record \"Shpfy Variant\";\n+ ItemTempl: Record \"Item Templ.\";\n ProductInitTest: Codeunit \"Shpfy Product Init Test\";\n InitializeTest: Codeunit \"Shpfy Initialize Test\";\n begin\n@@ -38,7 +39,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item SystemId\"), 'Item SystemId <> NullGuid');\n LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n \n- // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Varaint SystemId\" must be a null guid value.\n+ // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Variant SystemId\" must be a null guid value.\n LibraryAssert.IsTrue(IsNullGuid(ShopifyVariant.\"Item Variant SystemId\"), 'Item Variant System Id = NullGuid');\n \n // [THEN] Check Item fields\n@@ -47,6 +48,8 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.AreEqual(CopyStr(ShopifyProduct.Title, 1, MaxStrLen(Item.Description)), Item.Description, 'Description');\n LibraryAssert.AreEqual(ShopifyVariant.\"Unit Cost\", Item.\"Unit Cost\", 'Unit Cost');\n LibraryAssert.AreEqual(ShopifyVariant.Price, Item.\"Unit Price\", 'Unit Price');\n+ ItemTempl.Get(Shop.\"Item Templ. Code\");\n+ LibraryAssert.AreEqual(ItemTempl.\"Costing Method\", Item.\"Costing Method\", 'Item.\"Costing Method\" = ItemTempl.\"Costing Method\"');\n end;\n \n [Test]\n@@ -89,7 +92,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item SystemId\"), 'Item SystemId <> NullGuid');\n LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n \n- // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Varaint SystemId\" must be a null guid value.\n+ // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Variant SystemId\" must be a null guid value.\n LibraryAssert.IsTrue(IsNullGuid(ShopifyVariant.\"Item Variant SystemId\"), 'Item Variant System Id = NullGuid');\n \n // [THEN] Check Item fields\n@@ -135,7 +138,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item SystemId\"), 'Item SystemId <> NullGuid');\n LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n \n- // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Varaint SystemId\" filled in and then \"Item Variant\" record must exist..\n+ // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Variant SystemId\" filled in and then \"Item Variant\" record must exist..\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item Variant SystemId\"), 'Item Variant System Id <> NullGuid');\n LibraryAssert.IsTrue(ItemVariant.GetBySystemId(ShopifyVariant.\"Item Variant SystemId\"), 'Get Item Variant');\n \n@@ -146,12 +149,12 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.AreEqual(ShopifyVariant.\"Unit Cost\", Item.\"Unit Cost\", 'Unit Cost');\n LibraryAssert.AreEqual(ShopifyVariant.Price, Item.\"Unit Price\", 'Unit Price');\n \n- // [THEN] The 'Item Varaint\".Code must be equal to the variant part of the SKU.\n+ // [THEN] The 'Item Variant\".Code must be equal to the variant part of the SKU.\n LibraryAssert.AreEqual(ShopifyVariant.SKU.ToUpper().Split(Shop.\"SKU Field Separator\").Get(2), ItemVariant.Code, '\"Item Variant\".Code.\" = SKU.Spilt(Shop.\"SKU Field Separator\")[2]');\n end;\n \n [Test]\n- procedure UnitTestCreateItemSKUIsItemNoAndVaraintCodeFromProductWithMultiVariants()\n+ procedure UnitTestCreateItemSKUIsItemNoAndVariantCodeFromProductWithMultiVariants()\n var\n Item: Record Item;\n ItemVariant: Record \"Item Variant\";\n@@ -184,7 +187,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item SystemId\"), 'Item SystemId <> NullGuid');\n LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n \n- // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Varaint SystemId\" filled in and then \"Item Variant\" record must exist..\n+ // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Variant SystemId\" filled in and then \"Item Variant\" record must exist..\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item Variant SystemId\"), 'Item Variant System Id <> NullGuid');\n LibraryAssert.IsTrue(ItemVariant.GetBySystemId(ShopifyVariant.\"Item Variant SystemId\"), 'Get Item Variant');\n \n@@ -197,14 +200,14 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.AreEqual(ShopifyVariant.Price, Item.\"Unit Price\", 'Unit Price');\n end;\n \n- // [THEN] The 'Item Varaint\".Code must be equal to the variant part of the SKU.\n+ // [THEN] The 'Item Variant\".Code must be equal to the variant part of the SKU.\n LibraryAssert.AreEqual(ShopifyVariant.SKU.ToUpper().Split(Shop.\"SKU Field Separator\").Get(2), ItemVariant.Code, '\"Item Variant\".Code.\" = SKU.Spilt(Shop.\"SKU Field Separator\")[2]');\n until ShopifyVariant.Next() = 0;\n end;\n end;\n \n [Test]\n- procedure UnitTestCreateItemSKUIsVaraintCode()\n+ procedure UnitTestCreateItemSKUIsVariantCode()\n var\n Item: Record Item;\n ItemVariant: Record \"Item Variant\";\n@@ -232,7 +235,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item SystemId\"), 'Item SystemId <> NullGuid');\n LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n \n- // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Varaint SystemId\" filled in and then \"Item Variant\" record must exist..\n+ // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Variant SystemId\" filled in and then \"Item Variant\" record must exist..\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item Variant SystemId\"), 'Item Variant System Id <> NullGuid');\n LibraryAssert.IsTrue(ItemVariant.GetBySystemId(ShopifyVariant.\"Item Variant SystemId\"), 'Get Item Variant');\n \n@@ -242,12 +245,12 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.AreEqual(ShopifyVariant.\"Unit Cost\", Item.\"Unit Cost\", 'Unit Cost');\n LibraryAssert.AreEqual(ShopifyVariant.Price, Item.\"Unit Price\", 'Unit Price');\n \n- // [THEN] The 'Item Varaint\".Code must be equal to the SKU.\n+ // [THEN] The 'Item Variant\".Code must be equal to the SKU.\n LibraryAssert.AreEqual(ShopifyVariant.SKU.ToUpper(), ItemVariant.Code, '\"Item Variant\".Code\" = SKU');\n end;\n \n [Test]\n- procedure UnitTestCreateItemSKUIsVaraintCodeFromProductWithMultiVariants()\n+ procedure UnitTestCreateItemSKUIsVariantCodeFromProductWithMultiVariants()\n var\n Item: Record Item;\n ItemVariant: Record \"Item Variant\";\n@@ -278,7 +281,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item SystemId\"), 'Item SystemId <> NullGuid');\n LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n \n- // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Varaint SystemId\" filled in and then \"Item Variant\" record must exist..\n+ // [THEN] On the \"Shpfy Variant\" record, the field \"ITem Variant SystemId\" filled in and then \"Item Variant\" record must exist..\n LibraryAssert.IsFalse(IsNullGuid(ShopifyVariant.\"Item Variant SystemId\"), 'Item Variant System Id <> NullGuid');\n LibraryAssert.IsTrue(ItemVariant.GetBySystemId(ShopifyVariant.\"Item Variant SystemId\"), 'Get Item Variant');\n \n@@ -286,7 +289,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n ShopifyProduct.Get(ShopifyVariant.\"Product Id\");\n LibraryAssert.AreEqual(CopyStr(ShopifyProduct.Title, 1, MaxStrLen(Item.Description)), Item.Description, 'Description');\n \n- // [THEN] The 'Item Varaint\".Code must be equal to the SKU.\n+ // [THEN] The 'Item Variant\".Code must be equal to the SKU.\n LibraryAssert.AreEqual(ShopifyVariant.SKU.ToUpper(), ItemVariant.Code, '\"Item Variant\".Code\" = SKU');\n until ShopifyVariant.Next() = 0;\n end;\ndiff --git a/App/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al b/App/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al\nindex 857ba48ef6f..4e0e90690d6 100644\n--- a/App/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al\n@@ -296,7 +296,7 @@ codeunit 139603 \"Shpfy Product Init Test\"\n ShopifyProduct: Record \"Shpfy Product\";\n begin\n ShopifyProduct := InitProduct(Shop);\n- ShopifyProduct.\"Has Variants\" := (Shop.\"SKU Mapping\" = Enum::\"Shpfy SKU Mapping\"::\"Item No. + Variant Code\");\n+ ShopifyProduct.\"Has Variants\" := Shop.\"SKU Mapping\" in [Enum::\"Shpfy SKU Mapping\"::\"Item No. + Variant Code\", Enum::\"Shpfy SKU Mapping\"::\"Variant Code\"];\n ShopifyProduct.Insert();\n Clear(LastItemNo);\n exit(AddProductVariants(Shop, ShopifyProduct, Any.IntegerInRange(2, 5)));\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\nindex 54aaadb63fa..964d42376db 100644\n--- a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\n+++ b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\n@@ -107,7 +107,7 @@ codeunit 30171 \"Shpfy Create Item\"\n ItemNo: Text;\n VariantCode: Text;\n begin\n- if (not ShopifyProduct.\"Has Variants\" and not (Shop.\"SKU Mapping\" = Shop.\"SKU Mapping\"::\"Variant Code\")) or ((ShopifyVariant.\"UoM Option Id\" = 1) and (ShopifyVariant.\"Option 2 Name\" = '')) then begin\n+ if (not ShopifyProduct.\"Has Variants\") or ((ShopifyVariant.\"UoM Option Id\" = 1) and (ShopifyVariant.\"Option 2 Name\" = '')) then begin\n Clear(ItemVariant);\n CreateReferences(ShopifyProduct, ShopifyVariant, Item, ItemVariant);\n if IsNullGuid(ShopifyVariant.\"Item SystemId\") then begin\n@@ -244,6 +244,7 @@ codeunit 30171 \"Shpfy Create Item\"\n ItemNo := CopyStr(Code, 1, MaxStrLen(ItemNo));\n end;\n end;\n+ Clear(Item.\"No.\");\n Clear(Item.\"Item Category Code\");\n Clear(Item.\"Base Unit of Measure\");\n CreateItemFromTemplate(Item, CurrentTemplateCode, ItemNo);\n@@ -318,13 +319,14 @@ codeunit 30171 \"Shpfy Create Item\"\n begin\n if not ItemTempl.Get(ItemTemplCode) then\n exit;\n+\n if ItemNo <> '' then\n Item.\"No.\" := ItemNo\n else\n ItemTemplMgt.InitItemNo(Item, ItemTempl);\n \n Item.Insert(true);\n- ItemTemplMgt.ApplyItemTemplate(Item, ItemTempl);\n+ ItemTemplMgt.ApplyItemTemplate(Item, ItemTempl, true);\n end;\n \n /// \n"} diff --git a/src/bcbench/collection/collect_nav.py b/src/bcbench/collection/collect_nav.py index 92bd7b00f..8872f5489 100644 --- a/src/bcbench/collection/collect_nav.py +++ b/src/bcbench/collection/collect_nav.py @@ -107,8 +107,21 @@ def get_work_item_info(pr_data: Dict[str, Any]) -> Dict[str, Any]: response = requests.get(work_item_url, headers=_get_headers()) response.raise_for_status() return response.json() + elif work_item_ref.get("count", 0) > 1: + logger.info("Multiple work items found. Please select one:") + for idx, item in enumerate(work_item_ref["value"], 1): + logger.info(f"{idx}. Work Item #{item.get('id')} - {item.get('url')}") - raise ValueError("Work item reference count is not 1.") + choice: int = typer.prompt("Enter the number of the work item to use", type=int) + if choice < 1 or choice > len(work_item_ref["value"]): + raise ValueError("Invalid selection.") + + work_item_url = work_item_ref["value"][choice - 1]["url"] + response = requests.get(work_item_url, headers=_get_headers()) + response.raise_for_status() + return response.json() + + raise ValueError("No work items found in the reference.") def collect_dataset_entry(pr_number: int) -> DatasetEntry: From b1eaec4558d23ac193bdb535ab3f6c95d81e0b34 Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Mon, 20 Oct 2025 16:00:22 +0200 Subject: [PATCH 2/2] fix log grouping when no tests are run --- scripts/powershell/AppUtils.psm1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/powershell/AppUtils.psm1 b/scripts/powershell/AppUtils.psm1 index b18cbf602..9324c5331 100644 --- a/scripts/powershell/AppUtils.psm1 +++ b/scripts/powershell/AppUtils.psm1 @@ -209,6 +209,10 @@ function Invoke-DatasetTests { if ($testEntries.Count -eq 0) { Write-Log "No test entries provided, skipping test execution" -Level Warning + + if ($env:CI) { + Write-Output "::endgroup::" + } return }