LG-15261 | Update AAMVA state maintenance windows#11705
Conversation
changelog: Internal, Identity Verification, Update maintenance windows for states
| module Idv | ||
| class AamvaStateMaintenanceWindow | ||
| # All AAMVA maintenance windows are expressed in 'ET' (LG-14028), | ||
| # except Montana's which we converted here from MST to ET. |
There was a problem hiding this comment.
Montana's window has now been expressed in ET as well.
| # "Daily system resets, normally at 4:45 am. to 5:15 am ET." | ||
| # "Daily, normally at 4:45 am. to 5:15 am ET." | ||
| { cron: '45 4 * * *', duration_minutes: 30 }, | ||
| # (Also "Sunday mornings but only seconds at a time.") |
There was a problem hiding this comment.
I'm leaving comments here for things that are documented but intentionally not implementing.
| 'IN' => [ | ||
| # Sunday morning maintenance from 6 am. to 10 am. ET. | ||
| { cron: '0 6 * * Sun', duration_minutes: 4 * 60 }, |
There was a problem hiding this comment.
I forgot how the alphabet worked when I first added this. It reappears later.
| # I'm modeling this as _every_ Wednesday since we're really | ||
| # answering "Should we expect a maintenance window right now?", | ||
| # and we don't block the user from anything. | ||
| { cron: '0 21 * * Wed', duration_minutes: 3 * 60 }, |
There was a problem hiding this comment.
I can trim this comment down a bit, but want to capture that several of these are oddly worded and impossible to model as cron expressions.
I think it's important to discuss the motivation here: we are not turning users away and treating these as the state being unavailable. We are only modeling maintenance windows during which a lack of response from the DMV is not surprising.So where we don't have something more actionable, I'm erring on the side of being over-inclusive.
There was a problem hiding this comment.
via some googling, and confirming for the Fugit gem, looks like there is a # syntax extension to cron Fugit supports
https://github.com/floraison/fugit?tab=readme-ov-file#the-hash-extension
and this claims to be a valid cron for "every 3rd wednesday" that matches that syntax
There was a problem hiding this comment.
Ooh, nice find!
That first link helps with #11705 (comment) where it turns out Sun#last is valid in Fugit.
The modulo extension supports every 3rd Wednesday, but whether this state means "Every 3rd Wednesday, starting January 1, 2019" is up in the air. I'll file a ticket to see if we can fish that information out of Cloudwatch logs.
There was a problem hiding this comment.
I filed LG-15428 for digging into the "every third Wednesday" business, and opened https://github.com/18F/identity-idp/pull/11725/files for the other half of this.
| # "Monthly on Sunday, midnight to 10:00 am ET." | ||
| # (Okay, but _which_ Sunday?) |
There was a problem hiding this comment.
Because this is 10 hours, I elected against modeling this one as weekly downtime.
| 'ND' => [ | ||
| # Wednesday around 7:30 pm to 7:35 pm ET | ||
| { cron: '30 19 * * Wed', duration_minutes: 5 }, | ||
| # 3rd Sunday of month, 5 minutes anytime between midnight and noon. |
There was a problem hiding this comment.
Not modeling 5 minutes of maintenance "anytime between midnight and noon"
| # MW FIXME: This wraps around, does Tue-Sun get parsed correctly? | ||
| { cron: '0 2 * * Tue-Sun', duration_minutes: 1.25 * 60 }, |
There was a problem hiding this comment.
Cron starts on Sundays, so I may have to break this down to Tue-Sat and then Sun separately?
There was a problem hiding this comment.
It appears to work fine:
[6] pry(main)> f = Fugit.parse_cron('0 2 * * Tue-Sun')
=> #<Fugit::Cron:0x000000013206c128
@cron_s=nil,
@day_and=nil,
@hours=[2],
@minutes=[0],
@monthdays=nil,
@months=nil,
@original="0 2 * * Tue-Sun",
@seconds=[0],
@timezone=nil,
@weekdays=[[0], [2], [3], [4], [5], [6]],
@zone=nil>
| # Last Sunday of every month from 11:00 pm Sunday to 2:00 am. Monday ET | ||
| { cron: '0 23 * * Sun#4', duration: 3 * 60 }, | ||
| { cron: '0 23 * * Sun#5', duration: 3 * 60 }, |
There was a problem hiding this comment.
This is something cron can't model, so I just do the 4th and 5th.
What do you think of me doing a bit of date math and conditional assignment here? I've tended to view this as a static config file since it's initialized as a constant at application start, but there's no reason I can't do something like...
if there_are_5_sundays_this_month
{ cron: '0 23 * * Sun#5', duration: 3 * 60 }
else
{ cron: '0 23 * * Sun#4', duration: 3 * 60 }
endI also briefly tried 0 23 25-31 * Sun, but it looks like that matches the 25th-31st of the month and also on every Sunday, rather than Sundays on the 25th-31st.
There was a problem hiding this comment.
| # Downtime on weekends between 9 pm ET to 7 am ET. | ||
| { cron: '0 21 * * Sat,Sun', duration_minutes: 10 * 60 }, | ||
| # Saturday 9:00 pm. to Sunday 7:00 am. ET. | ||
| { cron: '0 21 * * Sat', duration_minutes: 10 * 60 }, |
There was a problem hiding this comment.
☝️ This revised wording was helpful
| { cron: '0 5 * * *', duration_minutes: 30 }, | ||
| # "Might not respond for short spells, daily between 7 pm and 8:30 pm." (not modeling this) | ||
| # Sunday morning maintenance 3:00 am. to 5 am. ET. | ||
| { cron: '0 3 * * Sun', duration_minutes: 2 * 60 }, |
There was a problem hiding this comment.
This is the same as it was before, but I moved it to match document order. (And changed to the 2 * 60 format for readability.)
🎫 Ticket
Link to the relevant ticket:
LG-15261
🛠 Summary of changes
LG-15261 had me reviewing the latest AAMVA DLDV user guide. I found that a substantial number of changes had taken place to maintenance windows.
📜 Testing Plan
I need to do some testing before this is merged. There are a few ambiguous cron expressions I want to test.
The latest version is linked from https://gitlab.login.gov/lg-teams/ada/remote-unsupervised/-/wikis/AAMVA/AAMVA-DLDV-User-Guide if you wish to view the original source of these.