wenjin272 opened a new pull request, #1349: URL: https://github.com/apache/flink-agents/pull/1349
### Purpose of change Move the resource-lookup-only test factory out of the production `ResourceContext` API. Java tests now call `TestResourceContexts.fromGetResource()` from the API test-jar. This is the independent prerequisite cleanup for #1348; Future scheduling and tool execution changes remain in that PR. #### Runtime flow and key decisions Production resource lookup is unchanged. The test factory returns a `ResourceContext` that delegates `getResource` to the supplied function and supplies empty skill defaults. Integration modules and integration E2E tests depend on the API test-jar with test scope, keeping the fixture out of production artifacts. All current Java callers are migrated, including OpenAI Responses, pgvector and vector-store E2E tests added on main. These callers would otherwise fail test compilation when the production factory is removed, as seen in #1348 CI. ### Behavioral Semantics - The lookup function receives the same resource name/type and its return value is unchanged. - Skill prompt, directories and source resolution retain their empty defaults. - Lookup failures propagate unchanged; no retry, fallback or exception conversion is added. - Interaction decisions: not applicable; this is a factory relocation without a new runtime execution path. ### Tests JDK 21: `SKIP_SPOTLESS_CHECK=true bash tools/build.sh -j` passed (full clean install, with tests compiled). The 46 migrated test classes completed with **696 passed, 42 skipped, no failures/errors**. JDK 11 full-reactor Spotless check and `git diff --check` passed. | Contract | Evidence | | --- | --- | | Existing resource lookup and failure behavior | Migrated plan and integration tests use the same lookup functions and assertions. | | Empty skill defaults | Factory body preserved; no new dedicated defaults test. | | All Java consumers compile against the test fixture | Full Java clean build, including integration E2E test compilation. | | Fixture remains test-scoped | Test-jar dependency scopes and production/test JAR contents checked. | Not verified: live model/vector-store services, E2E execution, or Python tests. No Python code changes. ### API Removes the public static Java method `ResourceContext.fromGetResource`. In-repository callers are tests and move to `TestResourceContexts`; external callers of the removed convenience method must implement `ResourceContext` themselves (or use the test fixture in their tests). The remaining `ResourceContext` methods and production lookup behavior are unchanged. ### Documentation - [ ] `doc-needed` - [x] `doc-not-needed` - [ ] `doc-included` ### Was this patch authored or co-authored using generative AI tooling? - [x] Yes - [ ] No Generated-by: Codex CLI 0.153.4 (GPT-6; exact model version unavailable) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
