Skip to content

Add --async_replication_config option to create/update collection#164

Merged
jfrancoa merged 9 commits intomainfrom
jose/async-replication-collection-params
May 7, 2026
Merged

Add --async_replication_config option to create/update collection#164
jfrancoa merged 9 commits intomainfrom
jose/async-replication-collection-params

Conversation

@jfrancoa
Copy link
Copy Markdown
Collaborator

@jfrancoa jfrancoa commented Mar 25, 2026

Summary

  • Add --async_replication_config key=value repeatable option to create collection and update collection commands
  • Exposes 14 async replication tuning parameters (max_workers, frequency, propagation_concurrency, etc.) from weaviate-python-client PR #1953
  • Uses a single repeatable option with key=value pairs instead of 14 individual flags to keep the CLI clean
  • Add parse_async_replication_config() helper in utils.py with key/value validation
  • Add unit tests for the parser and both create/update collection paths

Closes #163

Usage

# Create with async replication config
weaviate-cli create collection --collection MyCol --async_enabled \
  --async_replication_config max_workers=10 \
  --async_replication_config frequency=60 \
  --async_replication_config propagation_concurrency=4

# Update async replication config
weaviate-cli update collection --collection MyCol \
  --async_replication_config max_workers=20 \
  --async_replication_config propagation_batch_size=100

Test plan

  • make lint passes
  • make test passes (283/283)
  • Manual test with Weaviate >= v1.34.18

🤖 Generated with Claude Code

Copy link
Copy Markdown

@orca-security-eu orca-security-eu Bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new repeatable --async_replication_config key=value option to the CLI to expose async replication tuning parameters when creating/updating collections, including parsing/validation logic and unit tests to cover the new behavior.

Changes:

  • Introduces parse_async_replication_config() and a validated key allowlist for async replication tuning parameters.
  • Wires async_config into collection create/update replication config via the Python client configuration objects.
  • Adds unit tests for the parser and manager create/update paths; updates operating docs for the new option.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
weaviate_cli/utils.py Adds allowlisted keys and a parser to convert repeatable key=value tuples into a validated dict of ints.
weaviate_cli/managers/collection_manager.py Passes parsed async replication config into wvc.Configure/Reconfigure.*.async_config(...) when present.
weaviate_cli/defaults.py Adds defaults entries for the new CLI option.
weaviate_cli/commands/create.py Adds Click option and passes parsed async replication config into CollectionManager.create_collection(...).
weaviate_cli/commands/update.py Adds Click option and passes parsed async replication config into CollectionManager.update_collection(...).
test/unittests/test_utils.py Adds unit tests for the async replication config parser (happy path + error cases).
test/unittests/test_managers/test_collection_manager.py Adds tests asserting asyncConfig is set/omitted on create/update replication config.
.claude/skills/operating-weaviate-cli/references/collections.md Documents the new option and provides examples for create/update.
.claude/skills/operating-weaviate-cli/SKILL.md Updates the “operating” skill docs with the new option and examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread weaviate_cli/managers/collection_manager.py
Comment thread weaviate_cli/commands/create.py Outdated
Comment thread weaviate_cli/commands/update.py Outdated
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread weaviate_cli/managers/collection_manager.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread weaviate_cli/utils.py Outdated
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread .claude/skills/operating-weaviate-cli/references/collections.md Outdated
Comment thread .claude/skills/operating-weaviate-cli/SKILL.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup.cfg Outdated
Comment thread requirements-dev.txt Outdated
Comment thread weaviate_cli/utils.py
@jfrancoa jfrancoa force-pushed the jose/async-replication-collection-params branch from 68f553a to 9ebab2b Compare March 27, 2026 13:28
jfrancoa and others added 6 commits May 5, 2026 16:30
Expose the 14 async replication tuning parameters from weaviate-python-client
PR #1953 via a single repeatable --async_replication_config key=value option.
This avoids bloating the CLI with 14 individual flags while letting users
configure any subset of parameters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Reject --async_replication_config when --async_enabled is not set (create)
- Reject --async_replication_config when --async_enabled is False (update)
- Warn when server version is older than v1.36.0
- Generate Click help text from ASYNC_REPLICATION_CONFIG_KEYS constant
- Add validation tests for both create and update paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add --async_enabled prerequisite to help text, SKILL.md, and collections.md
- Point weaviate-client dependency to jose/fix-async-repl-config-get branch
- Update setup.cfg install_requires to match

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add --async_enabled prerequisite to help text, SKILL.md, and collections.md
- Point weaviate-client dependency to jose/fix-async-repl-config-get branch
- Update setup.cfg install_requires to match
- Change minimum version to 1.34.18

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Support "reset" keyword to revert all async replication settings to
server defaults. Use `is not None` checks so empty dict (reset) is
correctly forwarded as an empty async_config() call. Update version
references to v1.34.18.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread weaviate_cli/utils.py
Comment thread weaviate_cli/utils.py
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread weaviate_cli/defaults.py Outdated
- Use ASYNC_REPLICATION_CONFIG_RESET constant in parser instead of literal
- Remove unused async_replication_config field from CreateCollectionDefaults and UpdateCollectionDefaults
- Reject --async_replication_config 'reset' on create (no semantics for new collections)
- Tighten type annotations: tuple -> Tuple[str, ...]
- Drop trivially-dead `if result else None` return
- Add unit tests for old-version warning path (create + update)
- Add unit test for update reset path asserting Reconfigure.Replication.async_config() is invoked with no kwargs

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jfrancoa jfrancoa force-pushed the jose/async-replication-collection-params branch from 9ebab2b to 5985492 Compare May 5, 2026 15:56
@jfrancoa jfrancoa requested a review from Copilot May 5, 2026 15:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread weaviate_cli/utils.py
Comment thread weaviate_cli/commands/create.py
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread weaviate_cli/managers/collection_manager.py
Comment thread .claude/skills/operating-weaviate-cli/SKILL.md Outdated
Comment thread .claude/skills/operating-weaviate-cli/references/collections.md Outdated
- Let click.UsageError propagate from create_collection_cli so Click renders
  it as a proper usage error instead of being swallowed by except Exception
- Clarify in ASYNC_REPLICATION_CONFIG_HELP that "reset" is update-only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jfrancoa
Copy link
Copy Markdown
Collaborator Author

jfrancoa commented May 6, 2026

@copilot review

…to v1.36.0 everywhere

Agent-Logs-Url: https://github.com/weaviate/weaviate-cli/sessions/712f888c-8664-4b19-8539-a7754385e328

Co-authored-by: jfrancoa <23482278+jfrancoa@users.noreply.github.com>
@jfrancoa jfrancoa merged commit fe9cdc8 into main May 7, 2026
18 checks passed
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.

Add --async_replication_config option to create/update collection

3 participants