Skip to content

Fix AA0217 in BCPT Setup Card test and build System App Modules under strict ruleset#9685

Merged
aholstrup1 merged 3 commits into
mainfrom
aholstrup1-literate-pancake
Jul 23, 2026
Merged

Fix AA0217 in BCPT Setup Card test and build System App Modules under strict ruleset#9685
aholstrup1 merged 3 commits into
mainfrom
aholstrup1-literate-pancake

Conversation

@aholstrup1

@aholstrup1 aholstrup1 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What & why

The internal NAV BuildAppModulesClean validation broke (Bug 643259) with error AA0217: Use a text constant or label for format string in StrSubstNo in BCPTSetupCardTest.Codeunit.al. The offending line used a nested StrSubstNo('%1 or %2', ...) with a literal format string.

This passed on public BCApps CI but failed internally because of a coverage gap: the only public job that compiles under the strict internal.module.ruleset.json (where AA0217 is an error) is System Application Modules (Clean), and that job does not build the Performance Toolkit from source. The Performance Toolkit is only built publicly under Apps W1, which uses base.ruleset.json where AA0217 is downgraded to a warning. So the strict ruleset and the offending file never met in public CI, while the internal build compiles every module under the strict ruleset in one pass.

This PR does two things:

  • Fixes the AA0217 error by moving the inline '%1 or %2' literal into a Locked label (OrValueLbl) and referencing it. Behavior is unchanged.
  • Closes the coverage gap so this class of break is caught in public CI. The System Application Modules AL-Go project now also compiles the monolithic System Application / Business Foundation apps and the Tools apps (Performance Toolkit + tests, AI Test Toolkit, Test Framework libraries, Test Runner) under the strict ruleset, matching what internal BuildAppModulesClean builds. This adds the 16 apps the internal build compiles that the public strict job was missing.

Linked work

AB#643259

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Root-caused the failure from the internal buildappmodulesclean log: BCPTSetupCardTest.Codeunit.al(155,103): error AA0217. Confirmed the culprit is the nested StrSubstNo('%1 or %2', ...) literal, introduced by commit a08aabe (PR Re-enable BCPT Setup Card tests: fix NoOfSqlCallsAreLogged SQL assertion (Bug 618568) #8823).
  • Verified via the public System Application Modules (Clean) job log (run 29968954797) that it compiles 258 modules and never compiles the Performance Toolkit source (0 AA0217 / BCPTSetupCardTest occurrences), vs 274 in the internal build.
  • Change is test-code only (a Locked label swap) plus a build-configuration change; no product behavior change, so no new tests are warranted. The settings change itself is what exercises the fixed test app under the strict ruleset.

Risk & compatibility

  • The settings change intentionally puts Tools/Performance Toolkit/Test (and the other listed apps) under the strict internal.module.ruleset.json in public CI for the first time. If any of these apps carry other latent strict-ruleset violations, this job will now surface them. The known AA0217 offender is fixed in the same PR.
  • No product, upgrade, permission, or telemetry impact. Change is scoped to a single AL-Go project settings file plus one test codeunit.

…under strict ruleset

Replace inline literal format string in nested StrSubstNo with a Locked
label (OrValueLbl) in BCPTSetupCardTest to satisfy AA0217, which is an
error under internal.module.ruleset.json.

Add the monolithic System Application / Business Foundation apps and the
Tools apps (Performance Toolkit, AI Test Toolkit, Test Framework
libraries and Test Runner) to the System Application Modules AL-Go
project so they compile under the strict ruleset, matching the internal
BuildAppModulesClean build.

Copilot-Session: b1498119-78c5-4792-bfb9-f8b791782ab3
@github-actions github-actions Bot added Build: scripts & configs Build scripts and configuration files AL: Tools Integration GitHub request for Integration area labels Jul 23, 2026
@github-actions github-actions Bot modified the milestone: Version 29.0 Jul 23, 2026
Adding the Tools apps to the System Application Modules project ran them
through the project's PreCompileApp execute-permissions check, which is a
public-CI-only guard not present in the internal build. Tools apps (test
framework, performance toolkit, AI test toolkit) are dev/test tooling and
were never subject to this check, so exempt anything under src/Tools while
keeping the guard on System Application and Business Foundation.

Copilot-Session: b1498119-78c5-4792-bfb9-f8b791782ab3
@aholstrup1
aholstrup1 marked this pull request as ready for review July 23, 2026 12:02
@aholstrup1
aholstrup1 requested review from a team July 23, 2026 12:02
spetersenms
spetersenms previously approved these changes Jul 23, 2026
Instead of exempting src/Tools from VerifyExecutePermissions via a
PreCompileApp hook, move the Tools apps (Performance Toolkit, AI Test
Toolkit, Test Framework libraries, Test Runner) into testFolders. They
then compile as appType 'test', so the execute-permissions check (gated
on appType -eq 'app') skips them naturally, matching the internal build
which treats everything under Tools as a test module.

No app-type System Application or Business Foundation module depends on
the moved apps, so nothing in this job breaks. Reverts the earlier
PreCompileApp.ps1 change.

Copilot-Session: b1498119-78c5-4792-bfb9-f8b791782ab3
@aholstrup1
aholstrup1 disabled auto-merge July 23, 2026 20:28
@aholstrup1
aholstrup1 merged commit 79c35a9 into main Jul 23, 2026
157 of 382 checks passed
@aholstrup1
aholstrup1 deleted the aholstrup1-literate-pancake branch July 23, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Tools Build: scripts & configs Build scripts and configuration files Integration GitHub request for Integration area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants