Complete AL review knowledge readiness (#108)
Some checks failed
Validate knowledge index / validate-index (push) Has been cancelled
Validate AL review fixtures / validate-review-fixtures (push) Has been cancelled
Validate frontmatter and structure / validate (push) Has been cancelled

* Complete AL review knowledge readiness

Fill telemetry and Query coverage, strengthen thin review domains, correct audited content defects, and add deterministic cheap-model evaluation and reference-integrity safeguards.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9825b012-e653-496a-9310-c1f4b6f8ac27

* Generalize review fixture discovery

Derive smoke cases from the leaf, domain, and paired-sample conventions so new leaves require no scoring-contract changes. Keep only exceptional selection/context overrides and fail when retrieval metadata cannot rank the selected article.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9825b012-e653-496a-9310-c1f4b6f8ac27

* Preserve published field IDs in sample

Keep the existing Email and Contact Email field IDs unchanged, clarify that the sample represents an independent baseline, and use a local breaking-change rule for the generic smoke evaluation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9825b012-e653-496a-9310-c1f4b6f8ac27

* Clarify published field identity rules

State explicitly that a published field keeps its ID, name, and type while a replacement is added as a separate field under an unused ID.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9825b012-e653-496a-9310-c1f4b6f8ac27

* Align field obsoletion sample baselines

Use Email field ID 3 as the shared baseline so the bad example demonstrates a same-ID rename while the good example retains the original field and adds a separate replacement.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9825b012-e653-496a-9310-c1f4b6f8ac27

---------

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
This commit is contained in:
Jesper Schulz-Wedde 2026-07-15 10:55:25 +02:00 committed by GitHub
parent ae04938c03
commit 186d8a1314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
105 changed files with 2229 additions and 212 deletions

View file

@ -15,7 +15,7 @@ Error method trace telemetry includes the AL error string only when the first `E
## Best Practice
Declare the complete message as a `Label` or `TextConst` and pass it directly to `Error`, followed by substitution values. The client receives the formatted message while telemetry can retain the static message template without using the dynamic values as its message. See `error-direct-substitution-safe-for-telemetry.md`.
Declare the complete message as a `Label` or `TextConst` and pass it directly to `Error`, followed by substitution values. The client receives the formatted message while telemetry retains the static message template without using the dynamic values as its message. Independently review whether each substitution value is appropriate to show to the current user.
See sample: `avoid-strsubstno-prebuild-before-error.good.al`.

View file

@ -1,10 +0,0 @@
codeunit 50205 "Privacy Sample Direct Error"
{
procedure ValidateCustomer(var Customer: Record Customer)
var
InvalidEmailErr: Label 'Customer %1 has an invalid e-mail address: %2.', Comment = '%1 = Customer No., %2 = E-Mail';
begin
if not Customer."E-Mail".Contains('@') then
Error(InvalidEmailErr, Customer."No.", Customer."E-Mail");
end;
}

View file

@ -1,24 +0,0 @@
---
bc-version: [20..]
domain: privacy
keywords: [error, strsubstno, direct-substitution, telemetry, classification, label]
technologies: [al]
countries: [w1]
application-area: [all]
---
# Use a Label or TextConst for the Error telemetry message
## Description
For Error method trace telemetry, the platform includes the AL error string only when `Error` receives a `Label` or `TextConst` as its first argument. Substitution values format the client message, but the static label supplies the telemetry message and preserves its classification context. A string literal, local `Text`, `StrSubstNo` result, or concatenation is not equivalent: telemetry substitutes generic guidance instead of that dynamic string.
## Best Practice
Define the complete error template as a `Label` with placeholder comments, pass the label directly as the first argument, and pass values separately. Independently review whether those values are appropriate to show to the current user.
See sample: `error-direct-substitution-safe-for-telemetry.good.al`.
## Anti Pattern
Assuming that any direct format string is telemetry-safe, or that a `StrSubstNo`/concatenated first argument is logged verbatim. The required telemetry shape is specifically a directly supplied `Label` or `TextConst`; see `avoid-strsubstno-prebuild-before-error.md`.

View file

@ -2,20 +2,20 @@ codeunit 50213 "Privacy Sample Telemetry Bad"
{
procedure LogCustomerProcessed(var Customer: Record Customer)
begin
Session.LogMessage('0000', StrSubstNo('Processed %1', Customer.Name), Verbosity::Normal,
Session.LogMessage('PRIV0001', StrSubstNo('Processed %1', Customer.Name), Verbosity::Normal,
DataClassification::SystemMetadata, TelemetryScope::All,
'Category', 'Privacy');
end;
procedure LogFileError(FileName: Text)
begin
Session.LogMessage('0001', StrSubstNo('Error processing file %1', FileName), Verbosity::Error,
Session.LogMessage('PRIV0002', StrSubstNo('Error processing file %1', FileName), Verbosity::Error,
DataClassification::SystemMetadata, TelemetryScope::All);
end;
procedure LogEmployeeUpdate(EmployeeCode: Code[20])
begin
Session.LogMessage('0002', StrSubstNo('Employee %1 updated record', EmployeeCode), Verbosity::Normal,
Session.LogMessage('PRIV0003', StrSubstNo('Employee %1 updated record', EmployeeCode), Verbosity::Normal,
DataClassification::SystemMetadata, TelemetryScope::All);
end;
}

View file

@ -2,14 +2,14 @@ codeunit 50212 "Privacy Sample Telemetry Good"
{
procedure LogCustomerProcessed(var Customer: Record Customer)
begin
Session.LogMessage('0000', 'Customer record processed', Verbosity::Normal,
Session.LogMessage('PRIV0001', 'Customer record processed', Verbosity::Normal,
DataClassification::SystemMetadata, TelemetryScope::All,
'Category', 'Privacy');
end;
procedure LogFileError()
begin
Session.LogMessage('0001', 'Error processing uploaded file', Verbosity::Error,
Session.LogMessage('PRIV0002', 'Error processing uploaded file', Verbosity::Error,
DataClassification::SystemMetadata, TelemetryScope::All);
end;
}

View file

@ -2,6 +2,6 @@ codeunit 50211 "Privacy Sample LogMessage Bad"
{
procedure LogCompleted()
begin
Session.LogMessage('0003', 'Operation completed', Verbosity::Normal);
Session.LogMessage('PRIV0004', 'Operation completed', Verbosity::Normal);
end;
}

View file

@ -2,7 +2,7 @@ codeunit 50210 "Privacy Sample LogMessage Good"
{
procedure LogCompleted()
begin
Session.LogMessage('0003', 'Operation completed', Verbosity::Normal,
Session.LogMessage('PRIV0004', 'Operation completed', Verbosity::Normal,
DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher);
end;
}