feat(DCP-2190): add collection publish command#289
Merged
keyboSlice merged 5 commits intomainfrom Jan 30, 2026
Merged
Conversation
Add command to publish AI Task Builder Collections as studies. Creates a study with the collection content and transitions it to published state.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…collection publish
ajmalkhan-eng
approved these changes
Jan 30, 2026
Comment on lines
+68
to
+70
| if len(opts.Args) < 1 || opts.Args[0] == "" { | ||
| return errors.New("please provide a collection ID") | ||
| } |
Contributor
There was a problem hiding this comment.
thought.. if earlier we have cobraMinimumNArgs(1) us this additional check even required?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add a new CLI command to publish AI Task Builder Collections as studies. This command creates a study from a collection's content and automatically transitions it to the published state, making it available to participants.
Collection Publish Command
Publish an AI Task Builder Collection as a study with a specified number of participants.
Flags
--participants-p--name-n--description-dOutput
Displays the created study details including ID, name, status, and the study URL for participants.
Implementation
DataCollectionMethodAITBCollectionconstant tomodel/study.gocmd/collection/publish.gowithNewPublishCommandcmd/collection/collection.godata_collection_method: AI_TASK_BUILDER_COLLECTIONTesting
Unit tests cover:
Note
Medium Risk
Touches study creation/publish flow and introduces template-driven input parsing, which can affect how requests are formed and published if field overrides/serialization behave unexpectedly.
Overview
Adds a new
collection publish <collection-id>CLI command that creates a study from an AI Task Builder Collection (participants required unless a JSON/YAML template is provided), then automatically transitions it toPUBLISHand prints the rendered study plus a study URL.When a template is used, the command forces
data_collection_method/data_collection_idto the target collection, clearsexternal_study_urlas incompatible, and lets CLI flags override template fields with sensible description fallbacks. This also introducesmodel.DataCollectionMethodAITBCollection, adds an example template JSON, and includes extensive unit coverage for success, error paths, and template/flag override behavior.Written by Cursor Bugbot for commit 0fd00f1. This will update automatically on new commits. Configure here.