Publish a static reservation calendar and JSON feed - #86
Conversation
|
@jantman Got another to review whenever you have some time. I'll admit I'm not as confident in this one. Still flying a little blind with how the s3 static setup + cloudfront is working. Don't know if there's ways to test before we just ship it? |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
jantman
left a comment
There was a problem hiding this comment.
Actual human here, believe it or not.
This all looks good to me, with one minor change that I've requested.
In the puppet repo, you'll have to add STATIC_RESERVATIONS_PUBLIC_URL as an environment variable for ESB, with a value of https://esb-static.decaturmakers.org/reservations.html.
For the S3 variant (which we use), we just write static files called FILENAME to a S3 bucket, and they're served by CloudFront at {STATIC_PAGE_PUBLIC_URL}/{FILENAME} (with index.html as the default filename).
The cache invalidation is desirable because the CF distro has a default TTL of 3600 seconds (1 hour), and when people make changes we want the public web view to reflect them ASAP, not (up to) 3599 seconds later.
Here's the terraform for the S3 bucket and CF distro if this helps understand it; DM only has a GCP account, not AWS, and doing this on GCP is considerably more complicated. So, I'm hosting this in my own AWS account. It's only a few cents per month.
| _push_s3(json_content, target, filename='reservations.json', content_type=JSON_CONTENT_TYPE, invalidate=False) | ||
| _push_s3(html, target, filename='reservations.html', invalidate=False) |
There was a problem hiding this comment.
I think these should invalidate, or else changes will lag quite a bit.
There was a problem hiding this comment.
Good catch! Updated the cache invalidation. I think I'm mostly following for the s3 -> cloudfront stuff. Would be nice to have a dedicated DM AWS account at some point, but know that can be a lot of work!
Merging for now, going to try and deploy around lunch today.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance (scoped to commit d038aaf, pushed since the previous Claude review comment). |
Code reviewNo issues found. The only change since the previous Claude review is a version bump in |
Adds a public, read-only reservation calendar alongside the existing static equipment status page.
reservations.htmland anonymousreservations.jsonsibling files using the existing local, S3, or GCS publishing configuration.STATIC_RESERVATIONS_PUBLIC_URLis configured.Testing
Deployment
Set
STATIC_PAGE_PUSH_TARGETto enable publishing and setSTATIC_RESERVATIONS_PUBLIC_URLto the publicreservations.htmlURL. No database migration is required.