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

Adds purging for notifications #17046

Merged
merged 1 commit into from
Mar 8, 2018

Conversation

NickLaMuro
Copy link
Member

  • Sets notifications that are older than a week to be purged by default.
  • Purging is run daily
  • Clears out notification recipients as well

Links

@NickLaMuro NickLaMuro force-pushed the notification-purging branch 3 times, most recently from 5efeaed to 3820086 Compare February 26, 2018 18:14
* Sets notifications that are older than a week to be purged by default.
* Purging is run daily
* Clears out notification recipients as well
@miq-bot
Copy link
Member

miq-bot commented Feb 26, 2018

Checked commit NickLaMuro@3820086 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. 👍

@carbonin
Copy link
Member

I'm not sure if it would look like this PR, but NotificationType does have an expires_in field. Should we be trying to use that?

Or, if we're going to go this route, should we remove that column entirely? It doesn't look like it gets used anywhere.

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM, although I'd like @carbonin to review since he added the vim performance states purging 🚌 💥

@jrafanie
Copy link
Member

Or, if we're going to go this route, should we remove that column entirely? It doesn't look like it gets used anywhere.

heheh, 🔥 ✂️ 🚽

❤️ 😍

@NickLaMuro
Copy link
Member Author

@carbonin @jrafanie If it is any indicator from the PR, since I basically committed "code plagiarism", I really was just doing some "copy pasta" here, so I really don't have an opinion one way or the other.

That said, I did some git history digging, and this is where the notifications where added:

#10623

Looks like the expires_in column was only added, but never implemented (for the record, it changed to use .to_i_with_method here). Since then, it looks like the seeding is the only place in the code base where this field is used.


So, that said, should make the purging for this PR more dynamic and take into account the expires_in timer? I don't mind doing the work to get that into place, and I honestly didn't know that was a column until you mentioned it, so I wasn't considering it in the first place.

@carbonin
Copy link
Member

If you're game to try to incorporate expires_in here I think that would be great, but at first look it might be difficult to do using the purging stuff you're using here.

I think the purging mixin assumes that everything in the table should be purged by the same interval so it might need multiple passes or some non-trivial database queries.

If this won't fit into the existing purging mixin then I vote for removing the expires_in and going with this. So maybe create a separate PR for the expires version?

@jrafanie
Copy link
Member

If this won't fit into the existing purging mixin then I vote for removing the expires_in and going with this. So maybe create a separate PR for the expires version?

If nothing in the service ui or classic ui or backend code uses or has plans to to use expires_in field, my vote would be to remove the column and treat this table like any other we purge.

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

can't get any simpler than this.
I like both PRs. will put some more comments in the other

@Fryguy
Copy link
Member

Fryguy commented Mar 2, 2018

@skateman @gtanzillo Should we care about expires_in for notification purging?

@skateman
Copy link
Member

skateman commented Mar 3, 2018

@miq-bot request_review @skateman

@miq-bot
Copy link
Member

miq-bot commented Mar 3, 2018

@skateman unrecognized command 'request_review', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@skateman
Copy link
Member

skateman commented Mar 3, 2018

oh, this doesn't work yet 😞

@NickLaMuro
Copy link
Member Author

Adding [WIP] label as well to make sure this doesn't get #yoloMerged

@NickLaMuro NickLaMuro changed the title Adds purging for notifications [WIP] Adds purging for notifications Mar 6, 2018
@miq-bot miq-bot added the wip label Mar 6, 2018
@skateman
Copy link
Member

skateman commented Mar 7, 2018

@Fryguy yes, I think the expires in reflects when the notification should be purged

@jrafanie jrafanie requested a review from skateman March 8, 2018 17:29
@jrafanie
Copy link
Member

jrafanie commented Mar 8, 2018

I'm in favor of this version of the purging of notifications for a few reasons:

  • we already have a standard way of purging based on time
  • expires_in doesn't convey "this will be purged when it expires"
  • expires_in would create a "different" complicated way of purging, a complexity we don't need. Compare the code (and description) of this PR and the alternative of using expires_in here

If we don't have explicit features we'd be losing in ui classic, service ui, or the api by removing expires_in, I'd vote for keeping purging as simple and boring as possible (and the same as everything else) by using this PR and removing the expires_in column if it's not used (in a followup PR).

@skateman
Copy link
Member

skateman commented Mar 8, 2018

@jrafanie true story that the expires_in is not being used, so I leave it up to you guys. But I like simplicity 😉

@NickLaMuro
Copy link
Member Author

Not my call either. I leave it up to who ever designed this in the first place or has a more valid stake in it than I am.

Seems like it was Simon and @gtanzillo who first put together the notifications, for what that is worth: #10623

@jrafanie
Copy link
Member

jrafanie commented Mar 8, 2018

I just want to say I advocated for deleting something without using any emoji.

@NickLaMuro
Copy link
Member Author

NickLaMuro commented Mar 8, 2018

I just want to say I advocated for deleting something without using any emoji.

@jrafanie False, you totally used emoji to agree with a statement that agreed with your own! Don't think I didn't see you doing that there! 🔍 :trollface:

Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

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

The Seal of Approval

@jrafanie
Copy link
Member

jrafanie commented Mar 8, 2018

I think we're good if we received @skateman's seal of approval 😉

@gtanzillo
Copy link
Member

Seems like it was Simon and @gtanzillo who first put together the notifications, for what that is worth: #10623

I'm 👍 for going with the simple approach since expires_in is not currently being used and it's not clear whether it will ever be used. I'm not even sure if expires_in was actually intended for this purpose, anyway.

If everybody's in agreement, we can un-wip and merge this.

@NickLaMuro
Copy link
Member Author

NickLaMuro commented Mar 8, 2018

If 10k is an agreed to value from various performance issues, I'm good with that. If we need to discuss that, ...

Addressed in chat, we will discuss if this is needed at a later date.

@jrafanie
Copy link
Member

jrafanie commented Mar 8, 2018

:shipit:

@jrafanie jrafanie merged commit 427257a into ManageIQ:master Mar 8, 2018
@jrafanie jrafanie self-assigned this Mar 8, 2018
@jrafanie jrafanie added this to the Sprint 81 Ending Mar 12, 2018 milestone Mar 8, 2018
@jrafanie
Copy link
Member

jrafanie commented Mar 8, 2018

@NickLaMuro can you see if this will easily backport to fine and euwe and add those labels? I think this is a no-brainer if it's easy.

@NickLaMuro
Copy link
Member Author

@jrafanie Looks like there were some additions to config/settings.yml and app/model/miq_schedule_worker/runner.rb that made this a non-conflict backport to those two. I think @carbonin 's PR of #16754 didn't make it back in those branches, so that is part of it, along with whatever code was merged for the binary_blob purging.

Short story: No go on easy backport 😢

simaishi pushed a commit that referenced this pull request Mar 9, 2018
@simaishi
Copy link
Contributor

simaishi commented Mar 9, 2018

Gaprindashvili backport details:

$ git log -1
commit 920e709435e62754456237d03974730d0d0f9228
Author: Joe Rafaniello <[email protected]>
Date:   Thu Mar 8 15:33:38 2018 -0500

    Merge pull request #17046 from NickLaMuro/notification-purging
    
    Adds purging for notifications
    (cherry picked from commit 427257a185aed602d1596dfb81c623254957fbe6)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553780

@simaishi
Copy link
Contributor

@NickLaMuro The BZ has cfme-5.8.z flag (but not 5.7.z). Can you create a PR for Fine branch?

@NickLaMuro
Copy link
Member Author

@simaishi short answer: sure, I personally don't mind


Long answer: I was under the impression that this was a "new feature" and an RFE BZ by my interpretation, so backporting wasn't something we were trying to target. I was unaware of/didn't notice the flag, so I wasn't planning to even have this backported to G in the first place, let alone Fine.

Personally I don't think it makes sense to introduce a new feature like this into a older version, but I am not the boss around these parts, so will just do as I am told. </2cents>

Will have a PR for the backport shortly.

@simaishi
Copy link
Contributor

@NickLaMuro ha ha, I'm not the boss either! Feel free to ask the 'right' person and get that flag removed 😄

@NickLaMuro
Copy link
Member Author

@simaishi Here you go just in case :)

#17294

@miq-bot
Copy link
Member

miq-bot commented Apr 16, 2018

@NickLaMuro unrecognized command 'add', ignoring...

Accepted commands are: add_label, add_reviewer, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@NickLaMuro
Copy link
Member Author

NickLaMuro commented Apr 16, 2018

@miq-bot add_label fine/yes

Talked with @dmetzger57 and it looks like we are going to go with putting this in fine, which is fine.

@simaishi
Copy link
Contributor

Backported to Fine via #17294

@skateman
Copy link
Member

@NickLaMuro we would like to have something similar for the SystemConsole model, but first I'd like to rename it to something more meaningful 😉

@simaishi simaishi removed the fine/yes label Apr 18, 2018
@jrafanie jrafanie deleted the notification-purging branch January 13, 2025 21:40
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.

9 participants