Skip to content

feat: implement all TODO specs — pagination, caching, manifest, routing, delta, error reporting#1

Merged
ronaldtse merged 1 commit into
mainfrom
feat/implement-all-todos
May 12, 2026
Merged

feat: implement all TODO specs — pagination, caching, manifest, routing, delta, error reporting#1
ronaldtse merged 1 commit into
mainfrom
feat/implement-all-todos

Conversation

@ronaldtse
Copy link
Copy Markdown
Contributor

Summary

Implements all 7 planned improvements from the TODO specs with full architectural alignment to actions-mn/release.

Features

# Feature Description
01 ETag Caching Cache ETags per repo via ICacheStore; skip repos on HTTP 304
02 Channel Manifest Read .metanorma/channels.yml to skip repos with no matching channels
03 Content-Hash Dedup Skip re-downloading releases with unchanged content hashes
04 Pagination Fetch all release pages, not just the first 100
05 File Routing flat (default), by-doctype, or by-format output structure
06 Partial Failure Structured error reporting with fail-on-error and failed-repos output
07 Delta Aggregation Incremental mode with state persistence and stale file cleanup

Architecture

  • OCP: Extracted IReleaseFetcher, IManifestReader, ICacheStore interfaces
  • Null Object Pattern: NullCacheStore, NullManifestReader, NullDeltaManager for no-cache mode
  • Pipeline Config: Extracted PipelineConfig type; pipeline uses injected interfaces only
  • Composition Root: All deps constructed in main.ts and injected into AggregationPipeline

New Files

src/caching/cache-store.ts         # ICacheStore + FileCacheStore + NullCacheStore
src/fetching/release-fetcher.ts    # PaginatedReleaseFetcher (pagination + ETag)
src/manifest/manifest-reader.ts    # GitHubManifestReader + NullManifestReader
src/delta/state-manager.ts         # DeltaStateManager + NullDeltaManager

New Inputs

  • cache-dir — persistent cache directory (backed by actions/cache)
  • force-full — force full aggregation, ignoring cache
  • file-routing — flat / by-doctype / by-format
  • fail-on-error — fail action on repo errors

New Outputs

  • failed-repos — JSON array of repos with errors

Test Coverage

91 tests passing (55 existing + 36 new), 95%+ line coverage across all metrics.

Breaking Changes

None — all new inputs have defaults that preserve existing behavior.

…ng, delta, error reporting

Implement all 7 planned improvements for actions-mn/aggregate:

- Paginated release fetching (handles repos with >100 releases)
- ETag caching (skip repos with unchanged release listings)
- Content-hash deduplication (skip re-downloading unchanged releases)
- Channel manifest discovery (skip repos via .metanorma/channels.yml)
- Custom file routing (flat / by-doctype / by-format output structure)
- Structured error reporting with fail-on-error and failed-repos output
- Delta aggregation (incremental mode with stale file cleanup)

Architecture improvements:
- Extract release fetching into IReleaseFetcher interface (OCP)
- Add ICacheStore abstraction for ETag and delta state persistence
- Add IManifestReader for channel manifest pre-checks
- Add DeltaStateManager for content-hash dedup and state tracking
- Pipeline config extracted into PipelineConfig type
- Null implementations for all optional features (caching disabled mode)
- Adopt .prettierrc.json and .prettierignore from release project

91 tests passing (55 existing + 36 new), 95%+ line coverage.
@ronaldtse ronaldtse merged commit 0fabe47 into main May 12, 2026
5 checks passed
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