Repository navigation
docs: fix final review lows for 1.0.0rc1 - #324
Conversation
- Upgrade steps from 0.6.0: the fully qualified default image of the
Helm chart, and the operator action in the release notes (L1)
- Configuration: name no identity provider; the identity provider test
searches whole files, so that names split across lines are found (L2)
- Stored services: services whose organization lacks name or url fail
GET responses, also of the whole list; the clean-up example no longer
leaves an organization of {} (L5)
- Test that create_app() warns of extra organization fields (L6)
- Configuration: max_unused_service_types 0 lets users other than
admins add no types at all, as the backend does
Refs #323
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Reviewer's GuideResolves the remaining 1.0.0rc1 documentation review findings by updating upgrade, configuration, stored-service, and release-note guidance, while adding regression coverage for invalid organization data and repository text patterns. No application code, configuration, CI, or chart behavior changes. Flow diagram for recovering stored services with invalid organization dataflowchart TD
A[Stored service organization lacks name or url] --> B["GET /services/{serviceId}"]
A --> C[GET /services]
B --> D[500 Internal Server Error]
C --> D
A --> E[find]
E --> F[updateOne sets organization.name and organization.url]
F --> G[Service responses succeed]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Refs #323 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #324 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 2368 2368
=========================================
Hits 2368 2368 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/upgrading.md" line_range="424" />
<code_context>
+)
+db.getSiblingDB("serviceStore").services.updateOne(
+ {id: "<id>"},
+ {$set: {"organization.name": "<name>", "organization.url": "<URL>"}},
+)
```
</code_context>
<issue_to_address>
**Concurrent repairs overwrite newer data**
When an owner or admin repairs a listed service through the API while an operator is applying the MongoDB repair, the id-only `updateOne` writes the operator’s chosen `name` and `url` even if an owner or admin has repaired the service through `PUT /services/{serviceId}` after the `find`; the database script then overwrites those newer values with stale ones.
Use a compare-and-set filter matching the organization observed by `find` (and verify the update matched), or coordinate the repair so API updates cannot overlap.
</issue_to_address>
### Comment 2
<location path="docs/upgrading.md" line_range="398" />
<code_context>
- }}}}},
-])
+db.getSiblingDB("serviceStore").services.updateOne(
+ {id: "<id>", "organization.name": {$exists: true}, "organization.url": {$exists: true}},
+ [
+ {$set: {organization: {$arrayToObject: {$filter: {
</code_context>
<issue_to_address>
**Cleanup leaves services uncleaned**
When a non-object `organization` value, such as an array, matches either dotted-field query, the cleanup pipeline passes that value to `$objectToArray`, which errors and leaves the service uncleaned; the recovery update can also fail when setting nested fields under a scalar.
Restrict the cleanup and recovery queries to object values, or guard their updates so they handle non-object values.
Also at `docs/upgrading.md:419-425`.
</issue_to_address>
### Comment 3
<location path="docs/upgrading.md" line_range="420" />
<code_context>
+```javascript
+db.getSiblingDB("serviceStore").services.find(
+ {$or: [{"organization.name": {$exists: false}}, {"organization.url": {$exists: false}}]},
+ {_id: 0, id: 1, organization: 1},
+)
+db.getSiblingDB("serviceStore").services.updateOne(
</code_context>
<issue_to_address>
**Null organization fields stay undiscovered**
When an externally written service has `organization.name` or `organization.url` set to `null`, the `find` query excludes fields that exist with a `null` value, even though response validation rejects those values too. Operators following this recovery step therefore won't find those services, and their requests will keep returning 500.
Extend the recovery query to include null-valued required fields, and describe how to find and repair other invalid field values.
</issue_to_address>Linked issues
#323 docs: fix final review lows for 1.0.0rc1 · 6 of 6 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Only docs and tests change. | ✅ Met | The diff changes documentation and tests only. |
| 2 | Document the fully qualified Helm image and operator action in the upgrade guide and release notes. | ✅ Met | The upgrade guide names the new image and the allow-lists, admission policies, and mirror rules to adapt; the release notes include the same operator action. |
| 3 | Remove the identity-provider example and make the repository test catch names split across lines. | ✅ Met | The configuration example now says “at an open identity provider”; the test scans whole file texts with a whitespace-tolerant pattern and includes a split-line regression case. |
| 4 | Document failures for stored services missing organization fields and provide cleanup that finds or fixes them. | ✅ Met | The stored-services guide documents the validated GET failures and provides queries to find missing fields and set both fields or delete the services. |
| 5 | Add create_app-level coverage for the organization-fields warning, successful GET, and rejected unchanged PUT. | ✅ Met | The new test checks the warning names the service ID, GET returns 200, and PUT returns 400. |
| 6 | Clarify that max_unused_service_types: 0 lets only admins add types. | ✅ Met | The configuration guide says non-admins can then only register services with already-registered types. |
Sourcery assessment
Approval pending. 3 findings to address first.
Blocking findings: docs/upgrading.md:424, docs/upgrading.md:398, docs/upgrading.md:420
The clean-up and repair examples for stored organizations match only objects with string name and url (clean-up), or everything else (repair), so that arrays, scalars and null values are found and fixed, and a repair via the API in the meantime is not overwritten. Checked in mongosh on MongoDB 7.0. Refs #323 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Closes #323
Summary
Low findings L1, L2, L5 and L6 of the final pre-release review of 1.0.0rc1, plus one doc nit. Only docs and tests change; no app code.
cloudRegistry.imageis nowdocker.io/elixircloud/cloud-registry, so allow-lists, admission policies and mirror rules that match the short name need adapting. The release notes' Fixes bullet names that operator action too (still under Fixes).docs/configuration.mdno longer names an identity provider ("e.g., at an open identity provider").test_repository_genericnow searches the whole text of each file, withls[\s-]+login(case-insensitive), so names split across a line break are found;test_idp_specific_patterncovers that. Before the reword the test failed withdocs/configuration.md:307: 'LS\nLogin'; after it, it passes.nameorurl(data written outside the API) makesGET /services/{serviceId}and the wholeGET /serviceslist return 500 until both are set (confirmed locally with a throwaway test for{},{name}and{blob}: 500, 500, while other services stay 200). The clean-up example now matches only organizations that are objects with stringnameandurl, so it can't leave{}; afindlists all other (broken) services, including null values, arrays and scalars, and a compare-and-setupdateOnesets both fields only while the service is still broken (after Sourcery's review).test_create_app_organization_fieldsintests/test_app.py: the startup warning names the service ID,GETreturns 200, andPUTwith the body unchanged returns 400 ('blob' was unexpected). It fails if thewarn_organization_fields()call increate_app()is removed (checked).max_unused_service_types: 0lets only admins add types; users other than admins can then only register services with registered types (astest_unused_types_nonechecks). The doc no longer suggests they can add the types of new services.Light lane
Only docs and tests change (no app code, config, CI or chart), so the reviewer subagents were skipped; I reviewed the diff myself.
Verification
pre-commit run --all-files: all hooks passed (ruff, ruff format, mypy, semgrep, gitleaks, actionlint, ast-grep)coverage run --source cloud_registry,scripts -m pytest(mongomock): all tests pass except the chart tests (tests/test_chart.py,TestChartOverlay), which could not run locally because Helm isn't installed here (only a mise shim); CI runs them. Coverage 100%.mkdocs build --strict: passedpython scripts/release_notes.py check docs/releases/1.0.0rc1.md: passedmongo:7.0container against services with extra fields,{},{name}, null values, arrays, scalars and no organization: the clean-up matches only valid objects, thefindlists exactly the others, and after the repair none is broken.🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG