Skip to content

Conversation

@Banrion
Copy link
Contributor

@Banrion Banrion commented Sep 29, 2025

🎟️ Tracking

PM-25611
PM-25612

📔 Objective

This pull request is one of many to add and hookup logic for Risk Insights Persistence of Reports (epic). The following changes have been applied.

Focused changed: Use updated logic added throughout the epic inside of the component for a full client to server loading of reports and report data. Data service is to be used as an orchestrator between components rather than a graph dependency structure.

Changes:

  • Use data service updated report variables and logic in the following components
    • All applications
    • Critical applications
    • Activity
  • Correct service dependencies in components
  • Reload report when critical applications change
  • Update encryption logic for risk insights report data

Minor Improvements:

  • Added message when marking apps as critical fails
  • Renamed components using "tool" to "dirt"
  • Reorganizing type based on responsibility
  • Use safe providers in access intelligence

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@github-actions
Copy link
Contributor

github-actions bot commented Sep 29, 2025

Logo
Checkmarx One – Scan Summary & Details9a1c7814-578c-4ca3-847c-08926caed30b

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 22.52747% with 141 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.78%. Comparing base (2ce194c) to head (c726eec).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...sk-insights/services/risk-insights-data.service.ts 0.00% 57 Missing ⚠️
...ss-intelligence/critical-applications.component.ts 0.00% 33 Missing ⚠️
.../access-intelligence/all-applications.component.ts 0.00% 12 Missing ⚠️
...irt/access-intelligence/risk-insights.component.ts 0.00% 10 Missing ⚠️
...s/risk-insights/services/all-activities.service.ts 0.00% 9 Missing ⚠️
...ights/services/risk-insights-encryption.service.ts 70.96% 5 Missing and 4 partials ⚠️
...-insights/services/risk-insights-report.service.ts 25.00% 9 Missing ⚠️
...mon/src/dirt/reports/risk-insights/models/index.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16655      +/-   ##
==========================================
+ Coverage   38.76%   38.78%   +0.01%     
==========================================
  Files        3406     3407       +1     
  Lines       96754    96741      -13     
  Branches    14526    14540      +14     
==========================================
+ Hits        37511    37524      +13     
+ Misses      57601    57573      -28     
- Partials     1642     1644       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Banrion Banrion marked this pull request as ready for review September 30, 2025 21:22
@Banrion Banrion requested a review from a team as a code owner September 30, 2025 21:22
ttalty
ttalty previously approved these changes Oct 1, 2025
@Banrion Banrion added the needs-qa Marks a PR as requiring QA approval label Oct 1, 2025
@Banrion Banrion requested review from prograhamming and removed request for prograhamming October 3, 2025 14:15
Copy link
Contributor

@AlexRubik AlexRubik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't submit these when I initially made them. They show up on my end but I guess you don't see it until I submit review. These are just code quality changes, not blocking. Not requesting changes so you can still merge if needed.

Comment on lines 27 to 41
constructor(private dataService: RiskInsightsDataService) {
// All application summary changes
this.dataService.reportResults$.subscribe((report) => {
if (report) {
this.setAllAppsReportSummary(report.summaryData);
}
});
// Critical application summary changes
this.dataService.criticalReportResults$.subscribe((report) => {
if (report) {
this.setCriticalAppsReportSummary(report.summaryData);
}
});
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up subscriptions to follow best practice/prevent memory leaks.

Suggested change
constructor(private dataService: RiskInsightsDataService) {
// All application summary changes
this.dataService.reportResults$.subscribe((report) => {
if (report) {
this.setAllAppsReportSummary(report.summaryData);
}
});
// Critical application summary changes
this.dataService.criticalReportResults$.subscribe((report) => {
if (report) {
this.setCriticalAppsReportSummary(report.summaryData);
}
});
}
private destroyRef = inject(DestroyRef);
constructor(private dataService: RiskInsightsDataService) {
this.dataService.reportResults$
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((report) => {
if (report) {
this.setAllAppsReportSummary(report.summaryData);
}
});
this.dataService.criticalReportResults$
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe((report) => {
if (report) {
this.setCriticalAppsReportSummary(report.summaryData);
}
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary in the service not provided in 'root' but provided at the component level. Automatic cleanup is handled at the component level

Comment on lines +94 to +102
this.criticalAppsService.criticalAppsList$
.pipe(withLatestFrom(this.organizationDetails$, this.userId$))
.subscribe({
next: ([_criticalApps, organizationDetails, userId]) => {
if (organizationDetails?.organizationId && userId) {
this.fetchLastReport(organizationDetails?.organizationId, userId);
}
},
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sub cleanup

Suggested change
this.criticalAppsService.criticalAppsList$
.pipe(withLatestFrom(this.organizationDetails$, this.userId$))
.subscribe({
next: ([_criticalApps, organizationDetails, userId]) => {
if (organizationDetails?.organizationId && userId) {
this.fetchLastReport(organizationDetails?.organizationId, userId);
}
},
});
export class RiskInsightsDataService {
private destroyRef = inject(DestroyRef); // Add this line
// ... existing properties ...
constructor(
private accountService: AccountService,
private criticalAppsService: CriticalAppsService,
private organizationService: OrganizationService,
private reportService: RiskInsightsReportService,
) {
this.criticalAppsService.criticalAppsList$
.pipe(
withLatestFrom(this.organizationDetails$, this.userId$),
takeUntilDestroyed(this.destroyRef) // Add this line
)
.subscribe({
next: ([_criticalApps, organizationDetails, userId]) => {
if (organizationDetails?.organizationId && userId) {
this.fetchLastReport(organizationDetails?.organizationId, userId);
}
},
});

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary in the service not provided in 'root' but provided at the component level. Automatic cleanup is handled at the component level

AlexRubik
AlexRubik previously approved these changes Oct 3, 2025
AlexRubik
AlexRubik previously approved these changes Oct 3, 2025
Copy link
Contributor

@AlexRubik AlexRubik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, correct displays before and after first report run

@Banrion Banrion requested review from AlexRubik and ttalty October 6, 2025 15:02
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2025

Copy link
Contributor

@AlexRubik AlexRubik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this fix grabs the org id from the route params. Also, request password change button gives success toast while running local backend server. Fix password change on critical applications

@Banrion Banrion removed the needs-qa Marks a PR as requiring QA approval label Oct 6, 2025
@Banrion Banrion merged commit 8c81ccc into main Oct 6, 2025
65 of 66 checks passed
@Banrion Banrion deleted the dirt/pm-25611/remove-client-duplication branch October 6, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants