Skip to content

feat(cli-tools): Add --partition flag to stream publish#3262

Merged
teogeb merged 7 commits intomainfrom
cli-tools-publish-to-partition
Dec 8, 2025
Merged

feat(cli-tools): Add --partition flag to stream publish#3262
teogeb merged 7 commits intomainfrom
cli-tools-publish-to-partition

Conversation

@teogeb
Copy link
Copy Markdown
Contributor

@teogeb teogeb commented Dec 8, 2025

Added an optional flag to stream publish to control the target partition.

Default partition

Note that the default value for the partition is undefined, i.e. it publishes to random partition (just like before this PR). In stream-subscribe there is similar flag, which has a default value of 0 (i.e. it subscribes to the first partition).

Test

Improved test coverage by adding tests for partition-related functionality of stream-publish command. Also renamed existing stream-publish-subscribe.test.ts to stream-subscribe.test.ts as those test cases are asserting the subscribe outputs.


Note

Adds --partition to stream publish with validation against --partition-key-field, updates tests, and notes change in changelog.

  • CLI (packages/cli-tools)
    • stream publish: Add --partition option and parse via createFnParseInt; pass { streamId, partition } to client.publish.
    • Validate mutually exclusive use of --partition and --partition-key-field (exit with error on conflict).
  • Tests
    • New stream-publish.test.ts: covers default publish, explicit --partition, and --partition-key-field routing.
    • Refactor stream-subscribe.test.ts: publish via SDK helper instead of CLI; minor renames and typings.
    • Test utils: add nextValue() helper.
  • Docs
    • CHANGELOG.md: document new --partition flag under @streamr/cli-tools.

Written by Cursor Bugbot for commit 3cf7008. This will update automatically on new commits. Configure here.

@github-actions github-actions Bot added the cli-tools Related to CLI Tools Package label Dec 8, 2025
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 28

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread packages/cli-tools/bin/streamr-stream-publish.ts Outdated
@github-actions github-actions Bot added the docs label Dec 8, 2025
Comment thread packages/cli-tools/bin/streamr-stream-publish.ts Outdated
@teogeb teogeb merged commit e34bcc9 into main Dec 8, 2025
24 checks passed
@teogeb teogeb deleted the cli-tools-publish-to-partition branch December 8, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli-tools Related to CLI Tools Package docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants