Deduplicate findings and separate governance from cost - #2026
Open
mamu0 wants to merge 8 commits into
Open
Conversation
mamu0
temporarily deployed
to
bootstrapper-dev-ci
July 29, 2026 10:48 — with
GitHub Actions
Inactive
mamu0
temporarily deployed
to
bootstrapper-prod-ci
July 29, 2026 10:48 — with
GitHub Actions
Inactive
mamu0
temporarily deployed
to
bootstrapper-prod-ci
July 29, 2026 10:59 — with
GitHub Actions
Inactive
mamu0
temporarily deployed
to
bootstrapper-dev-ci
July 29, 2026 10:59 — with
GitHub Actions
Inactive
mamu0
temporarily deployed
to
bootstrapper-prod-ci
July 29, 2026 14:01 — with
GitHub Actions
Inactive
mamu0
temporarily deployed
to
bootstrapper-dev-ci
July 29, 2026 14:01 — with
GitHub Actions
Inactive
mamu0
marked this pull request as ready for review
July 29, 2026 14:05
mamu0
temporarily deployed
to
bootstrapper-prod-ci
August 3, 2026 13:36 — with
GitHub Actions
Inactive
mamu0
temporarily deployed
to
bootstrapper-dev-ci
August 3, 2026 13:36 — with
GitHub Actions
Inactive
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.
What
Unifies findings from AZQR, Azure Advisor and the live-scan custom analyzers on a
resourceId + recommendationIdkey, and separates governance/diagnostic observations from actual billable waste.Why
The same waste (e.g. an unattached disk) could be reported once per source, inflating the report and making the FinOps signal noisy. Governance findings (missing tags, wrong location, ...) were also tagged
category: "cost", suggesting a "saving" that doesn't exist and risking false dedup matches.How
Findinggains an optionalrecommendationId, normalised onto a shared vocabulary:orphan.<resourceType>for orphaned resources (any source),advisor.<recommendationTypeId>,azqr.<recommendationId>.azure/finding-dedup.ts:foldDuplicateFindingcollapses an incoming AZQR finding onto an already-collected one for the same resource, keeping max severity + the only available monetary estimate, and annotating the corroborating source (Also flagged by azqr as an orphaned resource.). Applied duringingestAzqrReport. Findings without arecommendationId(all custom sentence-level findings today) never participate - no guesswork dedup.azure/finding-category.ts: custom analyzer sentences about missing tags, unpreferred location, unsupported resource type, or a failed detail lookup are nowoperationalExcellenceinstead ofcost.Category eq 'Cost') is unchanged - it remains the only source ofestimatedMonthlySavings.Testing
pnpm nx run-many -t test typecheck lint build format:check -p @pagopa/dx-savemoney @pagopa/dx-cli- all green, 186 tests in savemoney (+26).Or local usage:
pnpm nx build @pagopa/dx-cli --skip-nx-cache azqr scan --subscription-id 0000 --mask=false --json node ./apps/cli/bin/index.js savemoney --azqr-report ./azqr_action_plan_xxxx_yy_zz_T123456.json --format lint > savemoney_result.mdExample result:

Resolves: CES-2193