test: support hermetic local API reference - #819
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the scripts/mock helper to support hermetic/local usage by preferring a locally checked-in/generated OpenAPI spec when available, while preserving the existing .stats.yml URL-based fallback.
Changes:
- If no explicit spec path/URL arg is provided, prefer
api_reference/openapi.transformed.ymlwhen present. - Verify the local spec matches generation metadata by comparing its MD5 hash to
openapi_transformed_spec_hashfrom.castiron.stats.yml. - Retain existing behavior of reading
openapi_spec_urlfrom.stats.ymlwhen local inputs aren’t available.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Thermo-nuclear code-quality review: no high-confidence maintainability findings. The 9-line change stays within the existing URL-resolution boundary; scripts/mock remains 61 lines and no file approaches the 1,000-line threshold. Approved.
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed exact head dbde9b5 against the producer-side hermetic API-reference contract. The mock preserves explicit override precedence and the legacy .stats.yml network fallback, selects only the paired local transformed spec plus Castiron metadata, and fails closed on missing or mismatched transformed hashes. I also checked producer path/hash guarantees, Java packaging and test implications, and exercised the resolution branches with a stubbed Steady invocation. No actionable findings.
Allow the SDK mock server to use a locally available API reference when present, while preserving the existing network-based fallback.