Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dataset/bcbench.jsonl

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions dataset/problemstatement/microsoft__BCApps-7070/README.md
Comment thread
alexei-dobriansky marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Customer cannot be changed on a contract with closed subscription lines

## Describe the issue

When a customer contract contains closed subscription lines—lines marked as **Closed = Yes** after invoicing past their end date—changing the **Sell-to Customer** or **Bill-to Customer** on the contract header fails with a blocking error.

This is inconsistent with terminated lines that are not closed (**Closed = No**), which allow the customer to be changed. Users must otherwise reopen each closed line, change the customer, and close every line again.

## Expected behavior

Changing the Sell-to or Bill-to customer on a contract header succeeds regardless of whether closed subscription lines exist. Terminated lines with **Closed = Yes** and **Closed = No** behave identically for a header-level customer change.

## Steps to reproduce

1. Create a customer contract with at least one subscription or contract line.
2. Set the **Subscription Line End Date** to a date in the past, for example `31 January 2026`.
3. Invoice the line fully through its end date.
4. Run **Update Subscription Line Dates**.
5. Verify that the contract line is marked **Closed = Yes** and moved to **Closed Lines**.
6. Change the **Sell-to Customer** or **Bill-to Customer** on the contract header.

The change is blocked with this error:

> Subscription Lines for closed contract lines may not be edited. Remove the "Finished" indicator in the contract to be able to edit the Subscription Line.
10 changes: 9 additions & 1 deletion scripts/BCBenchUtils.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ function Get-RepoCloneInfo {
return @{
Url = 'https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_git/NAV'
Token = $env:ADO_TOKEN
SparseCheckoutPaths = @('App/Apps', 'App/Layers')
SparseCheckoutPaths = @('App/Apps', 'App/Internal/Apps', 'App/Layers')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The rebase went wrong?

}
}
}
Expand Down Expand Up @@ -544,6 +544,14 @@ function Get-BCBenchArtifactConfig {

if ($Country -ne 'w1') { throw "Approved BC artifacts are only configured for w1, not $Country." }

[hashtable] $pinnedInsiderUrls = @{
'29.0' = 'https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.54011.55007/w1'
'30.0' = 'https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/30.0.55015.0/w1'
}
Comment on lines +547 to +550

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oops, my PR went in first, this is now changed to a json file

if ($pinnedInsiderUrls.ContainsKey($Version)) {
return @{ artifactUrl = $pinnedInsiderUrls[$Version]; accept_insiderEula = $true }
}

[hashtable] $pinnedUrls = @{
'24.0' = 'https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.0.16410.31330/w1'
'24.2' = 'https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.2.20227.31325/w1'
Expand Down
4 changes: 2 additions & 2 deletions scripts/Download-BCSymbols.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Write-Log "Resolved BC version $version for InstanceId $InstanceId" -Level Info

Import-Module BcContainerHelper -Force -DisableNameChecking

[string] $artifactUrl = Get-BCArtifactUrl -version $version -country $Country -select 'Latest'
if (-not $artifactUrl) { throw "No BC artifact URL resolved for version $version ($Country)" }
[hashtable] $artifactConfig = Get-BCBenchArtifactConfig -Category $Category -Version $version -Country $Country
[string] $artifactUrl = $artifactConfig.artifactUrl
Write-Log "Downloading artifact: $artifactUrl" -Level Info

$paths = Download-Artifacts -artifactUrl $artifactUrl -includePlatform
Expand Down
52 changes: 52 additions & 0 deletions tests/test_artifact_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import json
import shutil
import subprocess
from pathlib import Path

import pytest

ROOT = Path(__file__).parent.parent
UTILS_MODULE = ROOT / "scripts" / "BCBenchUtils.psm1"


def get_artifact_config(category: str, version: str) -> dict[str, object]:
pwsh = shutil.which("pwsh")
if not pwsh:
pytest.skip("PowerShell is required")

command = f"Import-Module '{UTILS_MODULE}' -Force -DisableNameChecking; Get-BCBenchArtifactConfig -Category '{category}' -Version '{version}' | ConvertTo-Json -Compress"
result = subprocess.run(
[pwsh, "-NoProfile", "-Command", command],
capture_output=True,
text=True,
encoding="utf-8",
check=True,
)
return json.loads(result.stdout)


def test_released_bug_fix_uses_pinned_artifact():
assert get_artifact_config("bug-fix", "27.2") == {
"accept_insiderEula": False,
"artifactUrl": "https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.2.42879.54576/w1",
}


@pytest.mark.parametrize(
("version", "url"),
[
("29.0", "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/29.0.54011.55007/w1"),
("30.0", "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/30.0.55015.0/w1"),
],
)
def test_insider_bug_fix_uses_pinned_artifact(version: str, url: str):
assert get_artifact_config("bug-fix", version) == {
"accept_insiderEula": True,
"artifactUrl": url,
}


def test_setup_paths_cover_internal_apps():
utils_module = UTILS_MODULE.read_text(encoding="utf-8")

assert "'App/Internal/Apps'" in utils_module
Loading