fix: stylesheets not included in feed #779
Merged
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.
This pull request introduces a mechanism to automatically merge global stylesheet configurations into individual feed configs when they do not already define their own stylesheets. This ensures that all feeds can benefit from a consistent global stylesheet unless overridden, and the logic is thoroughly tested to avoid unwanted side effects.
Feed configuration enhancements:
merge_global_stylesheets
method toLocalConfig
, which merges global stylesheets into a feed config if the feed does not already specify its own stylesheets. The method duplicates the config to prevent mutation when merging.find
method inLocalConfig
to usemerge_global_stylesheets
, ensuring feeds retrieved via.find
automatically include global stylesheets when appropriate.app.rb
, so all feeds processed by the app have global stylesheets merged as needed.Testing improvements:
merge_global_stylesheets
inspec/html2rss/web/app/local_config_spec.rb
, covering scenarios where configs already have stylesheets, where global stylesheets exist or not, and ensuring config objects are not mutated..find
to verify that stylesheet merging works as expected when retrieving feed configs.