Skip to content

[hotfix][api][java] Move ResourceContext lookup factory to test utilities - #1349

Merged
wenjin272 merged 1 commit into
apache:mainfrom
wenjin272:codex/resource-context-test-helper
Nov 2, 2026
Merged

wenjin272 merged 1 commit into
apache:mainfrom
wenjin272:codex/resource-context-test-helper

Conversation

@wenjin272

@wenjin272 wenjin272 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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.

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.

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
  • doc-not-needed
  • doc-included

Was this patch authored or co-authored using generative AI tooling?

  • Yes
  • No

Generated-by: Codex CLI 0.153.4 (GPT-6; exact model version unavailable)

…ties

Move ResourceContext.fromGetResource() to TestResourceContexts in the API
test-jar and migrate Java test callers. Add test-scoped API test-jar
dependencies for integrations and integration E2E tests.

Include the OpenAI Responses and pgvector test callers added on main so
removing the production helper does not break test compilation.

Generated-by: Codex CLI 0.153.4 (GPT-6; exact model version unavailable)
Co-authored-by: Codex <codex@openai.com>
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs fixVersion/1.0.0 The feature or bug should be implemented/fixed in the 1.0.0 version. priority/major Default priority of the PR or issue. labels Nov 2, 2026
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-not-needed Your PR changes do not impact docs labels Nov 2, 2026
@wenjin272 wenjin272 added priority/minor Indicates the PR or issue related to non-urgent bugs, features, and improvements. and removed priority/major Default priority of the PR or issue. labels Nov 2, 2026
@wenjin272
wenjin272 merged commit 6187772 into apache:main Nov 2, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/1.0.0 The feature or bug should be implemented/fixed in the 1.0.0 version. priority/minor Indicates the PR or issue related to non-urgent bugs, features, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant