Skip to content

Publish a static reservation calendar and JSON feed - #86

Merged
Aedalus merged 3 commits into
mainfrom
feat/static-reservation-pages
Aug 31, 2026
Merged

Aedalus merged 3 commits into
mainfrom
feat/static-reservation-pages

Conversation

@Aedalus

@Aedalus Aedalus commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Adds a public, read-only reservation calendar alongside the existing static equipment status page.

  • Publishes reservations.html and anonymous reservations.json sibling files using the existing local, S3, or GCS publishing configuration.
  • Refreshes after reservation/equipment changes, at worker startup, and hourly.
  • Skips refresh jobs when static publishing is not configured.
  • Links Slack and built-in documentation to the public calendar when STATIC_RESERVATIONS_PUBLIC_URL is configured.
  • Excludes member identity and reservation notes from public data.

Testing

  • 303 focused tests passed
  • 1,929 non-QR tests passed
  • Ruff passed
  • Strict MkDocs build passed
  • Docker image build passed

Deployment

Set STATIC_PAGE_PUSH_TARGET to enable publishing and set STATIC_RESERVATIONS_PUBLIC_URL to the public reservations.html URL. No database migration is required.

@Aedalus

Aedalus commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

@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?

@claude

claude Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jantman jantman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

esb-static.decaturmakers.org.tf.txt

Comment thread esb/services/static_page_service.py Outdated
Comment on lines +362 to +363
_push_s3(json_content, target, filename='reservations.json', content_type=JSON_CONTENT_TYPE, invalidate=False)
_push_s3(html, target, filename='reservations.html', invalidate=False)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think these should invalidate, or else changes will lag quite a bit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@claude

claude Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance (scoped to commit d038aaf, pushed since the previous Claude review comment).

@claude

claude Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. The only change since the previous Claude review is a version bump in pyproject.toml (0.21.0 → 0.22.0) per the project's release procedure — trivial and not in need of review.

@Aedalus
Aedalus merged commit b4902b8 into main Aug 31, 2026
8 checks passed
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.

2 participants