-
Notifications
You must be signed in to change notification settings - Fork 0
feat(api): Phase 7b foundation — init, datetime-TZ, /readiness, status cache, proxy widening #75
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
57379d9
docs(api): Phase 7b foundation implementation plan
strausmann 5ea32cb
feat(api): add serialize_datetime_utc helper for RFC3339 with Z
strausmann 163fd76
fix(api): TemplateRead emits RFC3339 datetimes with Z suffix
strausmann 1acc15a
refactor(api): hoist api_client_with_seed fixture into conftest
strausmann 71e388a
fix(api): PrinterRead + JobRead emit RFC3339 datetimes with Z suffix
strausmann 828aae8
refactor(api): SQLAlchemy datetime columns are timezone-aware UTC
strausmann ed3c55b
fix(api): alembic data migration normalises naive datetimes to UTC
strausmann 3d01502
fix(integration): suppress alembic fileConfig in migration test to re…
strausmann efbbc31
feat(api): derive_printer_id helper for deterministic UUIDv5
strausmann c8f46d5
feat(api): upsert_runtime_printer lifespan helper
strausmann 9845ad4
refactor(api): driver.make_queue_printer accepts optional printer_id
strausmann b420e1c
fix(api): seed_templates aborts on empty loader cache instead of sile…
strausmann 77ceb3a
fix(api): re-order lifespan — load_dir before seed_templates + upsert…
strausmann 6943a1e
feat(api): verify_alembic_at_head fails fast on revision drift
strausmann 4fb107d
feat(api): readiness response schema (CheckStatus + ReadinessResponse)
strausmann 8020e40
feat(api): readiness aggregator — database/alembic/templates/printer_…
strausmann 499003c
feat(api): readiness aggregator — remaining 4 checks
strausmann 424948b
feat(api): expose /readiness deep-check endpoint
strausmann 9790e52
test(api): regression guard — /healthz must answer 200 even when DB b…
strausmann 47175f1
feat(status): StatusProbeProducer persists printer_status_cache rows
strausmann 07aaba4
feat(status): PrinterStatus carries cache freshness + offline reason
strausmann 411c79a
fix(status): /api/printers/{id}/status reads from cache, no sync SNMP
strausmann a096a90
feat(ui): proxy /docs, /openapi.json, /redoc to the backend
strausmann 1db3bee
docs(api): document /healthz vs /readiness contract in the README
strausmann 6ace6de
fix(api): readiness sse_bus check supports real EventBus + Settings cap
strausmann 6ced8bb
fix(api): populate PrinterStatus.tape_loaded + error_state from cache
strausmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| """Phase 7b — normalise existing datetime rows to timezone-aware ISO strings. | ||
|
|
||
| Existing rows from Phase 5 inserts contain naive datetimes (no TZ suffix) | ||
| that break the Go frontend's RFC3339 parser. This migration appends | ||
| `+00:00` to any value that does NOT already contain `+` or end with `Z`. | ||
| SQLite is dynamically typed so no ALTER TABLE is required — the new column | ||
| type from B4 only affects new inserts via the SQLAlchemy layer. | ||
|
|
||
| Revision ID: 20260517_phase7b_datetime_tz | ||
| Revises: b2668b6e8845 | ||
| Create Date: 2026-05-17 | ||
| """ | ||
|
|
||
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "20260517_phase7b_datetime_tz" | ||
| down_revision = "b2668b6e8845" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| _TABLES_DT = [ | ||
| ("templates", ["created_at", "updated_at"]), | ||
| ("printers", ["created_at", "updated_at"]), | ||
| ("jobs", ["created_at", "updated_at", "started_at", "finished_at"]), | ||
| ("presets", ["created_at", "updated_at"]), | ||
| ("printer_state", ["updated_at"]), | ||
| ("printer_status_cache", ["captured_at", "updated_at"]), | ||
| ] | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| for table, cols in _TABLES_DT: | ||
| for col in cols: | ||
| op.execute( | ||
| f"UPDATE {table} SET {col} = {col} || '+00:00' " | ||
| f"WHERE {col} IS NOT NULL " | ||
| f"AND {col} NOT LIKE '%+%' " | ||
| f"AND {col} NOT LIKE '%Z'" | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| # The naive-datetime state being reverted to is exactly the bug we | ||
| # are fixing. Downgrade is intentionally a no-op. | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.