• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opendefensecloud / solution-arsenal / 28028635635
76%

Build:
DEFAULT BRANCH: main
Ran 23 Jun 2026 01:25PM UTC
Jobs 1
Files 65
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jun 2026 01:10PM UTC coverage: 75.449% (+0.06%) from 75.389%
28028635635

push

github

web-flow
fix(discovery): exclude terminating CVs from parent Component cleanup (#642)

## What
When a `ComponentVersion` is deleted, the discovery apiwriter only
deletes the parent `Component` if no active CVs remain — terminating
siblings no longer keep it alive.

## Why
On a CV delete the apiwriter checks whether any sibling CVs still
reference the parent `Component` before deleting it. The just-deleted CV
carries a finalizer, so it lingers in `Terminating` state and was still
counted by the `len(remaining.Items) == 0` check; the parent delete was
skipped and the `Component` orphaned forever. This surfaced as the e2e
webhook discovery spec timing out for 600s waiting for the `Component`
to be garbage-collected. The fix counts only active CVs, excluding the
CV being deleted and any already in `Terminating` state.

## Testing
- New unit test (`pkg/discovery/apiwriter`) seeds a terminating sibling
CV — the state the fake clientset never reproduces on its own, which is
why this slipped past unit tests while failing e2e — and asserts the
parent `Component` is deleted; verified it fails on the pre-fix logic
and passes on the fix.
- `go test ./pkg/discovery/apiwriter/...` green; `go vet` clean.

## Notes for reviewers
This is the minimal fix to unblock the release. A follow-up will move
`Component` lifecycle into a dedicated reconciler that owns deletion
serialized per-`Component`, making it re-creation-safe and removing the
inferred-cleanup + finalizer machinery entirely (tracked by the `FIXME`
added in this PR).

## Checklist
- [x] Tests added/updated
- [x] No breaking changes (or upgrade path documented above)
- [x] Readable commit history (squashed and cleaned up as desired)
- [x] AI code review considered and comments resolved

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved component cleanup behavior so parent components are deleted
once all child component versions are removed, i... (continued)

6 of 6 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

4032 of 5344 relevant lines covered (75.45%)

36.7 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
86.13
-0.45% pkg/controller/rendertask_controller.go
Jobs
ID Job ID Ran Files Coverage
1 28028635635.1 23 Jun 2026 01:25PM UTC 65
75.45
GitHub Action Run
Source Files on build 28028635635
  • Tree
  • List 65
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28028635635
  • b00933bb on github
  • Prev Build on main (#28016240114)
  • Next Build on main (#28051160889)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc