Skip to content

Re-enable AA0194 analyzer and obsolete unused DE/IT VAT return actions - #10075

Open
Onat Buyukakkus (onbuyuka) wants to merge 4 commits into
mainfrom
bugs/645060-enable-aa0194-analyzer
Open

Re-enable AA0194 analyzer and obsolete unused DE/IT VAT return actions#10075
Onat Buyukakkus (onbuyuka) wants to merge 4 commits into
mainfrom
bugs/645060-enable-aa0194-analyzer

Conversation

@onbuyuka

@onbuyuka Onat Buyukakkus (onbuyuka) commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What & why

The AA0194 analyzer (an action must define an OnAction trigger or a RunObject property) was downgraded from Error to Warning in src/rulesets/base.ruleset.json. Under workspace compilation every project compiles against base.ruleset.json, so this override disabled the rule repo-wide. As a result a trigger-less action was able to ship and crash the web client when navigating to the Purchase Orders page.

This PR:

  • Removes the AA0194 downgrade from base.ruleset.json, so it inherits Error from CodeCop.ruleset.json again (matching the convention that this file only lists deviations).
  • Obsoletes the unused, hidden and inert actions: the DE/IT VAT return actions (VAT Return Period Card/List) and the DE ECSLReport Log Entries/Release/Reopen placeholders. All are Visible = false with no real OnAction body and hidden promoted actionrefs, so they are marked ObsoleteState = Pending (reason + ObsoleteTag = '29.0') and guarded with #if not CLEAN29, with their promoted actionrefs guarded to match. (For the ECSLReport actions the empty-body #pragma warning disable AA0194 is kept inside the guard, since the empty OnAction still trips the rule until they are removed in CLEAN29.)
  • Suppresses the rule with #pragma warning disable AA0194 only on visible actions whose OnAction body is intentionally empty — removing a visible control would be a UI/compat change beyond this bug's scope: System PageDesigner PageFields View (functional; the empty body overrides default row behavior) and RU PostedFAWriteoffAct Dimensions/Comments (visible but with commented-out bodies — suppression preserves their existing behavior). This matches the existing pattern in Companies.Page.al.

Linked work

Fixes AB#645060

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

  • Scanned all 36,464 .al files in src for actions that trigger AA0194 — both those lacking OnAction/RunObject and those whose OnAction body is empty (comments only, which the analyzer also flags). This surfaced 20 actions total: 15 hidden/inert actions now obsoleted (12 DE/IT VAT + 3 DE ECSLReport), 3 visible actions pragma-suppressed here (PageFields View, RU Dimensions/Comments), and 2 already suppressed in the repo. After the change the scan reports 0 unsuppressed AA0194 violations repo-wide.
  • Verified base.ruleset.json still parses as valid JSON and that every edited page has balanced #if not CLEAN29 / #endif and matching #pragma warning disable/restore AA0194 pairs.
  • Local build note: the changed files are country-layer pages with no standalone app.json; they are merged into the base app per country by the build pipeline, so they are not exercised by a single-project local build. Full per-country compilation with the re-enabled rule is validated by CI on this PR.
  • No tests added: this is an analyzer ruleset configuration change plus page-metadata obsoletion. The analyzer itself is the enforcement mechanism; there is no runtime behavior to unit test.

Risk & compatibility

  • AA0194 becomes a build Error again for all apps. The full-repo scan confirms the only current violations are the ones fixed here, so this should not break the build; any future trigger-less action will now fail fast (the intended safety net).
  • The obsoleted actions (DE/IT VAT + DE ECSLReport) are already hidden (Visible = false) and inert, so obsoleting them has no functional or UI impact. Removal is deferred to CLEAN29; AL0432 (obsolete-pending usage) is None in the ruleset, so the guarded actionrefs produce no diagnostic.
  • The pragma-suppressed actions are left exactly as they were (no behavior change): they are visible, so they are intentionally not removed. PageFields.View is functional; the RU Dimensions/Comments actions remain visible and inert as before (a pre-existing state) — this PR only silences the analyzer, it does not restore or remove them.

The AA0194 analyzer (an action must define an OnAction trigger or a
RunObject) was downgraded from Error to Warning in base.ruleset.json.
Because every project compiles against base.ruleset.json under workspace
compilation, this disabled the rule repo-wide and allowed a trigger-less
action to ship, crashing the web client on the Purchase Orders page.

Remove the AA0194 downgrade so it inherits Error from CodeCop.ruleset.json,
and clean up the only resulting violations: the unused, hidden VAT return
actions in the DE and IT localizations of the VAT Return Period Card and
List pages. These actions carry no OnAction trigger, so they are marked
ObsoleteState = Pending and guarded with #if not CLEAN29 for removal, with
their promoted actionrefs guarded to match.

Fixes AB#645060

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f773223-c7cb-4f70-8287-c3353c65cbf9
@onbuyuka
Onat Buyukakkus (onbuyuka) requested review from a team August 10, 2026 07:59
@github-actions github-actions Bot added the Finance GitHub request for Finance area label Aug 10, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 10, 2026
CI surfaced additional AA0194 violations after the rule was re-enabled as
Error. These actions do have an OnAction trigger, but their bodies contain
only comments, which the analyzer treats the same as a missing trigger.

Suppress the rule around them with #pragma warning disable AA0194, matching
the existing pattern in Companies.Page.al:
- System PageDesigner PageFields "View" action (intentionally empty body to
  override default row behavior).
- DE ECSLReport hidden Log Entries/Release/Reopen placeholder actions.
- RU PostedFAWriteoffAct visible Dimensions/Comments actions whose bodies
  are commented out; suppression preserves their existing behavior.

Fixes AB#645060

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f773223-c7cb-4f70-8287-c3353c65cbf9
The Log Entries/Release/Reopen actions on the DE EC Sales List report are
Visible = false with commented-out OnAction bodies, and their promoted
actionrefs inherit that hidden state - they are fully inert, exactly like
the DE/IT VAT return actions obsoleted earlier in this PR.

For consistency, treat them the same way: mark them ObsoleteState = Pending
(ObsoleteTag '29.0') and guard them and their promoted actionrefs with
#if not CLEAN29, rather than only suppressing AA0194. The pragma remains
inside the guard because the empty OnAction body still triggers the rule
until the actions are removed in CLEAN29.

Visible actions with inert bodies (System PageFields View, RU
PostedFAWriteoffAct Dimensions/Comments) are intentionally left as pragma
suppressions, since removing a visible control would be a UI change.

Fixes AB#645060

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f773223-c7cb-4f70-8287-c3353c65cbf9
Guarding the promoted actionrefs with #if not CLEAN29 alone caused AS0031:
in the CLEAN-symbols breaking-change build the actionrefs disappear versus
the baseline, which is treated as an unsanctioned removal of a control that
dependent extensions may reference.

Give each guarded actionref (and the ECSLReport Category_Release promoted
group that is fully removed) its own ObsoleteState = Pending / ObsoleteReason
/ ObsoleteTag = '29.0' markers, matching the base actions and the existing
pattern in pages such as VATStatement and FixedAssetCard. Obsoleting the
parent action is not enough on its own.

Fixes AB#645060

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f773223-c7cb-4f70-8287-c3353c65cbf9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant