It's difficult to pull a single day's events with action_trigger_aggregator.pl

Bug #1728331 reported by Jason Boyer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

While working with action_trigger_aggregator.pl I tried to pull a single day's events by setting --start-date and --end-date to the same value. This resulted in nothing because a bare date in postgresql just has 00:00:00 tacked on the end so it's looking for events with a date >= '2017-10-28 00:00:00' and < '2017-10-28 00:00:00' which is of course 0 events. While you can manage this after realizing your mistake (and doing date math in your scripts, ick) I wonder if it would be better to make the end-date inclusive by manually appending 24:00:00 (this is a valid value, and handy) to the value or adding another parameter called just --date that handles all of this internally in whatever way. I thought I'd get some opinions rather than just throwing patches around (I personally like the 24:00:00 method because in my mind I want the dates to be inclusive, not left-inclusive - right-exclusive).

Revision history for this message
Bill Erickson (berick) wrote :

I'd prefer a --date (or better yet --duration) option to appending a day to --end-date.

I would also caution against using "24:00:00" as a duration when "1 day" will work, since the former is not DST-friendly.

Revision history for this message
Jason Boyer (jboyer) wrote :

It took ages but I eventually shook loose a tuit or two and this branch appeared: http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jboyer/lp1728331-a-t-aggregator-date

tags: added: pullrequest
Changed in evergreen:
importance: Undecided → Wishlist
milestone: none → 3.next
Revision history for this message
Jason Boyer (jboyer) wrote :

There were apparently some local issues causing me to have such trouble with this, so given the lack of interest at other sites and the fact that I've got my local issues sorted without using this patch, I'm going to mark the bug as wontfix for now.

Jason

Changed in evergreen:
status: New → Won't Fix
Revision history for this message
Mike Rylander (mrylander) wrote :

I'd vote for this as a future feature, as written. Putting it back to whishlist.

Changed in evergreen:
status: Won't Fix → Confirmed
Revision history for this message
Mike Rylander (mrylander) wrote :

er, "Confirmed" rather.

tags: added: needsreleasenote
Dan Wells (dbw2)
Changed in evergreen:
milestone: 3.next → 3.3-beta1
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

I can see this feature being useful to have. I'll test this out and write release notes.
Josh

Changed in evergreen:
assignee: nobody → Josh Stompro (u-launchpad-stompro-org)
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Here is a branch with my signoff. I tested out the script with production data and it worked as described. I also moved the script over to being processed by the makefile to set the confdir, just in case a custom one gets used. And the script will now also get installed in the bin dir by default for installs. I also added a note about the script to the support scripts docs.

Since I made some changes this probably needs another signoff.

user/stompro/lp1728331-a-t-aggregator-date
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/lp1728331-a-t-aggregator-date

tags: removed: needsreleasenote
Changed in evergreen:
assignee: Josh Stompro (u-launchpad-stompro-org) → nobody
Changed in evergreen:
milestone: 3.3-beta1 → 3.3-rc
tags: added: actiontrigger
Changed in evergreen:
milestone: 3.3-rc → 3.next
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master for inclusion in 3.4. Thanks, Jason and Josh!

Changed in evergreen:
status: Confirmed → Fix Committed
milestone: 3.next → 3.4-beta1
Galen Charlton (gmc)
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.