Skip to content

[releases/28.x][Subscription Billing] Performance: Billing document creation does not scale to large datasets (4M+ subscription lines) - #9847

Open
djukicmilica wants to merge 2 commits into
microsoft:releases/28.xfrom
djukicmilica:bugs/8553-sb-perf-large-datasets-28x
Open

[releases/28.x][Subscription Billing] Performance: Billing document creation does not scale to large datasets (4M+ subscription lines)#9847
djukicmilica wants to merge 2 commits into
microsoft:releases/28.xfrom
djukicmilica:bugs/8553-sb-perf-large-datasets-28x

Conversation

@djukicmilica

@djukicmilica djukicmilica commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Backport of #8553 to releases/28.x

Backports #8553[Bug][SubscriptionBilling]: Performance: Billing document creation does not scale to large datasets (4M+ subscription lines) — to releases/28.x.

Routing analysis (deterministic, per file)

All 14 changed files were classified against real repo state (git cat-file): every file already lives in the BCApps submodule (src/) on the target branch and none exists in NAV App/. Verdict: BCApps only — a same-repo BCApps backport (no src/App/ remap, no NAV changes required).

How it was applied

  • Net PR diff (merge-base ad1c164..PR head) applied onto releases/28.x with git apply --3way in an isolated worktree.
  • 13 of 14 files applied cleanly.
  • One conflict in GenericConnectorProcessing.Codeunit.al was resolved deterministically by cross-referencing the conflict against the commit diff: the PR's begin / this.ProgressTracker.Finish() / end; wrapper was applied on top of the target branch's existing CreateUsageDataBillingFromTempServiceCommitments call. The compact single-argument overload seen in the incoming side only exists on main (an unrelated refactor not present on releases/28.x), so the target branch's long-parameter signature was preserved. Verified with the conflict-resolver's programmatic checker (PASS).

Backported-from: PR #8553.

Fixes
AB#644742

…t scale to large datasets (4M+ subscription lines)

Backport of microsoft#8553 to releases/28.x.

The conflict in GenericConnectorProcessing.Codeunit.al was resolved deterministically:
the PR's begin/ProgressTracker.Finish()/end wrapper was applied on top of the target
branch's existing CreateUsageDataBillingFromTempServiceCommitments signature (the compact
overload only exists on main via an unrelated refactor not present on releases/28.x).

Backported-from: 08c1c85
@djukicmilica
djukicmilica requested a review from a team July 30, 2026 10:29
@djukicmilica
djukicmilica requested a review from a team as a code owner July 30, 2026 10:29
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link.

@github-actions github-actions Bot added the Finance GitHub request for Finance area label Jul 30, 2026
@djukicmilica
djukicmilica enabled auto-merge (squash) July 30, 2026 10:32
@github-actions github-actions Bot added the Linked Issue is linked to a Azure Boards work item label Jul 30, 2026
@github-actions github-actions Bot added this to the Version 28.4 milestone Jul 30, 2026
Comment thread src/Apps/W1/Subscription Billing/App/Base/Codeunits/ProgressTracker.Codeunit.al Outdated
auto-merge was automatically disabled August 2, 2026 21:00

Pull request was closed

@djukicmilica djukicmilica reopened this Aug 2, 2026
@djukicmilica
djukicmilica enabled auto-merge (squash) August 2, 2026 21:01
@github-actions github-actions Bot modified the milestones: Version 28.4, Version 28.5 Aug 2, 2026
auto-merge was automatically disabled August 3, 2026 09:11

Pull request was closed

@djukicmilica djukicmilica reopened this Aug 3, 2026
@djukicmilica
djukicmilica enabled auto-merge (squash) August 3, 2026 09:11
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Request Changes

What this PR does

This backport brings the Subscription Billing scale fixes from PR #8553 to releases/28.x. It adds a reusable progress tracker, adds keys, reduces repeated reads, refreshes only affected Recurring Billing groups, changes commit checkpoints, and updates usage-data billing links in hotter paths.

The scenario is valid and important: the linked bug and GitHub issue describe billing runs with about 4 million subscription lines, long runtimes, missing progress feedback, and full rollback after late failures. The code changes mostly match that root cause, and the release-branch conflict in usage-data billing keeps the releases/28.x method signature. The remaining problem is proof: this is a broad billing and usage-data change, but no test files are included.

Suggestions

S1 - Add functional regression tests
Add or backport tests for proposal creation, document creation, usage-based lines, and the new commit behavior. Verify customer and vendor documents, amounts, document links, and usage-data links. This area is financially sensitive, and the existing Subscription Billing test suites make this feasible.

Risk assessment and necessity

Risk: The regression surface is high because the PR changes billing proposal creation, customer and vendor billing document creation, usage-data billing links, page refresh behavior, added keys, and transaction boundaries. Public table procedures on Usage Data Billing are also made externally callable, so the API surface grows in this release branch. I could not find an [AI-REPRO] ADO comment; the detailed scenario comes from the linked GitHub issue and the copied ADO bug.

Necessity: The change is needed because the current flow does not scale to very large subscription-line datasets and can lose hours of work after a late failure. The scope is reasonable for the reported scale bug, but it needs regression tests before merge because incorrect billing amounts or usage links would be costly.


[AI-PR-REVIEW] version=1 system=github pr=9847 round=1 by=alexei-dobriansky at=2026-08-03T10:08:13Z lastSha=0617284445c976224f8d81111a97b50a50d3379a suggestions=S1

auto-merge was automatically disabled August 3, 2026 12:02

Pull request was closed

@djukicmilica djukicmilica reopened this Aug 3, 2026
@djukicmilica
djukicmilica enabled auto-merge (squash) August 3, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Finance GitHub request for Finance area From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants