Skip to content

Feature/show sites on advisories#69

Merged
martinyde merged 5 commits intodevelopfrom
feature/show_sites_on_advisories
Apr 22, 2026
Merged

Feature/show sites on advisories#69
martinyde merged 5 commits intodevelopfrom
feature/show_sites_on_advisories

Conversation

@martinyde
Copy link
Copy Markdown
Contributor

@martinyde martinyde commented Apr 22, 2026

Link to ticket

https://leantime.itkdev.dk/ProjectOverview/projectOverview?userIds=14&tab=timesheet#/tickets/showTicket/6667

Description

Add Sites table on advisories and sites count on list display

Screenshot of the result

Skærmbillede 2026-04-22 kl  09 00 00 Skærmbillede 2026-04-22 kl  08 47 49

@github-actions
Copy link
Copy Markdown

API Specification - Non-breaking changes

API Changelog 1.0.0 vs. 1.0.0

No changes detected

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.29%. Comparing base (a8a93f2) to head (167d9d0).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/Entity/Advisory.php 0.00% 7 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop      #69      +/-   ##
=============================================
+ Coverage      39.15%   39.29%   +0.13%     
- Complexity       828      833       +5     
=============================================
  Files            119      120       +1     
  Lines           2572     2624      +52     
=============================================
+ Hits            1007     1031      +24     
- Misses          1565     1593      +28     
Flag Coverage Δ
unittests 39.29% <46.15%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martinyde martinyde requested a review from turegjorup April 22, 2026 07:12
Comment thread src/Entity/Advisory.php
Comment on lines +198 to +207
$sites = [];
foreach ($this->packageVersions as $packageVersion) {
foreach ($packageVersion->getInstallations() as $installation) {
foreach ($installation->getSites() as $site) {
$sites[$site->getId()->toRfc4122()] = $site;
}
}
}

return new ArrayCollection(array_values($sites));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
$sites = [];
foreach ($this->packageVersions as $packageVersion) {
foreach ($packageVersion->getInstallations() as $installation) {
foreach ($installation->getSites() as $site) {
$sites[$site->getId()->toRfc4122()] = $site;
}
}
}
return new ArrayCollection(array_values($sites));
$sites = new ArrayCollection();
foreach ($this->packageVersions as $packageVersion) {
foreach ($packageVersion->getInstallations() as $installation) {
foreach ($installation->getSites() as $site) {
if (!$sites->contains($site)) {
$sites->add($site);
}
}
}
}
return $sites;

Copy link
Copy Markdown
Contributor

@turegjorup turegjorup left a comment

Choose a reason for hiding this comment

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

One suggestion for writing the getSites() function without the array, using only a collection. Suggestion only, highly subjective which one is "best"

@martinyde martinyde merged commit f041354 into develop Apr 22, 2026
11 checks passed
@martinyde martinyde deleted the feature/show_sites_on_advisories branch April 22, 2026 12:17
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.

3 participants