Skip to content

docs: fix final review lows for 1.0.0rc1 - #324

Merged
uniqueg merged 3 commits into
devfrom
docs/final-review-lows
Nov 1, 2026
Merged

uniqueg merged 3 commits into
devfrom
docs/final-review-lows

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

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.

  • L1: upgrade steps "From 0.6.0" say that the Helm chart's default cloudRegistry.image is now docker.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).
  • L2: docs/configuration.md no longer names an identity provider ("e.g., at an open identity provider"). test_repository_generic now searches the whole text of each file, with ls[\s-]+login (case-insensitive), so names split across a line break are found; test_idp_specific_pattern covers that. Before the reword the test failed with docs/configuration.md:307: 'LS\nLogin'; after it, it passes.
  • L5: "Stored services" documents that, with response validation on, a service whose organization lacks name or url (data written outside the API) makes GET /services/{serviceId} and the whole GET /services list 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 string name and url, so it can't leave {}; a find lists all other (broken) services, including null values, arrays and scalars, and a compare-and-set updateOne sets both fields only while the service is still broken (after Sourcery's review).
  • L6: test_create_app_organization_fields in tests/test_app.py: the startup warning names the service ID, GET returns 200, and PUT with the body unchanged returns 400 ('blob' was unexpected). It fails if the warn_organization_fields() call in create_app() is removed (checked).
  • Doc nit: max_unused_service_types: 0 lets only admins add types; users other than admins can then only register services with registered types (as test_unused_types_none checks). The doc no longer suggests they can add the types of new services.
  • Release notes: a Documentation bullet for this PR.

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: passed
  • python scripts/release_notes.py check docs/releases/1.0.0rc1.md: passed
  • The mongosh examples of "Stored services", run as written in a throwaway mongo:7.0 container against services with extra fields, {}, {name}, null values, arrays, scalars and no organization: the clean-up matches only valid objects, the find lists exactly the others, and after the repair none is broken.
  • CI on 97d0636: passed (all jobs, including the chart tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG

- 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
@uniqueg uniqueg added this to the v1.0.0-rc1 milestone Nov 1, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Resolves 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 data

flowchart 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]
Loading

File-Level Changes

Change Details Files
Clarifies 1.0.0rc1 upgrade and configuration guidance for image migration, invalid stored service organizations, and service-type limits.
  • Documents adapting allow-lists, admission policies, and mirror rules for the fully qualified Helm image.
  • Explains 500 responses caused by stored organizations missing name or url, and provides safe discovery and repair commands.
  • Corrects the behavior of max_unused_service_types: 0 and removes the identity-provider-specific example.
docs/configuration.md
docs/releases/1.0.0rc1.md
docs/upgrading.md
Adds regression coverage for startup handling of stored services with unsupported organization fields.
  • Verifies startup warnings include the affected service ID.
  • Verifies such services remain readable but unchanged updates are rejected.
tests/test_app.py
Strengthens repository-wide checks against identity-provider-specific names split across lines.
  • Scans complete UTF-8 file contents instead of individual lines.
  • Allows whitespace, including newlines, between LS and Login.
  • Adds focused matching tests and preserves line-number diagnostics.
tests/test_config.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (01a560e) to head (a21c982).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 1, 2026 20:32

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/upgrading.md Resolved
Comment thread docs/upgrading.md Resolved
Comment thread docs/upgrading.md Resolved
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
@uniqueg
uniqueg merged commit 4a43ed0 into dev Nov 1, 2026
40 of 44 checks passed
@uniqueg
uniqueg deleted the docs/final-review-lows branch November 1, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: fix final review lows for 1.0.0rc1

1 participant