Repository navigation
fix(api): use local service info schemas - #93
Merged
Merged
Conversation
The registry spec referenced the `Service` and `ServiceType` schemas on raw.githubusercontent.com, so the app fetched them at startup and could not start without network access. The schemas are identical to those in the vendored service info spec, which is merged with the registry spec, so the remote references are removed. App tests now run without network access: sockets are blocked, and the mock identity provider no longer passes other requests through. Closes #76 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fail with a clear message if a vendored specification references a remote schema again, and name the address when tests try to open a network connection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR makes application startup self-contained by removing remote OpenAPI schema references and relying on the vendored service-info specification during merge. Tests now explicitly prohibit network access, reject unexpected identity-provider requests, and validate that all API specification references remain local. Flow diagram for offline specification and app testsflowchart TD
Tests[pytest] --> SpecTest[test_specs_local_refs]
SpecTest --> LocalRefs{All $refs local?}
LocalRefs -->|no| Fail[Fail with blocked address]
LocalRefs -->|yes| AppTests[Application tests]
AppTests --> app_env[app_env]
app_env --> Socket[Block socket.socket.connect]
AppTests --> Identity[Mock identity provider]
Identity --> UnknownURL{Unknown URL?}
UnknownURL -->|yes| Reject[Raise error]
UnknownURL -->|no| Pass[Tests remain offline]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
uniqueg
marked this pull request as ready for review
October 20, 2026 04:07
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #93 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 223 223
=========================================
Hits 223 223 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The app can now start, and the tests can run, without network access (closes #76).
20201108.e0358db.openapi.yaml) referenced theServiceandServiceTypeschemas on raw.githubusercontent.com (ga4gh-service-info v1.0.0), so connexion fetched them at every startup. The vendored service-info spec contains the same schemas: parsed, the whole document equals upstream v1.0.0. FOCA merges that spec with the registry spec, so the remote entries are removed, with a comment in the file.app_envblockssocket.socket.connect, and the mock identity provider raises for unknown URLs instead of passing them through.test_specs_local_refsfails with a clear message if a spec file gets a non-local$refagain.Verification
pytest: 71 passed on Python 3.10 and 3.12 (FOCA 0.14.0).flake8,black --check .andmypy cloud_registrypass.test_specs_local_refsfail.$refkeys, which used to sit next to the merged local properties.typeis rejected in both versions.connect,connect_exandgetaddrinfoblocked for the entire process.Notes
#/components/schemas/ServiceandServiceTyperesolve only when it is merged with the service-info spec, asconfig.yamldoes. A config overlay that replacesapi.specsmust keep both files.connectonly. DNS lookups are not blocked, but no lookups happen in the tests.🤖 Generated with Claude Code
Summary by Sourcery
Make application startup and tests independent of network access by using the locally merged service-info schemas.
Bug Fixes:
Enhancements:
Tests: