Skip to content

Add RFC 8288 Link header parsing and pagination#295

Merged
JE-Chen merged 1 commit into
devfrom
feat/link-header-batch
Jun 21, 2026
Merged

Add RFC 8288 Link header parsing and pagination#295
JE-Chen merged 1 commit into
devfrom
feat/link-header-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

Parses Link headers and follows rel="next" pagination. Paginated REST APIs return Link: <...>; rel="next" but nothing parsed it.

  • parse_link_header(value)[Link(uri, rel, params)] (handles quoted values with commas and multiple links).
  • links_by_rel(value) — indexes by each (space-separated) relation.
  • next_url(value) — the rel="next" URI.
  • paginate(url, fetch, *, max_pages=100) — walks next links over an injected fetch callable (transport/cassette).

Layers

  • Headless core: utils/link_header/ (pure stdlib re, zero PySide6).
  • Facade: 5 symbols + __all__.
  • Executor: AC_parse_link_header, AC_next_url.
  • MCP: ac_parse_link_header, ac_next_url (read-only).
  • Script Builder: both under Data.
  • Tests: test/unit_test/headless/test_link_header_batch.py (10 tests, including injected-fetch pagination).
  • Docs: v87_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest test/unit_test/headless/test_link_header_batch.py → 10 passed.
  • ruff check je_auto_control/ clean; pylint 10.00/10; bandit clean; radon CC clean.
  • Package stays Qt-free.

Paginated REST APIs return Link: <...>; rel="next" headers, but nothing
parsed them, so multi-page fetches needed manual glue. Add
parse_link_header (quoted values, multiple links), links_by_rel, next_url,
and paginate that follows rel="next" over an injected fetch callable.
Wired through facade, executor (AC_parse_link_header / AC_next_url), MCP,
and the Script Builder with a headless test batch and EN/Zh docs.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 53 complexity · 0 duplication

Metric Results
Complexity 53
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit b14d6a9 into dev Jun 21, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/link-header-batch branch June 21, 2026 18:04
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant