fix(PC0021): suppress Microsoft-owned mismatches on supported TransferFields pairs - #562
Merged
Merged
Conversation
…lds pairs Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rFields pairs Microsoft ships and supports TransferFields calls between Base App tables whose same-ID fields differ by name or type, such as Purchase Header and Purchase Header Archive or Tracking Specification and Reservation Entry. The invocation path used the curated relation list only to switch off field-level reports; the summary diagnostic at the call site fired for every mismatch, Base App fields included, so these calls were always flagged although the developer cannot change the fields. The relation lookup is now directional and by pair: a call is curated only when its (source, target) pair matches a relation in that direction, and only then is field-level reporting switched off. When a curated pair consists of two Microsoft tables (namespace root Microsoft or System, or publisher Microsoft for namespace-less objects), mismatches are dropped when both fields are Microsoft-owned. A field declared in the analyzed module is never Microsoft-owned, and a dependency tableextension field only when that extension is Microsoft's. As soon as one side of a collision was added by the developer or a third party it is reported, because that collision is outside what Microsoft supports. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…App FlowField Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Microsoft ships and supports
TransferFieldscalls between Base App tables whose same-ID fields differ.PurchaseHeader.TransferFields(PurchaseHeaderArchive)inArchiveManagement.Codeunit.al:229raises PC0021 on field 151 (Quote No./Purchase Quote No.), and Tracking Specification ↔ Reservation Entry raises it on fields 31 and 900. The developer cannot rename Base App fields, and a#pragmaon the call would also hide collisions on their own tableextension fields.Root cause
FindFieldMismatchesfound, Base App fields included. The curated relation list only switched off the field-level reports.Change
HasTableRelation(source, target)matches a curated relation only in the call's direction (source = argument record, target = receiver). Field-level reporting now follows this pair lookup.ISymbol.IsMicrosoftObject()in Common): the namespace root isMicrosoftorSystem; for namespace-less objects, the module publisher isMicrosoft.Not changed
AnalyzeTableExtension).Tests
Fixtures in both the PC0020 and PC0021 folders:
ProjectInfoCustomizer.Default Publisher: still reported at the call.A single fixture cannot cover the Microsoft dependency-tableextension branch, because it needs a second module. The rule doc records this.
Follow-up
A separate alcops.dev docs PR will add a note on supported Base App pairs to the PC0020 and PC0021 pages.
Fixes #418
🤖 Generated with Claude Code