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

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

Merged

Conversation

gregoryfoster
Copy link
Contributor

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)

Copy link
Member

@evamaxfield evamaxfield left a comment

Choose a reason for hiding this comment

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

Fascinating. I wouldn't have thought to go this route. Have you tried it out? If it works for you, its good to me.

@gregoryfoster
Copy link
Contributor Author

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

@evamaxfield evamaxfield merged commit 84c13f2 into CouncilDataProject:main Dec 6, 2023
1 check passed
@evamaxfield
Copy link
Member

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event Gather - on manual run, from and to ISO dates are required, not optional
2 participants