Improve reservations and built-in documentation - #79
Conversation
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
Pull request overview
Updates the reservation experience and the built-in documentation system for Equipment Status Board (ESB), including a new Reservations Guide shared between MkDocs and the in-app /docs/ help site. It also adjusts the admin reservations calendar to default to currently reservable equipment while preserving historical reservation records, and expands test coverage around these behaviors.
Changes:
- Add a new Reservations Guide and wire it into both MkDocs navigation and the built-in docs renderer (including generated per-page TOCs and debug cache-bypass behavior).
- Improve reservation UI behavior for authenticated users (shared navbar) and refine admin reservation calendar scoping to reservable equipment by default while retaining history.
- Expand tests for docs rendering/caching and reservation calendar output/visibility rules; bump project version and pin CI ruff version.
Reviewed changes
Copilot reviewed 18 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_views/test_reservation_views.py | Adds coverage for authenticated reservations page using the main navbar and for JSON-only privacy assertions. |
| tests/test_views/test_docs_views.py | Adds tests for the new reservations guide, generated page TOC behavior, and debug-mode cache bypassing. |
| tests/test_views/test_admin_reservation_views.py | Ensures archived/disabled equipment stays in history while default admin calendar columns exclude it. |
| tests/test_services/test_reservation_read_service.py | Validates admin calendar default columns include only reservable equipment. |
| README.md | Adds a Reservations Guide link and mentions Decatur Makers access URL. |
| pyproject.toml | Bumps project version to 0.20.0. |
| mkdocs.yml | Adds Reservations Guide to MkDocs nav and introduces reservation_url in extra. |
| esb/views/docs.py | Updates docs views to pass TOC HTML returned by docs_service.render_page. |
| esb/templates/reservations/index.html | Uses authenticated base layout for logged-in users; otherwise keeps public base. |
| esb/templates/docs/page.html | Adds a responsive “On this page” TOC sidebar and layout restructuring for docs pages. |
| esb/templates/base.html | Adds a debug-only “local” navbar styling hook (green) vs production dark navbar. |
| esb/static/css/app.css | Adds navbar-local styling and responsive/sticky TOC + screenshot/table styling for built-in docs. |
| esb/services/reservation_read_service.py | Splits admin reservation history vs calendar equipment scopes and filters default calendar to reservable equipment. |
| esb/services/docs_service.py | Adds attr_list, generates/stores TOC HTML from the same Markdown render pass, and bypasses docs cache in debug mode. |
| docs/reservations.md | Introduces the new Reservations Guide content, including Slack flow screenshots and role guidance. |
| docs/index.md | Adds reservations section and links to the Reservations Guide. |
| docs/administrators.md | Adds Decatur Makers production deployment notes and workflow steps. |
| .gitignore | Ignores local OpenSpec and Codex workspace directories. |
| .github/workflows/ci.yml | Pins ruff version in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### Decatur Makers Production Deployment | ||
|
|
||
| Decatur Makers deploys ESB through [dm-puppet](https://github.com/DecaturMakers/dm-puppet). Production changes should be made and reviewed there rather than applied directly to the host. | ||
|
|
||
| 1. Update the version in this repository's `pyproject.toml`, complete the normal review and release process, and confirm that the versioned container image was published. | ||
| 2. In `dm-puppet`, update the pinned ESB image tag in `modules/local/dmpuppet/manifests/internals/esb.pp` and merge the change through its normal review process. | ||
| 3. Connect to the makerspace WireGuard VPN and SSH to `palantir.decaturmakers.org`. | ||
| 4. Preview the Puppet change and confirm that the output matches the intended deployment: | ||
|
|
||
| ```bash | ||
| sudo /root/bin/run_r10k_puppet.sh --noop | ||
| ``` | ||
|
|
||
| 5. Apply the reviewed change: | ||
|
|
||
| ```bash | ||
| sudo /root/bin/run_r10k_puppet.sh | ||
| ``` | ||
|
|
||
| 6. Apply outstanding database migrations: | ||
|
|
||
| ```bash | ||
| sudo docker exec esb flask db upgrade | ||
| ``` | ||
|
|
||
| 7. Confirm that the web app and worker are healthy, review recent logs, smoke-test the changed path, and check Slack and monitoring for new errors. | ||
|
|
||
| To roll back, restore the previous pinned image tag in `dm-puppet`, preview and apply the Puppet change again, and repeat the health checks. Database migrations are not assumed reversible, so confirm that the current schema is compatible before rolling back the image. | ||
|
|
||
| See [dm-puppet](https://github.com/DecaturMakers/dm-puppet) and [dm-network-docs](https://github.com/DecaturMakers/dm-network-docs) for infrastructure-specific details. | ||
|
|
There was a problem hiding this comment.
I'm certainly open to a counterpoint here, but I've tried to keep the project documentation generic and not DM-specific, with the (perhaps unrealistically optimisitc?) thought that ESB could be used by any makerspace. Up until now, I've kept all of the DM-specific stuff in our private repos...
jantman
left a comment
There was a problem hiding this comment.
I'd prefer if the one docs section that I commented on is fixed, but happy for you to merge as-is if you feel that's right.
Uh oh!
There was an error while loading. Please reload this page.