Skip to content

feat: aggregate release notes across intermediate versions on update - #160

Merged
vantoan1511 merged 2 commits into
mainfrom
feat/aggregate-release-notes
Aug 27, 2026
Merged

feat: aggregate release notes across intermediate versions on update#160
vantoan1511 merged 2 commits into
mainfrom
feat/aggregate-release-notes

Conversation

@vantoan1511

Copy link
Copy Markdown
Owner

Summary

Aggregates and displays release notes for all intermediate versions when an update skips versions (e.g., upgrading directly from v0.6.0 to v0.7.1).

Changes

  • Backend / Updater Engine (\core/engine/src/updater.rs):
    • Updated \UpdateManifest::fetch\ to take \current_version: &str.
    • Added query to GitHub Releases API (/repos/vantoan1511/orbit/releases?per_page=30) in \ etch_github_release_notes.
    • Added \�ggregate_release_notes\ to filter releases in range \current_version < release <= target_version\ and combine their markdown bodies under ## Release {tag_name}\ headings.
    • Kept single tag and latest release endpoints as robust fallback in case of rate limits or failures.
    • Added unit tests for multi-version aggregation, single-version updates, and unmatched versions.
  • Backend / IPC Handlers (\core/engine/src/ipc/handlers/update.rs):
    • Extracted \current_engine\ before fetching update manifest and passed it to \UpdateManifest::fetch.

Files Changed

File Change
\core/engine/src/ipc/handlers/update.rs\ Modified
\core/engine/src/updater.rs\ Modified

Testing

  • Added 3 unit tests to \core/engine/src/updater.rs:
    • \ est_aggregate_release_notes_multiple_intermediate_versions\
    • \ est_aggregate_release_notes_single_version\
    • \ est_aggregate_release_notes_no_matching_versions\
  • Ran full test suite with \cargo test\ in \core\ (29 tests passing).
  • Ran TypeScript checks with
    pm run type-check\ (0 errors).

Related Issues

None

@github-actions github-actions Bot added the feat label Aug 27, 2026

@vantoan1511 vantoan1511 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Decision: REQUEST CHANGES

The feature is well-motivated and the core logic is correct. Two HIGH issues must be addressed before merge.

HIGH: H1 - Release notes are ordered newest-first (reversed chronology)

File: core/engine/src/updater.rs:131-145

The GitHub /releases?per_page=30 API returns releases in descending order (newest first). The loop appends them in iteration order, so the combined notes display the newest release at the top. For a user upgrading v0.6.0 to v0.7.1, the logical reading order is v0.7.0 first then v0.7.1. The unit test does not catch this because it only uses contains() without asserting order.

Fix: Collect matching entries, sort ascending by semver, then join.

HIGH: H2 - Clippy failure blocks CI

File: core/engine/src/updater.rs:45-53

cargo clippy -- -D warnings errors on the nested collapsible_if block. This will fail CI.

Fix: Collapse into a single if guard using && let-chain syntax or restructure.

MEDIUM

  • M1: per_page=30 silently truncates for repos with >30 releases. Consider bumping to 100 or logging a warning.
  • M2: Intermediate releases with no body are silently omitted. A placeholder would make gaps visible.
  • M3: Add a test asserting ordering of sections (notes.find v0.7.0 < notes.find v0.7.1).

LOW

  • L1: tag_name: String with #[serde(default)] should be Option.
  • L2: The GitHub repo slug appears in 3 string literals. Extract as a const.

Validation

  • cargo clippy -- -D warnings: FAIL (collapsible_if in updater.rs:45)
  • cargo test: PASS (29/29)
  • Build: PASS

@vantoan1511

Copy link
Copy Markdown
Owner Author

Addressed review feedback:

  • H1 (Sorting): Explicitly sorting aggregated release notes in descending order (newest first) by semver, regardless of input ordering.
  • H2 (Clippy): Refactored GitHub fetch methods using dedicated helpers ( etch_aggregated_release_notes, etch_single_release_notes, etch_release_by_url) and iterator-based ilter_map. Zero Clippy errors or warnings.
  • M1 (Page size): Increased GitHub releases query to per_page=100.
  • M2 (Empty body): Releases with missing or blank bodies now output a No release notes provided. placeholder instead of skipping the release heading.
  • M3 (Tests): Added tests verifying descending order and empty body fallback.
  • L1 (Types): GithubReleaseItem.tag_name modeled as Option.
  • L2 (Const): Extracted const GITHUB_REPO: &str = "vantoan1511/orbit";.

@vantoan1511
vantoan1511 merged commit b911887 into main Aug 27, 2026
2 checks passed
@vantoan1511
vantoan1511 deleted the feat/aggregate-release-notes branch August 27, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant