Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVHAS-546] Manage build-nudges fields when Component is deleted #428

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

johnmcollier
Copy link
Member

What does this PR do?:

  • Updates the ValidateDelete webhook function to handle scenarios when a Component is deleted:
    • If it specifies components in spec.buildNudgesRef, it should remove the component's name from the nudged component's status
    • If the component is nudged by another component, it removes the deleted component from the nudging component's spec.buildNudgesRef field
  • Test cases

Which issue(s)/story(ies) does this PR fixes:

https://issues.redhat.com/browse/DEVHAS-546

PR acceptance criteria:

  • Unit/Functional tests

  • Documentation

  • Client Impact

How to test changes / Special notes to the reviewer:

Signed-off-by: John Collier <jcollier@redhat.com>
@openshift-ci openshift-ci bot requested review from kim-tsao and yangcao77 December 6, 2023 17:02
@openshift-ci openshift-ci bot added the approved label Dec 6, 2023
Signed-off-by: John Collier <jcollier@redhat.com>
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (181ed5d) 81.34% compared to head (031b231) 81.37%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #428      +/-   ##
==========================================
+ Coverage   81.34%   81.37%   +0.03%     
==========================================
  Files          32       32              
  Lines        4787     4886      +99     
==========================================
+ Hits         3894     3976      +82     
- Misses        702      713      +11     
- Partials      191      197       +6     

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

if err != nil {
// Don't block component deletion if this fails, but log and continue
componentlog.Error(err, "error deleting component name from build-nudges-ref")
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

already end of loop, do not need this continue

if err != nil {
// Don't block component deletion if this fails, but log and continue
componentlog.Error(err, "error deleting component name from build-nudges-ref")
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

already end of loop, do not need this continue

Copy link
Contributor

@yangcao77 yangcao77 left a comment

Choose a reason for hiding this comment

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

a minor comment, otherwise LGTM

Copy link

openshift-ci bot commented Dec 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnmcollier, yangcao77

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [johnmcollier,yangcao77]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: John Collier <jcollier@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Dec 7, 2023
Copy link

openshift-ci bot commented Dec 7, 2023

New changes are detected. LGTM label has been removed.

Copy link

sonarqubecloud bot commented Dec 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
2.2% 2.2% Duplication

@johnmcollier johnmcollier merged commit 5ecc5ed into redhat-appstudio:main Dec 7, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants