-
Notifications
You must be signed in to change notification settings - Fork 95
Support bulk subs creation in client and add --bulk to CLI to invoke it #1119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
65d5eac
Support bulk subs creation in client and add --bulk to CLI to invoke it
goldenberg 607e62e
Update to parse referenced list of subs, and add an integration test
goldenberg 79e209d
Add test_bulk_create_subscription_success_sync
goldenberg 7678ace
Define dedicated `subscriptions bulk-create` command instead of --bul…
goldenberg 0ed8e82
Add documentation for new bulk cli command
goldenberg 8c36027
fixup! Add test_bulk_create_subscription_success_sync
goldenberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm split on whether or not the CLI bulk create path should be an optional flag on the standard
create
argument as you have implemented here (e.g.create --bulk
), or if it should be it's own argument (e.g.bulk
,bulk create
,bulk_create
,create_bulk
, etc).Including an optional
--bulk
flag on the standardcreate
command implies that the--bulk
flag modifies the behavior of thecreate
command. This isn't really the case though because bulk create has it's own API endpointPOST /subscriptions/v1/bulk
. Thinking forward, it might be difficult to enhance and/or modify the bulk create path in the CLI if tightly couple it with the standard create path.Defining the bulk create path as a distinct argument implies that this is a distinct path, separate from the standard create path. Keeping the paths separate should make it easier to enhance and/or modify the bulk create CLI UX without getting wires crossed with the standard create path.
One more thing to think about is that the payloads for the two paths are slightly different. The standard create path expects a single object of subscription criteria, and the bulk create path expects an array of objects that define subscription criteria. I can see supporting two different request data structures for the same
create
command, and driven by the--bulk
flag being a confusing UX.Having typed this out and thought about it some more, I am leaning more towards the bulk create path having it's own distinct argument on account of the different endpoints and request data structures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That all makes sense to me! Update to break into a bulk-create subcommand. Let me know how it looks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The distinct
bulk-create
sub-command on therequest
argument looks great! Could you also remove the--bulk
flag option from thecreate
command?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Thought I grabbed that but apparently not. Fixed.