Skip to content

✨ feat(repository): add Repository.open() unified entry point (#404)#407

Merged
sodre merged 15 commits into
mainfrom
feat/404-repository-open
Feb 20, 2026
Merged

✨ feat(repository): add Repository.open() unified entry point (#404)#407
sodre merged 15 commits into
mainfrom
feat/404-repository-open

Conversation

@sodre

@sodre sodre commented Feb 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Repository.open() as the unified entry point with namespace-first UX and auto-provision (stack not found -> deploy with defaults, namespace not found -> register)
  • Make Repository.builder() fully fluent with zero positional args, adding .stack(), .region(), .endpoint_url() chain methods
  • Remove unreleased Repository.connect() (no deprecation needed since it was never released)
  • Remove local endpoint special-casing for version check and Lambda auto-update
  • Add resolve_stack_name() helper in naming.py for stack resolution from arg -> ZAEL_STACK env var -> "zae-limiter" default
  • Update all documentation (CLAUDE.md, getting-started, API docs, guides, deployment docs) to use open() as the primary entry point
  • Add design document at docs/plans/2026-02-19-repository-open-design.md

Test plan

  • Unit tests for open() fast path (infra + namespace exist)
  • Unit tests for open() auto-provision (infra missing)
  • Unit tests for open() auto-register namespace (infra exists, namespace missing)
  • Unit tests for open() re-raising non-ResourceNotFoundException errors
  • Unit tests for stack name resolution (arg -> env var -> default)
  • Unit tests for namespace resolution from env var
  • Unit tests for builder zero-arg construction with .stack(), .region(), .endpoint_url()
  • Unit tests for deprecation message mentioning open()
  • Existing connect() tests migrated to open()
  • All 2394 unit tests pass with 100% patch coverage

Closes #404

🤖 Generated with Claude Code

sodre and others added 3 commits February 19, 2026 18:39
Design for unified entry point with namespace-first UX, auto-provision,
fluent builder, and local endpoint special-casing cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Repository.connect() with Repository.open() as the single
recommended entry point. Namespace is now the primary positional arg,
stack defaults via ZAEL_STACK env var or "zae-limiter", and namespace
defaults via ZAEL_NAMESPACE env var or "default".

Key changes:
- Add Repository.open() with auto-provision (deploys stack if missing,
  registers namespace if not found)
- Make RepositoryBuilder zero-arg with .stack(), .region(), .endpoint_url()
  fluent methods
- Remove local endpoint special-casing in version check (runs everywhere)
- Remove connect() (unreleased, no deprecation needed)
- Add resolve_stack_name() and resolve_namespace_name() to naming.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ndException errors (#404)

Cover the else branch in Repository.open() that re-raises ClientError
when the error code is not ResourceNotFoundException.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sodre sodre added this to the v0.10.0 milestone Feb 20, 2026
@sodre sodre added api-design API surface changes area/limiter Core rate limiting logic labels Feb 20, 2026
@codecov

codecov Bot commented Feb 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.80%. Comparing base (55bb4c0) to head (7739654).
⚠️ Report is 16 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   91.76%   91.80%   +0.03%     
==========================================
  Files          33       33              
  Lines        7333     7367      +34     
==========================================
+ Hits         6729     6763      +34     
  Misses        604      604              
Flag Coverage Δ
doctest 29.67% <68.85%> (+0.14%) ⬆️
e2e 43.91% <81.96%> (+1.22%) ⬆️
integration 51.73% <81.96%> (-0.12%) ⬇️
unit 91.54% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ct()/builder(args) to open()/builder() (#404)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread tests/benchmark/test_aws.py Fixed
Comment thread tests/benchmark/test_aws.py Fixed
sodre and others added 3 commits February 19, 2026 22:22
…onstructor param (#404)

SyncRepository.open() is generated from async Repository.open() and
doesn't accept parallel_mode. Set it directly on the repo instance
after construction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rator (#404)

Update generate_sync.py to target open() instead of the removed
connect() when injecting the sync-only parallel_mode parameter.
Revert test workaround to use the proper keyword argument.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…)/builder() (#404)

Update all documentation files and one missed e2e test to use the new
Repository.open() and zero-arg builder() APIs. Fixes 21 doctest failures
and the test_namespace_cli_lifecycle integration failure in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sodre sodre marked this pull request as ready for review February 20, 2026 05:46
…x LocalStack doc (#404)

Add test verifying _check_and_update_version_auto runs when endpoint_url
is set (no local endpoint skip). Update LocalStack docs to use
Repository.open() instead of builder with enable_aggregator(False).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@github-actions github-actions 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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.40.

Benchmark suite Current: 90f5068 Previous: 55bb4c0 Ratio
tests/benchmark/test_operations.py::TestOptimizationComparison::test_cascade_cache_enabled 130.03580261305905 iter/sec (stddev: 0.023304082880899784) 183.5925467475057 iter/sec (stddev: 0.00022160107543068607) 1.41

This comment was automatically generated by workflow using github-action-benchmark.

sodre and others added 7 commits February 20, 2026 02:21
…on (#404)

Most doc examples were using Repository.open(stack="...", region="...") which
gives the wrong impression that stack/region are required. Since open() defaults
to sensible values (stack="zae-limiter", namespace="default"), examples should
use the simpler form. Billing/api isolation examples now use namespaces instead
of separate stacks, which better represents the intended usage pattern.

Also patches SyncRepository in doctest fixtures so sync examples using the
default stack name work against moto.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…#404)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…xamples (#404)

Replace imperative open() + set_system_defaults() with declarative
builder().namespace().on_unavailable().build() in the "Choose Based on
Risk" section. Also register "billing" and "api" namespaces in doctest
fixtures so builder examples can resolve them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…oyment guide (#404)

The deployment page is about infrastructure provisioning, so examples
should use Repository.builder() rather than Repository.open(). Also
mention both open() and builder().build() as auto-registering the
default namespace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pace (#404)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…paces (#404)

The note incorrectly stated that namespaces must be pre-registered for
CLI data-access commands. Repository.open() auto-registers namespaces
if they don't exist yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@sodre sodre left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

@sodre sodre merged commit 32429c9 into main Feb 20, 2026
17 checks passed
@sodre sodre deleted the feat/404-repository-open branch February 20, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-design API surface changes area/limiter Core rate limiting logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Repository.open() unified entry point with namespace-first UX and auto-provision

1 participant