Skip to content

refactor: compile fess-crawler-opensearch against the forked OpenSearch package - #208

Merged
marevol merged 1 commit into
mainfrom
fork/opensearch-migrate
Sep 14, 2026
Merged

marevol merged 1 commit into
mainfrom
fork/opensearch-migrate

Conversation

@marevol

@marevol marevol commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

fesen-httpclient now carries the OpenSearch DTOs and query builders Fess needs under org.codelibs.fesen.opensearch.*, pruned from 8,578 classes to 3,751, so the 17 MiB org.opensearch:opensearch jar can leave the Fess distribution. fess-crawler-opensearch follows.

This module is the cheapest of the migration: 20 files, an import rewrite, and no pom change. It already declares fesen-httpclient at compile scope, so the forked classes arrive directly; the only non-import hunk is the formatter re-wrapping one FesenClient signature that grew with the longer package name. fess-crawler and fess-crawler-lasta reference OpenSearch nowhere and are untouched.

FesenClient still implements the client interface with its 64 overrides; OpenSearchAccessResult, OpenSearchAccessResultData, OpenSearchUrlQueue and OpenSearchUrlFilter still implement ToXContent; UrlQueueOrder.buildSorts still returns SortBuilder<?>[]. All of those are now the forked types.

The tests needed nothing structural

The four classes that start an embedded node — CrawlerTest, OpenSearchDataServiceTest, OpenSearchUrlFilterServiceTest, OpenSearchUrlQueueServiceTest — never call runner.client(). They hand FesenClient a host:port string and let it speak HTTP, so the node keeps using the real org.opensearch types internally through the test-scope opensearch-runner dependency, and the client under test uses the forked ones. That is the most honest arrangement available: a forked client talking to a genuine OpenSearch server.

FesenClientTest mocks the client interfaces with Mockito; only the import prefix changes. opensearch-runner stays at test scope — it is now the only thing pulling the real server jar, which is correct, and it must stay or the node cannot boot.

Verification

mvn clean package over the whole reactor — 2,125 tests, 0 failures (fess-crawler 2,057, fess-crawler-lasta 15, fess-crawler-opensearch 53). No test was deleted or weakened.

Ordering

Requires codelibs/fesen-httpclient#43 (and #42) to be released first. fess-suggest, fess and five plugin repositories have matching branches and ship together.

…ch package

fesen-httpclient now ships the OpenSearch DTOs and query builders under
org.codelibs.fesen.opensearch, so org.opensearch:opensearch is no longer
inherited transitively. Rewrite every org.opensearch reference in the
module - 147 imports and 6 fully-qualified inner-class references in
FesenClient - to the forked package.

The four node-booting tests need no structural change: they drive
FesenClient over HTTP via a host:port system property and never touch
runner.client(), so the embedded node keeps using the real org.opensearch
types from the test-scope opensearch-runner dependency.
@marevol marevol self-assigned this Sep 14, 2026
@marevol marevol added this to the 15.9.0 milestone Sep 14, 2026
@marevol
marevol merged commit 9b6bbff into main Sep 14, 2026
1 check failed
marevol added a commit that referenced this pull request Sep 14, 2026
#209)

The package rename in #208 was applied to every `org.opensearch.*` reference
without checking that each type survived the fork. `PitSegmentsRequest` did not:
fesen-httpclient's `Client` no longer declares `pitSegments`, so the rewritten
import resolves to nothing and the method is an `@Override` of nothing.

The PR's CI could not have caught this - it was red for the whole of its life
because the forked fesen-httpclient was unpublished, so `fess-crawler-opensearch`
never actually compiled there.

Removed the method and the two imports it needed. Every other
`org.codelibs.fesen.opensearch.*` name the module references was checked against
the published jar's 2,491 classes; this was the only one missing.
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