Repository navigation
fix: align service info and query parameter docs - #316
Merged
Merged
Conversation
- In the controlled mode, users other than admins can't add service types, but `/service-info` advertised the configured limit of unused types (e.g., 10). It now gives `max_unused_service_types: 0`, as the schema and docs say (finding L5 of the rc1 pre-release review). - The API docs promised `400` for all extra query parameters, but Connexion only checks those of operations with parameters (`GET /services?x=1` returns 200). The docs now say so, and a test covers it (finding L6). Closes #313 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The config reference, `config.yaml` and the config model said the limit of unused types applies in every mode; they now say that it applies in modes `open` and `moderated`, and is served as `0` in mode `controlled`. - The app-level test keeps the default limit in mode `controlled`, so it checks that the service info serves `0`. - The Errors section says which parameters count (request bodies don't), and the test covers `GET /service-info` too. - Reworded the schema, docstring and API docs. Refs #313 Co-Authored-By: Claude Opus 5.5 <[email protected]>
`POST /services/types?x=1` is accepted, as the Errors section says (request bodies don't count as parameters), and the config example of the unused-types limit uses mode `moderated`, where it applies. Review findings of round 2. Refs #313 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideAlign service-info registration metadata, configuration/API documentation, and regression tests with controlled-mode service-type enforcement and Connexion’s operation-specific extra-query-parameter validation behavior. Sequence diagram for controlled-mode registration rulessequenceDiagram
participant Client
participant ServiceInfo as service_info
participant Config as AccessControlConfig
Client->>ServiceInfo: registration_rules()
ServiceInfo->>Config: get_custom_config(CustomConfig)
Config-->>ServiceInfo: service_types = controlled
ServiceInfo-->>Client: max_unused_service_types = 0
Flow diagram for operation-specific extra query validationflowchart LR
Request[Request with extra query parameter]
Operation{Operation has path, query, or header parameters?}
Reject[400 Bad Request]
Ignore[Query parameter ignored]
Request --> Operation
Operation -->|Yes| Reject
Operation -->|No| Ignore
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #316 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 2366 2368 +2
=========================================
+ Hits 2366 2368 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
November 1, 2026 12:42
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Linked issues
#313 Align service info and query parameter docs · 4 of 4 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Serve max_unused_service_types as 0 in controlled mode, regardless of the configured limit. | ✅ Met | registration_rules() returns 0 in controlled mode, including when the configured limit is null. |
| 2 | Align the schema and documentation with the controlled-mode limit behavior. | ✅ Met | The schema, docstrings, configuration reference, config.yaml, and API docs describe the mode-specific behavior. |
| 3 | Narrow the docs about unknown query parameters to reflect which operations reject them. | ✅ Met | The Errors section distinguishes operations with path, query, or header parameters from parameterless operations. |
| 4 | Test GET /services with an extra query parameter. | ✅ Met | The added parameterized test covers GET /services?x=1. |
Sourcery assessment
Approved.
…-docs # Conflicts: # tests/test_app.py
This was referenced Nov 1, 2026
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
Closes #313 (findings L5 and L6 of the v1.0.0rc1 whole-repo pre-release review).
controlled, users other than admins can't add service types, but/service-infoadvertised the configuredmax_unused_service_types(e.g., 10).registration_rules()now serves0in that mode, whatever the configured limit (alsonull), as the schema already promised. The schema, the docstrings,config.yaml,docs/api.mdanddocs/configuration.mdnow say the limit applies in modesopenandmoderatedand is served as0incontrolled; the config example usesmoderated, where the limit applies.docs/api.md(Errors) promised400for all extra query parameters, but Connexion only checks them on operations with path, query or header parameters. The docs now say so (request bodies don't count; e.g.,GET /services,GET /service-infoandPOST /services/typesignore query parameters). I chose the docs change over a global rejection: a global check would need a hook outside Connexion's validation and could break clients that add cache-busting parameters to reads.Verification
tests/ga4gh/registry/test_service_info.py::test_registration_rules_controlledfailed before the fix;test_registration_rules_follow_config(app level) now keeps the default limit of 10 incontrolledand asserts0;test_extra_query_parameters_without_parameterscoversGET /services?x=1,GET /service-info?x=1andPOST /services/types?x=1.coverage run --source cloud_registry,scripts -m pytest: 1590 passed, 262 skipped (Helm/Docker/MongoDB-only tests); coverage 100%.pre-commit run --all-files: passed.mkdocs build --strict: passed.CI passed).Review
Full lane. Round 1: adversarial lows only (a probe confirmed which operations accept
?x=1); quality two mediums (inconsistent "in every mode" wording in the config docs, model andconfig.yaml; the app-level test passed without the fix), fixed. Round 2 (quality): lows only (config example,POSTcase), fixed.Declined review findings
/service-infochange indocs/releases/1.0.0rc1.md(low): out of scope here; a separate release-docs PR adds this PR to the rc1 notes.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Align service registration metadata and API documentation with the actual access-control and query-parameter validation behavior.
Bug Fixes:
/service-inforegistration rules with controlled service-type access by reportingmax_unused_service_typesas0regardless of its configured value.Enhancements:
Documentation:
Tests: