-
Notifications
You must be signed in to change notification settings - Fork 2
DCP-2215 refactor: simplify error messages across commands and tests #258
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
base: DCP-2216-prolific-cli-ui-helpers-and-color-support
Are you sure you want to change the base?
Conversation
✅ 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. |
Remove redundant "error: " prefix from error messages throughout the codebase.
This improves consistency and readability of error output.
Changes:
- Remove fmt.Errorf("error: %s", err.Error()) pattern
- Return errors directly where appropriate
- Update corresponding test assertions
78b9ed7 to
11ce80f
Compare
Add support for configuring studies with AI Task Builder data collection: - Add AITaskBuilderDataCollection field to Study model - Add AITaskBuilderPayload to CreateStudyPayload - Render AITB batch ID in study view - Update go.mod dependencies
Add comprehensive instruction examples for AITB: - Add example-instructions.json with multiple question types - Update standard-sample-aitaskbuilder.json with proper formatting - Update batch instructions command help with answer_limit example - Improve dataset upload command description
Add support for creating studies with AITB configuration: - Add --aitb-batch-id flag to study create command - Add --auto-publish flag for automatic study publication - Automatically transition studies to PUBLISHED state when --auto-publish is set - Update tests to cover new AITB and auto-publish functionality
| if !cmd.Flags().Changed("batch-id") { | ||
| expected := aitaskbuilder.ErrBatchIDRequired | ||
| if err.Error() != "error: "+expected { | ||
| if err.Error() != ""+expected { |
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.
question: Do we need the empty string concatenation? Same question in a few test files
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.
Agree. Seems redundant.
…core-features DCP-2217 feat: add AI Task Builder core features
Summary
This PR simplifies error handling across the CLI by removing redundant "error: " prefixes from error messages. This improves consistency and readability of error output throughout the codebase.
Changes
fmt.Errorf("error: %s", err.Error())patternImpact
Testing
All existing tests have been updated and pass with the new error format.
Note
Removes "error:" prefixes across commands/tests, enhances AITB workflow and study models/docs, and improves CLI output styling.
"error: "prefix) across commands; update tests accordingly.client.Instruction.AnswerLimitchanged to*int; examples includeanswer_limit.data_collection_method,data_collection_id, anddata_collection_metadata; render method in study view.external_study_urloptional in create payload.ui.Bold/Dim/Highlightin list views (campaigns, projects, workspaces) and dimmed record counters.ui.WriteSuccess; improveduser whoamistyling.docs/examples/example-instructions.jsonand update AITB study example (standard-sample-aitaskbuilder.json).go.mod(promotetermenv/isattyto direct requirements).Written by Cursor Bugbot for commit 4b1ffb2. This will update automatically on new commits. Configure here.