Skip to content

fix!: follow the registry's camelCase names - #563

Merged
uniqueg merged 3 commits into
devfrom
fix/registry-camelcase
Nov 5, 2026
Merged

uniqueg merged 3 commits into
devfrom
fix/registry-camelcase

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Cloud Registry 1.0.0rc2 moved its API additions to camelCase, without aliases, so the create form no longer found the registration rules and silently offered its default environments. This moves @elixir-cloud/cloud-registry to the new names.

  • The form reads registrationRules of GET /service-info.
  • RegistrationRules and RegistryServiceInfo use urlSchemes, serviceTypes and maxUnusedServiceTypes, and gain maxServicesPerUser, checked against additions.openapi.yaml of the registry at d3e4fd7.
  • Comments and docs name mayAddServiceTypes of GET /me, and 1.0.0rc2 as the first version with these names.

Of the renamed fields, the package only used these. It has no calls to /me, permissions, invitations, approvals or verifications, and no other package or the docs app reads the renamed fields. A search for all old names in the rename table finds only the deliberate mentions of registration_rules, and config keys such as custom.access_control.service_types, which stay in snake_case.

Breaking change

The form no longer reads registration_rules. Against Cloud Registry 0.6.0 to 1.0.0rc1, and custom providers with those names, it logs a warning and uses its properties, as providers.mdx says. The registry has no aliases, and the issue asks to move to the new names, so there is no fallback to the old ones.

The wrapper withFormRules() of cloud-registry-ui keeps working with this change, since it adds registration_rules and leaves registrationRules in place; the form doesn't warn then, and the wrapper can go once the UI uses a release with this change.

How it was verified

  • Failing tests first: the new tests failed on dev (3 failed in Chromium and in Firefox), and pass now.
  • Tests of the package with web-test-runner, Chromium and Firefox: 45 passed each, 0 failed.
  • npm run lint, which includes the build of all packages and the docs, through the commit hook: passed.
  • tsc of the package: no errors outside test files, whose errors come from missing mocha globals and a duplicate lit-html type, not from this change.
  • CI: see the checks of this pull request; all passed for the pushed commit (Node 22 and 24, with Chromium, Firefox and WebKit)

Not run locally:

  • WebKit: its Playwright browser isn't installed on this machine; CI runs it.
  • Tests of other packages, which this change doesn't touch; CI runs them.
  • Against a running registry: the tests use stubbed service info with the fields of the registry's OpenAPI specification at d3e4fd7. No end-to-end test exists in this package.

Declined review findings

  • Warn only once per element (low): the warning repeats only when the rules load again, i.e. for a new provider, which is rare.
  • Model name in the commit trailer (low): the trailer is the one this session is meant to use.
  • Publish only after the registry's rc2 (low): a release matter, not a change here; noted for the release.

Closes #562

🤖 Generated with Claude Code

Summary by Sourcery

Adopt Cloud Registry 1.0.0rc2 camelCase registration rule names across the service creation form, provider types, tests, and documentation.

Bug Fixes:

  • Update service creation forms to consume Cloud Registry 1.0.0rc2 camelCase registration rules, preventing supported registry environments from being replaced by defaults.
  • Warn when only the legacy snake_case registration rules are provided, while preserving default-property fallback behavior.

Enhancements:

  • Align registry provider interfaces and registration rule fields with the current Cloud Registry API, including per-user service limits.
  • Update Cloud Registry documentation to describe the camelCase API names and 1.0.0rc2 compatibility.

Documentation:

  • Update service creation and provider documentation for camelCase registration rules and mayAddServiceTypes.

Tests:

  • Add coverage for camelCase registration rules, empty environment lists, legacy-name warnings, provider failures, and fallback behavior.

uniqueg and others added 2 commits November 4, 2026 07:14
Cloud Registry 1.0.0rc2 moved its API additions to camelCase, without
aliases, so the create form no longer found the registration rules and
silently offered its default environments.

Read registrationRules and rename the fields of RegistrationRules, which
also gains maxServicesPerUser. The form doesn't read the former names:
against Cloud Registry 0.6.0 to 1.0.0rc1, and custom providers with those
names, it warns and uses its properties, as the docs say. Also name
mayAddServiceTypes of GET /me in the comments and docs.

BREAKING CHANGE: custom providers must return registrationRules with the
new field names, and the types of RegistrationRules changed.

Closes #562

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move it to a helper, ignore empty former names, and test those and a
failing service info after a provider with rules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Migrates Cloud Registry integration and documentation to the 1.0.0rc2 camelCase service-info contract, with deliberate rejection and warning for legacy registration_rules data, while preserving defaults and property-based fallback behavior. Tests cover the new contract, legacy compatibility boundary, and provider changes.

