Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Add aggregation logic to Findings #1259

Closed
Tracked by #1041
ramizpolic opened this issue Feb 12, 2024 · 2 comments · Fixed by #1758
Closed
Tracked by #1041

Add aggregation logic to Findings #1259

ramizpolic opened this issue Feb 12, 2024 · 2 comments · Fixed by #1758
Assignees

Comments

@ramizpolic
Copy link
Member

Problem Statement

The Findings API property assetsCount needs to contain an aggregated value of referenced AssetFindings to ensure data validty.

Proposed Solution

Increment or decrement related Finding model assetCount property when AssetFinding is added or removed. GORM Hooks can be used for this. A background job needs to be added to the server which recalculates this field to ensure that the summary is correct.

Alternatives Considered

The assetsCount can be a read-only field that is evaluated from the database directly. The caching should be somehow used (check how to do this) to avoid recalc on every db op.

Additional Context

@ramizpolic Provide more implementation details on how to address this properly.

@ramizpolic ramizpolic changed the title Add aggregating logic to Findings model Add aggregating logic to Findings Feb 12, 2024
@ramizpolic ramizpolic changed the title Add aggregating logic to Findings Add aggregation logic to Findings Feb 12, 2024
Copy link

Thank you for your contribution! This issue has been automatically marked as stale because it has no recent activity in the last 60 days. It will be closed in 14 days, if no further activity occurs. If this issue is still relevant, please leave a comment to let us know, and the stale label will be automatically removed.

@github-actions github-actions bot added the stale label Apr 14, 2024
Copy link

github-actions bot commented May 5, 2024

This issue has been marked stale for 14 days, and is now closed due to inactivity. If the issue is still relevant, please re-open this issue or file a new one. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 5, 2024
@ramizpolic ramizpolic reopened this May 9, 2024
@github-actions github-actions bot removed the stale label May 12, 2024
@paralta paralta linked a pull request Jun 11, 2024 that will close this issue
7 tasks
@paralta paralta self-assigned this Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants