CouncilDataProject / cookiecutter-cdp-deployment

Cookiecutter template for creating new CDP instances.
Mozilla Public License 2.0
26 stars 9 forks source link

#149: bug/event_gather_inputs - support default values for from and to ISO datetime #152

Closed gregoryfoster closed 11 months ago

gregoryfoster commented 11 months ago

Link to Relevant Issue

This pull request resolves #149

Description of Changes

Rather than require ISO datetimes be entered when manually calling the Event Gather action, this code generates ISO datetime values which reflect the codebase defaults (2 days prior for the from value, now for to). Narrowly within the "Gather and Process Requested Events - Manual" step, we use the date command to set environment variables for the default values and use bash parameter expansion to override the user input when it's null. This post details this approach in our specific case: https://dev.to/mrmike/github-action-handling-input-default-value-5f2g

I ran this on the Olympia instance and the logs indicate the default values were successfully generated:

[INFO: event_gather_pipeline: 125 2023-12-03 00:50:35,612] Gathering events to process. (2023-12-01T00:50:28+00:00 - 2023-12-03T00:50:28+00:00)
gregoryfoster commented 11 months ago

It's not the most elegant looking code, but it gets the job done 👍

evamaxfield commented 11 months ago

Thanks again!