Sequence diagram for loading Cloud Registry registration rules

sequenceDiagram
    participant Form as ServiceCreateForm
    participant Provider as CloudRegistryProvider
    participant Registry as CloudRegistry

    Form->>Provider: getServiceInfo()
    Provider->>Registry: GET /service-info
    Registry-->>Provider: RegistryServiceInfo.registrationRules
    Provider-->>Form: RegistryServiceInfo
    Form->>Form: Read registrationRules.environments
    Form-->>Form: Offer registry environments
Loading

Sequence diagram for legacy registration rules fallback

sequenceDiagram
    participant Form as ServiceCreateForm
    participant Provider as CloudRegistryProvider
    participant Registry as LegacyRegistry

    Form->>Provider: getServiceInfo()
    Provider->>Registry: GET /service-info
    Registry-->>Provider: registration_rules
    Provider-->>Form: RegistryServiceInfo
    Form->>Form: hasOnlyFormerRules()
    Form-->>Form: console.warn()
    Form-->>Form: Use form properties and defaults
Loading

File-Level Changes

Change Details Files
Migrated registry service-info and registration-rule models from the pre-1.0.0rc2 snake_case API to the registry’s camelCase API, including the new per-user service limit.
  • Renamed registrationRules and all consumed rule fields to camelCase.
  • Added optional maxServicesPerUser to the registration rules type.
  • Updated version and API-name documentation, examples, and comments.
packages/ecc-client-elixir-cloud-registry/src/providers/cr-provider.ts
apps/documentation/pages/docs/cloud-registry/components/service-create.mdx
apps/documentation/pages/docs/cloud-registry/providers.mdx
Updated the create form to consume registrationRules and explicitly handle providers exposing only the former registration_rules field.
  • Read environments from registrationRules and retain property/default fallback behavior when rules are absent.
  • Detect non-null legacy registration_rules, warn that it is ignored, and avoid compatibility fallback.
  • Continue accepting new rules when both old and new fields are present.
packages/ecc-client-elixir-cloud-registry/src/components/service-create/service-create.ts
Added coverage for camelCase rule handling, fallback behavior, warnings, and provider transitions.
  • Tested allowed environments, unrestricted environments, defaults, and legacy-name warnings.
  • Tested precedence when both names exist and suppression for nullish legacy values.
  • Tested clearing rules after a subsequent provider’s service-info request fails.
packages/ecc-client-elixir-cloud-registry/src/components/service-create/tests/service-create.test.ts

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

@read-the-docs-community

read-the-docs-community Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cloud-components | 🛠️ Build #35659918 | 📁 Comparing a123ea6 against latest (70de380)

  🔍 Preview build  

2 files changed
± docs/cloud-registry/providers/index.html
± docs/cloud-registry/components/service-create/index.html

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.40%. Comparing base (70de380) to head (a123ea6).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #563      +/-   ##
==========================================
+ Coverage   70.89%   71.40%   +0.51%     
==========================================
  Files          23       23              
  Lines        5638     5655      +17     
  Branches      190      199       +9     
==========================================
+ Hits         3997     4038      +41     
+ Misses       1636     1610      -26     
- Partials        5        7       +2     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@uniqueg
uniqueg marked this pull request as ready for review November 4, 2026 06:25
@uniqueg
uniqueg requested a review from anuragxxd as a code owner November 4, 2026 06:25
sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Nov 4, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Linked issues

#562 fix: follow the registry's camelCase names · 2 of 2 met

# Requirement Status Notes
1 Move the package to the new camelCase names for all registry additions. ✅ Met The form reads registrationRules; the interfaces use urlSchemes, serviceTypes, maxUnusedServiceTypes and maxServicesPerUser; and the docs/comments use mayAddServiceTypes.
2 Stay compatible with the UI wrapper that adds registration_rules while retaining registrationRules. ✅ Met The form uses the camelCase rules when both names are present and warns only when the former name is present alone; tests cover this behavior.

Sourcery assessment

Approved.


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

@anuragxxd anuragxxd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me! Just a small change.

@sourcery-ai
sourcery-ai Bot dismissed their stale review November 5, 2026 02:22

Sourcery withdrew this approval because the latest commits introduced blocking findings.

@uniqueg
uniqueg merged commit dba860f into dev Nov 5, 2026
19 checks passed
@uniqueg
uniqueg deleted the fix/registry-camelcase branch November 5, 2026 02:27
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.

fix: follow the registry's camelCase names

2 participants