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

Add a 'Container Project Discovered' event #16903

Merged
merged 2 commits into from
Feb 6, 2018

Conversation

zeari
Copy link

@zeari zeari commented Jan 29, 2018

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1469138
Completed by:
ManageIQ/manageiq-providers-kubernetes#226
ManageIQ/manageiq-ui-classic#3360

This is the exact same implementation as 'Container Image Discovered'
If we like this type Discovered events then ill refactor this and the code for ContainerImage into a DiscoveredEventMixin.

@cben @moolitayer @Ladas PTAL
cc @oourfali

@miq-bot add_label providers/containers, bug

@zeari
Copy link
Author

zeari commented Jan 29, 2018

@miq-bot add_label wip

@miq-bot miq-bot changed the title Add a 'Container Project Discovered' event [WIP] Add a 'Container Project Discovered' event Jan 29, 2018
@miq-bot miq-bot added the wip label Jan 29, 2018
@@ -35,6 +35,8 @@ class ContainerProject < ApplicationRecord
virtual_total :containers_count, :containers
virtual_total :images_count, :container_images

after_create :raise_creation_event
Copy link
Contributor

Choose a reason for hiding this comment

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

In graph refresh batch saving, we do not call these, you can add it in:
https://github.com/Ladas/manageiq-providers-kubernetes/blob/fb3e5d8b1525d54319dcefecd914e1b135f75a1e/app/models/manageiq/providers/kubernetes/container_manager/refresher_mixin.rb#L86

so in similar way as for container_images, we can access persistor.container_projects.created_records.

Copy link
Author

Choose a reason for hiding this comment

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

@zeari zeari force-pushed the container_project_created_event branch from 7a7f2ec to 40396c5 Compare February 1, 2018 14:12
@zeari
Copy link
Author

zeari commented Feb 1, 2018

@miq-bot remove_label wip

@miq-bot miq-bot changed the title [WIP] Add a 'Container Project Discovered' event Add a 'Container Project Discovered' event Feb 1, 2018
@miq-bot miq-bot removed the wip label Feb 1, 2018
@zeari
Copy link
Author

zeari commented Feb 1, 2018

If we like this type Discovered events then ill refactor this and the code for ContainerImage into a DiscoveredEventMixin.

I tested this out and it looks fine (with the other PRs from other repos).
Do we want the mixin?

@zeari
Copy link
Author

zeari commented Feb 4, 2018

screencapture-localhost-3000-miq_policy-explorer-1517736598928

Also available in alerts.

@zeari
Copy link
Author

zeari commented Feb 4, 2018

@agrare @Ladas Please review

@@ -26,6 +26,7 @@ class MiqAlert < ApplicationRecord
ExtManagementSystem
MiqServer
ContainerNode
ContainerProject

Choose a reason for hiding this comment

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

You should add a miq_alert_statuses relation to container_project.rb

has_many :miq_alert_statuses, :as => :resource, :dependent => :destroy

Generally looks good, It would be helpful if you could separate the pieces related to the new event from the policy/alert bits.

Copy link
Author

Choose a reason for hiding this comment

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

Added the relation but I didnt split the PR since this is a small feature that already has 3 PRs associated with it.
I think its a little too much noise.

Copy link
Contributor

Choose a reason for hiding this comment

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

This change caused ui-classic travis failures, fixed in ManageIQ/manageiq-ui-classic#3382

@zeari zeari force-pushed the container_project_created_event branch from ccc4935 to d7deca9 Compare February 4, 2018 13:48
@miq-bot
Copy link
Member

miq-bot commented Feb 4, 2018

Checked commits zeari/manageiq@40396c5~...d7deca9 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 🏆

@cben
Copy link
Contributor

cben commented Feb 5, 2018

LGTM 👍

@agrare agrare self-assigned this Feb 6, 2018
Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

Nice @zeari LGTM

@agrare agrare merged commit d2672cc into ManageIQ:master Feb 6, 2018
@agrare agrare added this to the Sprint 79 Ending Feb 12, 2018 milestone Feb 6, 2018
@himdel
Copy link
Contributor

himdel commented Feb 7, 2018

(Should this become gaprindashvili/yes, please mark ManageIQ/manageiq-ui-classic#3382 accordingly.)

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.

7 participants