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

Adding Pod name for idle email notification #478

Merged
merged 20 commits into from
Oct 17, 2023

Conversation

fbm3307
Copy link
Contributor

@fbm3307 fbm3307 commented Oct 5, 2023

Adding the Pod name for idle email notification .
https://issues.redhat.com/browse/SANDBOX-186

related PR codeready-toolchain/host-operator#878

@openshift-ci
Copy link

openshift-ci bot commented Oct 5, 2023

Hi @fbm3307. Thanks for your PR.

I'm waiting for a codeready-toolchain member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@alexeykazakov
Copy link
Contributor

/ok-to-test

@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Merging #478 (625912d) into master (a142fe4) will increase coverage by 0.06%.
The diff coverage is 92.06%.

@@            Coverage Diff             @@
##           master     #478      +/-   ##
==========================================
+ Coverage   82.34%   82.40%   +0.06%     
==========================================
  Files          30       30              
  Lines        3160     3172      +12     
==========================================
+ Hits         2602     2614      +12     
  Misses        426      426              
  Partials      132      132              
Files Coverage Δ
controllers/idler/idler_controller.go 93.18% <92.06%> (+0.19%) ⬆️

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Nice job!

I left few minor comments only.

controllers/idler/idler_controller.go Outdated Show resolved Hide resolved
@fbm3307
Copy link
Contributor Author

fbm3307 commented Oct 9, 2023

/test e2e

@fbm3307 fbm3307 requested a review from alexeykazakov October 13, 2023 12:58
Signed-off-by: Feny Mehta <[email protected]>
@fbm3307 fbm3307 requested a review from ranakan19 October 16, 2023 14:58
nsTmplSet := newNSTmplSet(test.MemberOperatorNs, "alex", "advanced", "abcde11", namespaces, usernames)
mur := newMUR("alex")
reconciler, _, _, _ := prepareReconcile(t, idler.Name, getHostCluster, idler, nsTmplSet, mur)
payloads := preparePayloads(t, reconciler, idler.Name, "", time.Now())
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use a different name of the variable instead of payloads since it shadows the struct in here https://github.com/codeready-toolchain/member-operator/blob/master/controllers/idler/idler_controller_test.go#L796

@ranakan19
Copy link
Contributor

Maybe we should a check here to confirm that the appName and appType are rightly passed to the notification as well - https://github.com/codeready-toolchain/member-operator/blob/master/controllers/idler/idler_controller_test.go#L326

Copy link
Contributor

@ranakan19 ranakan19 left a comment

Choose a reason for hiding this comment

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

Looks good overall! left some comments and need to fix the cyclomatic complexity in test

Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

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

Looks good! I've reduced the code duplication in the tests though: 8ddb790

The only thing is left is the "standalone Pod" use case. We need to cover it by another tests. Please see my comment. The rest looks good!

controllers/idler/idler_controller_test.go Outdated Show resolved Hide resolved
@alexeykazakov
Copy link
Contributor

Maybe we should a check here to confirm that the appName and appType are rightly passed to the notification as well

Right. I suggest another test which would cover the standalone pod and the notification's appName & appType all together. See my comment above.

@sonarqubecloud
Copy link

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 3 Code Smells

No Coverage information No Coverage information
10.1% 10.1% Duplication

@fbm3307
Copy link
Contributor Author

fbm3307 commented Oct 17, 2023

Maybe we should a check here to confirm that the appName and appType are rightly passed to the notification as well - https://github.com/codeready-toolchain/member-operator/blob/master/controllers/idler/idler_controller_test.go#L326

yes updated it with new test case

Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you for addressing all the comments.

@openshift-ci
Copy link

openshift-ci bot commented Oct 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, fbm3307

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:

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

@alexeykazakov alexeykazakov merged commit d07f06e into codeready-toolchain:master Oct 17, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants