Preserve item metadata when rebuilding pipelines - #169
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H8NygEHhT3zGMnBmQF2F6Q
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Automatic::FeedMaker.create_pipelinenow preserves standard pipeline item metadata when it rebuilds items into a new feed.source,enclosureandcontent_encoded, which were previously dropped entirely, are now carried over when the item being rebuilt has them.description,author,comments,content_encoded,source,enclosure) is now copied independently via arespond_to?/nil check, replacing the singlebegin/rescue NoMethodErrorblock that previously aborted the rest of the fields whenever any one of them raised.FilterLimit) confirming that metadata survives a real filter that usescreate_pipeline.Reason
The pipeline item contract in doc/REQUIREMENTS.md and doc/PLUGINS.md describes
source,enclosureandcontent_encodedas standard item fields, butcreate_pipelinenever 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 raisedNoMethodError. 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 --versionand--help— succeeded.During implementation, running the full plugin suite caught a real regression in an early version of this change:
Automatic::FeedMaker::FeedObject(used bySubscriptionText) has nopubDatemethod at all, and an unconditionalfeed.pubDatebroke it. The fix guards the date field the same way as the other optional fields (respond_to?(:pubDate), falling back toTime.now), which is what the full-suite run above confirms.Compatibility
Automatic::FeedMaker.create_pipeline's public call shape and return type are unchanged.FilterLimit'smax_itemsbehavior) are unchanged; the new test inspec/plugins/filter/limit_spec.rbexplicitly re-asserts the existing count/ordering behavior alongside the new metadata assertions.Automatic::FeedMaker.generate_feed's placeholder (FeedObject) semantics are unchanged.VERSION, Recipe, or CLI change.Version History
Recorded as one independent release item under the existing unreleased
v26.09section ofdoc/VERSIONS:VERSIONremains26.09; no version bump.🤖 Generated with Claude Code
https://claude.ai/code/session_01H8NygEHhT3zGMnBmQF2F6Q
Generated by Claude Code