Skip to content

feat(DCP-2500): add study update command#348

Merged
script-this merged 2 commits intomainfrom
feat/dcp-2500-study-update-command
Mar 10, 2026
Merged

feat(DCP-2500): add study update command#348
script-this merged 2 commits intomainfrom
feat/dcp-2500-study-update-command

Conversation

@script-this
Copy link
Copy Markdown
Contributor

@script-this script-this commented Mar 10, 2026

Summary

  • Add prolific study update <id> -t <file> command that sends a JSON template directly to PATCH /api/v1/studies/:id/
  • Support stdin via -t -, --json for machine-readable output, --silent/-s for scripting
  • Widen UpdateStudy client signature from model.UpdateStudy to any for arbitrary JSON passthrough

Test plan

  • make all — lint, tests, and build pass
  • Integration tested against orange dev environment:
    • Basic update from file (draft study)
    • JSON output (--json)
    • Silent mode (--silent)
    • Stdin support (-t -)
    • Invalid JSON error handling
    • API validation error surfacing
    • File not found error
    • Complex nested update (submissions_config, device_compatibility)
    • Regression: increase-places and set-credential-pool still work

DCP-2500

@prolific-snyk
Copy link
Copy Markdown

prolific-snyk commented Mar 10, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Add `prolific study update <id> -t <file>` command that sends a JSON
template directly to PATCH /api/v1/studies/:id/. Supports stdin via
`-t -`, `--json` for machine-readable output, and `--silent` for
scripting. Widen UpdateStudy client signature to `any` for arbitrary
JSON passthrough.
@script-this script-this force-pushed the feat/dcp-2500-study-update-command branch from e9ccdb0 to bf2d83c Compare March 10, 2026 11:30
Remove stale nolint directives for G704 (no longer flagged) and add
G703 exclusion for scripts/changelog/ where resolvePath already guards
against path traversal.
@script-this script-this marked this pull request as ready for review March 10, 2026 12:00
@script-this script-this requested a review from a team as a code owner March 10, 2026 12:00
@script-this script-this added the dct-ready-for-review Triggers Slack notification when PR is ready for review label Mar 10, 2026
GetSubmissions(ID string, limit, offset int) (*ListSubmissionsResponse, error)
TransitionStudy(ID, action string) (*TransitionStudyResponse, error)
UpdateStudy(ID string, study model.UpdateStudy) (*model.Study, error)
UpdateStudy(ID string, study any) (*model.Study, error)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What caused us to loosen the type here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question: requirement to support the 30+ optional fields with complex nested types and subsequent need to update it for any small study schema change. Given we're proxying it with user-provided json for update, felt like the better fit.

@script-this script-this merged commit 47a9634 into main Mar 10, 2026
8 checks passed
@script-this script-this deleted the feat/dcp-2500-study-update-command branch March 10, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dct-ready-for-review Triggers Slack notification when PR is ready for review team-dct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants