Skip to content

Upgrade ROME to 2.1.0 - #260

Open
mraible wants to merge 3 commits into
apache:masterfrom
mraible:rome-2
Open

mraible wants to merge 3 commits into
apache:masterfrom
mraible:rome-2

Conversation

@mraible

@mraible mraible commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Upgrades ROME, the feed library Planet uses, from 1.19.0 to 2.1.0. ROME 2.1.0 targets Java 8 (class file version 52), keeps java.util.Date in its feed model, and renames no packages. The modules it dropped (fetcher, Propono, certiorem) aren't used by Roller.

One behaviour change mattered. For Atom 1.0 feeds, SyndFeed.getLink() now returns the rel="self" link (the feed's own URL) instead of the first alternate link (rometools/rome#538). Planet stores that value as the subscription's site URL, so Atom subscriptions would have linked to the feed instead of the blog. RomeFeedFetcher.siteURL() now takes the first link whose rel is blank or alternate, and falls back to getLink(), which is still the channel link for RSS.

RomeFeedFetcherLocalTest serves feeds from a JDK HttpServer on a random loopback port, so it doesn't need the network. It covers:

  • the Atom site URL, dates with offsets, author, content, categories and the conditional fetch
  • RSS 2.0 pubDate, the dc:date fallback, dc:creator and content:encoded
  • RSS 0.91 item dates
  • that Planet's converters, parser and content module load from rome.properties
  • that a feed with a DOCTYPE is refused

All of it also passes on ROME 1.19.0 with the old code. On 2.1.0 without the fix, the site URL test fails. mvn test passes (665 tests). Planet's feed parsing keeps ROME's own hardened parser setup, which is unchanged in 2.1.0.

ROME 2.1.0 is the latest release on Maven Central. Its classes target Java 8 (class file version 52), so it runs on Roller's Java 17 baseline. Roller depends only on the core rome artifact, with rome-utils 2.1.0 coming in transitively; the modules ROME 2 removed (rome-fetcher, rome-propono, rome-certiorem) were already gone from Roller.

ROME 2 makes an Atom feed's rel="self" link the SyndFeed link, where 1.x used the first alternate link. Planet stores that link as the subscription's site URL, so Atom subscriptions would have linked to the feed instead of the blog. RomeFeedFetcher now takes the first alternate link from the feed's links and falls back to the feed link, which is still the channel link for RSS.

Nothing else Planet relies on changed: dates are still java.util.Date, rome.properties keeps the same keys and the custom parsers, converters and content module still load, and SyndFeedInput still refuses DOCTYPEs and external entities by default.

RomeFeedFetcherLocalTest serves Atom, RSS 2.0 and RSS 0.91 feeds from a loopback server and pins the site URL, entry dates and time zones, authors, content, categories, the conditional fetch, the Planet plugins registered in rome.properties, and the refusal of a feed with a DOCTYPE. All six tests also pass on ROME 1.19.0 with the previous fetcher, and the site URL check fails on 2.1.0 without the fix.

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR-Review: no issues. The ROME 2 getLink() change is caught and tested with a loopback server, including the DOCTYPE refusal. Minor: RomeFeedFetcher.java:167-171 takes the first blank or alternate link whatever its type, so a feed that lists an application/atom+xml or JSON alternate before its text/html one gets the wrong site URL. Preferring type="text/html" (or a blank type), then falling back to the first alternate, would cover it.

A feed that listed an Atom, RSS or JSON alternate before its text/html one got that feed as its site URL. siteURL() now takes the first alternate whose type is text/html or blank, and falls back to the first alternate of any type, then the feed link. Suggested in review.
@mraible

mraible commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

fc2351c takes your suggestion. siteURL() now prefers the first alternate link whose type is text/html or blank. If there isn't one, it falls back to the first alternate of any type, then the feed link. A new test in RomeFeedFetcherLocalTest lists Atom and JSON alternates before the HTML one, plus a feed with only an RSS alternate. It fails without the change.

@mraible
mraible requested a review from snoopdave November 15, 2026 03:00
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.

2 participants