Harden base ruleset: promote 21 rules back to Error - #10088
Harden base ruleset: promote 21 rules back to Error#10088Jesper Schulz-Wedde (JesperSchulz) wants to merge 4 commits into
Conversation
Removes Warning downgrades from base.ruleset.json for rules that produce zero warnings across a full CI build (all 22 countries x Default/Clean). These rules are defined as Error in their respective cop rulesets, so removing the override reverts them to Error, hardening the shared ruleset with no impact on the current build. Related to AB#640773 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
…to Error Fixes the small number of source violations behind three more Warning downgrades in base.ruleset.json, then removes the downgrades so the rules revert to Error: - AA0189 (1 site): lowercase 'suite' in ApplicationArea on Subcontracting Order Subform. - AA0199 (2 sites): ApplicationArea order 'BasicMX, Suite' -> 'Suite, BasicMX' on the CFDIRelationDocuments actions. - AL0590 (1 site): ShowAsTree set on a group (only supported on Repeater) in the Test Tool page. All four changes are no-ops at runtime: the set of application areas is unchanged, and ShowAsTree has no effect outside a repeater. Verified no remaining occurrences in source. Related to AB#640773 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
|
This PR removes 22 diagnostic overrides from src/rulesets/base.ruleset.json (e.g. AL0269, AL0424, AL0482, AL0551, AL0602, AA0604, AL0775, AL0842, AA0189, AA0199, AL1026, AS0079, AS0094, AS0111, AS0113, AS0126, PTE0014, PTE0017, AS0075, AA0230, AA0213, AL0590), several of which carried explicit justifications tied to open bugs (e.g. 'Bug 472119', 'Bug 472148 ... multilanguage syntax is being deprecated', 'Bug 498357. Blocking platform uptake', 'Tracked by #501904'). base.ruleset.json includes ./ruleset.json with generalAction 'Error', so every removed override falls back to Error severity for all apps/projects that reference base.ruleset.json in their build configuration. This is effectively a breaking change to the build/CI contract for every app under this ruleset: previously-warned or suppressed diagnostics for those rule IDs will now fail the build unless the underlying code has already been fixed. Recommend verifying that all in-repo violations for these rule IDs have actually been remediated (not just that the suppression looked stale) before merging, or confirm this is an intentional, coordinated analyzer-hardening pass with a rollout plan for any consumers still relying on the softer warning level. Agent judgement — not directly backed by a BCQuality knowledge article. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
The IN (Clean) build failed on AS0094, AL1026 and PTE0014, which the previous
commit promoted to Error. They were misidentified as zero-violation because
warnings are emitted in two log formats ("##[warning]<CODE>" and
"##[warning]code=<CODE>") and only the first was mined. Re-mining all 44 build
jobs with both formats confirms the other 16 promoted rules genuinely have zero
violations.
All three stem from the same root cause: 12 legacy extensionsPermissionSet.xml
files in INTCS, INTDS and INTaxEngine that need converting to AL PermissionSet
objects. That is a larger migration, so they are restored to Warning with a
justification.
Also fixes and promotes two further rules:
- AL0457 (11 sites): Comment = 'Locked' -> Locked = true. The {Locked="..."}
comment form is a different, valid construct and is left untouched.
- AA0013 (3 sites): a trailing comment after 'then' pushed 'begin' onto the next
line; the comment moves above the statement.
Related to AB#640773
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
The GB Base Application had a remaining AA0013 violation at Bank/Check/Check.Report.al line 1185, where a #if not CLEAN27 directive separated the else from its begin. The else is duplicated into both preprocessor branches so that begin follows else on the same line in the non-CLEAN27 branch, while the CLEAN27 branch keeps a bare else. Behaviour of both branches is unchanged. Related to AB#640773 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7e6fd312-fe92-4215-8333-f98ba0a2e25d
|
This PR removes 21 rule-specific "action": "Warning" overrides from src/rulesets/base.ruleset.json (AA0013, AA0189, AA0199, AA0213, AA0230, AA0604, AL0269, AL0424, AL0457, AL0482, AL0551, AL0590, AL0602, AL0775, AL0842, AS0075, AS0079, AS0111, AS0113, AS0126, PTE0017) while the ruleset's top-level "generalAction" remains "Error". Deleting these overrides silently promotes any surviving occurrence of those 21 diagnostics anywhere in the BCApps monorepo from a warning to a build-breaking error, but the rest of this PR is only a handful of unrelated, localized cosmetic fixes (Label Locked-property corrections, ApplicationArea casing, comment reformatting) rather than a repo-wide analyzer cleanup that would justify tightening these rules. Some removed entries carried bug-tracking justifications (e.g. "Bug 472119", "Bug 498357. Blocking platform uptake") suggesting they were deliberate, tracked suppressions — removing them without confirming the underlying issues are resolved everywhere risks breaking CI/build for unrelated teams. Recommend restoring the overrides in this PR (or splitting the ruleset tightening into its own change validated against a full-repo analyzer run for all 21 diagnostics) before merging. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4 |
Why
After the BCApps migration enabled workspace compilation, every app compiles against a single shared ruleset (
src/rulesets/base.ruleset.json). To get the workspace building, many analyzer rules were downgraded fromErrortoWarning. This PR starts walking that back, with the long-term goal of shrinkingbase.ruleset.jsonuntil it matches./ruleset.json.Related to AB#640773.
Approach
Rather than guessing, the downgraded rules were measured against a full CI/CD build — all 44
Build Apps <COUNTRY> (Default|Clean)jobs — and the warnings aggregated per job. Rules with zero real violations were promoted outright; rules with a handful of violations were fixed at source and then promoted. Larger changes are deliberately left for follow-up.What changed
21 rules promoted from
Warningback toError(base.ruleset.json: 127 → 106 overrides):AA0013,AA0189,AA0199,AA0213,AA0230,AA0604,AL0269,AL0424,AL0457,AL0482,AL0551,AL0590,AL0602,AL0775,AL0842,AS0075,AS0079,AS0111,AS0113,AS0126,PTE0017Most had no violations at all. The rest needed small source fixes:
AL0457Comment = 'Locked'replaced withLocked = truein IntrastatDE, IT VAT reporting, NA CartaPorte (8), NO EHF reminderAA0013beginmoved onto thethen/elseline in W1/BE/ITSCMManufacturing70.Codeunit.aland GBCheck.Report.alAA0199SalesInvoice.Page.alandPostedSalesInvoices.Page.alAA0189SubcontractingOrderSubform.Page.alAL0590ShowAsTreeon a non-tree group inTestTool.Page.alThe GB
AA0013was the trickiest: a#if not CLEAN27directive sat betweenelseandbegin. Theelseis now duplicated into both preprocessor branches sobeginfollows it directly in the non-CLEAN27 branch, leaving both branches' behaviour unchanged.3 rules kept as
Warning, now with justifications:AS0094,AL1026,PTE0014. All three stem from a single root cause — 12 legacyextensionsPermissionSet.xmlfiles (INTCS, INTDS, INTaxEngine) that need converting to ALPermissionSetobjects. That is a substantial change and is tracked separately.Validation
Full CI/CD build across all 44 country × build-mode jobs. No behavioural changes are intended — every source fix is a formatting, casing, ordering or metadata correction.
Follow-ups
AS0094,AL1026andPTE0014.AL0679(licensing entitlement),AW0014(UI visibility),AA0203(renames a request-page field bound by CZ/IT/W1 tests), plusAL0717,AL0523,AL0520,AL0589,AL0611,AL0468.AS0139andAL0920inruleset.json— their blocking bugs (#595767, #632280) are now closed.With the corrected data, no zero-violation rules remain. The free wins are exhausted; each further step now needs a real source change or a product decision.