Skip to content

Preserve item metadata when rebuilding pipelines - #169

Merged
id774 merged 1 commit into
masterfrom
fix/feed-maker-metadata
Sep 6, 2026
Merged

Preserve item metadata when rebuilding pipelines#169
id774 merged 1 commit into
masterfrom
fix/feed-maker-metadata

Conversation

@id774

@id774 id774 commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Automatic::FeedMaker.create_pipeline now preserves standard pipeline item metadata when it rebuilds items into a new feed.
  • source, enclosure and content_encoded, which were previously dropped entirely, are now carried over when the item being rebuilt has them.
  • A missing optional field no longer interrupts copying the fields after it: each field (description, author, comments, content_encoded, source, enclosure) is now copied independently via a respond_to?/nil check, replacing the single begin/rescue NoMethodError block that previously aborted the rest of the fields whenever any one of them raised.
  • Added a representative filter regression test (FilterLimit) confirming that metadata survives a real filter that uses create_pipeline.

Reason

The pipeline item contract in doc/REQUIREMENTS.md and doc/PLUGINS.md describes source, enclosure and content_encoded as standard item fields, but create_pipeline never copied them when rebuilding an item, and the fields it did copy (description, author, comments, date) could all be lost together if any one of them raised NoMethodError. Since every filter, store and subscription plugin listed in the work item (FilterOne, FilterRand, FilterLimit, FilterAccept, FilterIgnore, FilterPresent, FilterDescriptionLink, StoreDigest, StoreFile, SubscriptionText) rebuilds items through this one shared helper, this metadata loss was silent and affected every one of them, and changed what downstream publishers/stores (PublishMarkdown, PublishFluentd, ProvideFluentd, PublishMemcached, StoreFullText, FilterPresent, StoreDigest) could observe.

Tests

  • bundle exec rspec spec/lib/automatic/feed_maker_spec.rb (new direct regression spec) — 12 examples, 0 failures.
  • bundle exec rspec spec/plugins/filter/limit_spec.rb — 7 examples, 0 failures.
  • bundle exec rake spec:lib — 92 examples, 0 failures.
  • bundle exec rake spec:plugins — 286 examples, 0 failures.
  • bundle exec rake spec — 387 examples, 0 failures.
  • gem build automatic.gemspec — succeeded.
  • bundle exec ruby -Ilib -e "require 'automatic'" — succeeded.
  • bundle exec bin/automatic --version and --help — succeeded.

During implementation, running the full plugin suite caught a real regression in an early version of this change: Automatic::FeedMaker::FeedObject (used by SubscriptionText) has no pubDate method at all, and an unconditional feed.pubDate broke it. The fix guards the date field the same way as the other optional fields (respond_to?(:pubDate), falling back to Time.now), which is what the full-suite run above confirms.

Compatibility

  • Automatic::FeedMaker.create_pipeline's public call shape and return type are unchanged.
  • Filter selection, ordering and item-count semantics (e.g. FilterLimit's max_items behavior) are unchanged; the new test in spec/plugins/filter/limit_spec.rb explicitly re-asserts the existing count/ordering behavior alongside the new metadata assertions.
  • nil-link handling (an item with no link is still skipped) is unchanged.
  • Automatic::FeedMaker.generate_feed's placeholder (FeedObject) semantics are unchanged.
  • No dependency, VERSION, Recipe, or CLI change.

Version History

Recorded as one independent release item under the existing unreleased v26.09 section of doc/VERSIONS:

Preserve standard item metadata when FeedMaker rebuilds pipelines so filters do not discard source, enclosure or full content.

VERSION remains 26.09; no version bump.

🤖 Generated with Claude Code

https://claude.ai/code/session_01H8NygEHhT3zGMnBmQF2F6Q


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H8NygEHhT3zGMnBmQF2F6Q
@id774
id774 merged commit 1c88f30 into master Sep 6, 2026
8 checks passed
@id774
id774 deleted the fix/feed-maker-metadata branch September 6, 2026 09:31
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.

2 participants