[PR #220] [MERGED] refactor(api): read blog metadata and capture its schema #218

Closed
opened 2026-10-13 19:48:59 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/220
Author: @Glitchy-Sheep
Created: 10/4/2026
Status: ✅ Merged
Merged: 10/4/2026
Merged by: @Glitchy-Sheep

Base: main ← Head: feat/read-blog-info


📝 Commits (1)

  • df55156 refactor(api): read blog metadata and capture its schema

📊 Changes

21 files changed (+1153 additions, -34 deletions)

View changed files

📝 Taskfile.yml (+2 -2)
📝 boosty_downloader/infrastructure/boosty_api/core/client.py (+25 -0)
📝 boosty_downloader/infrastructure/boosty_api/models/base.py (+1 -1)
➕ boosty_downloader/infrastructure/boosty_api/models/blog.py (+43 -0)
📝 docs/api/README.md (+4 -4)
📝 docs/api/boosty-api.yaml (+553 -1)
📝 scripts/api_schema/__main__.py (+13 -7)
📝 scripts/api_schema/live_api.py (+5 -0)
📝 scripts/api_schema/observed_shapes.py (+1 -1)
📝 scripts/api_schema/openapi_document.py (+32 -7)
📝 scripts/api_schema/schema_changes.py (+3 -1)
📝 scripts/api_schema/unread_keys.py (+17 -6)
📝 scripts/weekly_report.py (+1 -1)
📝 test/e2e/download_flow_test.py (+39 -2)
➕ test/support/synthetic_blog.py (+37 -0)
➕ test/unit/api_schema/blog_capture_test.py (+99 -0)
📝 test/unit/api_schema/openapi_document_test.py (+59 -1)
📝 test/unit/api_schema/schema_changes_test.py (+28 -0)
➕ test/unit/boosty_api/blog_info_test.py (+134 -0)
📝 test/unit/boosty_api/client_test.py (+50 -0)

...and 1 more files

📄 Description

📝 Summary

Add blog metadata support to the API client for future library author records. The OpenAPI generator now captures the blog endpoint, and synthetic blog responses are checked against its observed schema.

🔧 What changes

  • Add get_blog_info() with title, structured description, cover, owner name/avatar and remote post count. Invalid optional fields become unknown while valid sibling values, empty strings/lists and zero are preserved.
  • Reuse the existing transport and retries, with explicit HTTP, JSON and response-validation errors.
  • Capture GET /blog/{blog} in schema generation and drift reports. Description blocks have separate components so their observations cannot overwrite post schemas.
  • Add generated blog schemas from live account and anonymous responses. Preserve prior post observations and record blog capture provenance separately.

🧪 Tests

  • GitHub CI passed: lint/types, build, changelog and tests on Ubuntu Python 3.10/3.12/3.14 and Windows Python 3.12.
  • task ci passed on Python 3.12.12: lint, formatting, types, import boundaries, 417 unit/e2e tests and wheel/sdist builds.
  • Tests cover optional-field tolerance, invalid counts and roots, HTTP/JSON errors, exact routing, 503/429 retries, schema generation, drift detection, fixture conformance and synthetic-data guards.
  • Live client checks passed for two blogs with empty and populated descriptions, both authenticated and anonymous. The generator also captured both blogs in both views; only shapes and counts were saved.
  • The existing authenticated integration suite was skipped because this worktree has no .env; the focused live checks used the main config's account token.
  • Two independent reviews found no consequential issues.

⏭️ Next

Connect these metadata to domain author records and persistence in later library changes. This PR adds API support without changing CLI download behavior.

✅ Checklist

  • Tested live on a real blog (feature or fix)
  • Updated CLI --help and README if needed (CLI unchanged)
  • Updated docs/ if the download flow or dev process changed
  • Added a line to ## Unreleased in CHANGELOG.md (or the ci/skip-changelog label if not user-facing)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Glitchy-Sheep/boosty-downloader/pull/220 **Author:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Created:** 10/4/2026 **Status:** ✅ Merged **Merged:** 10/4/2026 **Merged by:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Base:** `main` ← **Head:** `feat/read-blog-info` --- ### 📝 Commits (1) - [`df55156`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/df5515665b82e39388a35eea3c0473a874c3a36c) refactor(api): read blog metadata and capture its schema ### 📊 Changes **21 files changed** (+1153 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `Taskfile.yml` (+2 -2) 📝 `boosty_downloader/infrastructure/boosty_api/core/client.py` (+25 -0) 📝 `boosty_downloader/infrastructure/boosty_api/models/base.py` (+1 -1) ➕ `boosty_downloader/infrastructure/boosty_api/models/blog.py` (+43 -0) 📝 `docs/api/README.md` (+4 -4) 📝 `docs/api/boosty-api.yaml` (+553 -1) 📝 `scripts/api_schema/__main__.py` (+13 -7) 📝 `scripts/api_schema/live_api.py` (+5 -0) 📝 `scripts/api_schema/observed_shapes.py` (+1 -1) 📝 `scripts/api_schema/openapi_document.py` (+32 -7) 📝 `scripts/api_schema/schema_changes.py` (+3 -1) 📝 `scripts/api_schema/unread_keys.py` (+17 -6) 📝 `scripts/weekly_report.py` (+1 -1) 📝 `test/e2e/download_flow_test.py` (+39 -2) ➕ `test/support/synthetic_blog.py` (+37 -0) ➕ `test/unit/api_schema/blog_capture_test.py` (+99 -0) 📝 `test/unit/api_schema/openapi_document_test.py` (+59 -1) 📝 `test/unit/api_schema/schema_changes_test.py` (+28 -0) ➕ `test/unit/boosty_api/blog_info_test.py` (+134 -0) 📝 `test/unit/boosty_api/client_test.py` (+50 -0) _...and 1 more files_ </details> ### 📄 Description ## 📝 Summary Add blog metadata support to the API client for future library author records. The OpenAPI generator now captures the blog endpoint, and synthetic blog responses are checked against its observed schema. ## 🔧 What changes - Add `get_blog_info()` with title, structured description, cover, owner name/avatar and remote post count. Invalid optional fields become unknown while valid sibling values, empty strings/lists and zero are preserved. - Reuse the existing transport and retries, with explicit HTTP, JSON and response-validation errors. - Capture `GET /blog/{blog}` in schema generation and drift reports. Description blocks have separate components so their observations cannot overwrite post schemas. - Add generated blog schemas from live account and anonymous responses. Preserve prior post observations and record blog capture provenance separately. ## 🧪 Tests - GitHub CI passed: lint/types, build, changelog and tests on Ubuntu Python 3.10/3.12/3.14 and Windows Python 3.12. - `task ci` passed on Python 3.12.12: lint, formatting, types, import boundaries, 417 unit/e2e tests and wheel/sdist builds. - Tests cover optional-field tolerance, invalid counts and roots, HTTP/JSON errors, exact routing, 503/429 retries, schema generation, drift detection, fixture conformance and synthetic-data guards. - Live client checks passed for two blogs with empty and populated descriptions, both authenticated and anonymous. The generator also captured both blogs in both views; only shapes and counts were saved. - The existing authenticated integration suite was skipped because this worktree has no `.env`; the focused live checks used the main config's account token. - Two independent reviews found no consequential issues. ## ⏭️ Next Connect these metadata to domain author records and persistence in later library changes. This PR adds API support without changing CLI download behavior. ## ✅ Checklist - [x] Tested live on a real blog (feature or fix) - [x] Updated CLI `--help` and README if needed (CLI unchanged) - [x] Updated `docs/` if the download flow or dev process changed - [x] Added a line to `## Unreleased` in CHANGELOG.md (or the `ci/skip-changelog` label if not user-facing) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 19:48:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Glitchy-Sheep/boosty-downloader#218
No description provided.