Medical-Event-Data-Standard / Medical-Event-Data-Standard/MEDS-DEV
Add meds-dev-submit-result CLI: client-side submission via gh
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 43
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
Follow-up to PR #295's design discussion (thread).
Today the result-submission flow is: a contributor runs meds-dev-pack-result to produce result.json, then manually navigates to the GitHub issue form, pastes the JSON into a fenced code block, types the dataset / task / model names by hand, and submits. The submission workflow then parses that issue body and validates.
There are a few sharp edges here:
- Free-text typing of dataset/task/model invites mistakes (handled separately in #296).
- Manual copy-paste between a JSON file and a textarea invites copy errors.
- The contributor doesn't see whether the JSON is valid until after the workflow has fired (or until they trigger validation locally with
meds-dev-validate-result, which is a separate step). - Submission requires browser navigation, which interrupts a CLI-driven workflow.
Proposal: meds-dev-submit-result <result.json>
A client-side CLI that does the whole thing in one step:
meds-dev-submit-result path/to/result.json
What it does:
- Loads and validates the JSON locally via
Result.from_json(the existing logic). Fails fast with a clear error if invalid — contributor never gets a "broken submission" issue filed. - Confirms the GitHub repo (
Medical-Event-Data-Standard/MEDS-DEVby default; configurable for forks/testing). - Builds the issue body with the JSON pre-pasted into the right shape, the typed fields pre-filled from the parsed JSON (
result.dataset→ form field, etc.), and theresult-submissionlabel applied. - Opens the issue via
gh issue create(relies on the localghauth). - Returns the issue URL.
Implementation lives in MEDS_DEV.web.submit_result (or submit_submission); CLI: meds-dev-submit-result.
Why this is better than form-only
- Validation happens client-side, so invalid submissions never reach the workflow at all.
- No copy-paste: the JSON is read from disk; the form fields are derived from it.
- No browser: contributors in a CLI loop can submit without context-switching.
- Form fields and JSON are guaranteed to match because both are populated from the same parsed
Resultobject. - Plays well with the existing form: web-form submissions still work for users who don't want to install
meds-dev. The CLI is opt-in convenience, not a replacement.
Open questions
- Should the CLI also poll for issue closure and report success/failure back to the user?
- What about non-Medical-Event-Data-Standard forks? Default to whatever
gh repo viewreturns? Take an explicit--repoflag? - For users who already use
gh issue createdirectly: should there be a--print-bodymode that just emits the body for piping (meds-dev-submit-result --print-body x.json | gh issue create --body-file -)? - Could this CLI eventually open a PR against the
_resultsbranch directly, bypassing the issue layer entirely? (Speculative; would need different permission model.)
Acceptance criteria
-
meds-dev-submit-result <result.json>validates and submits in one invocation. - Local validation: invalid JSON, missing fields, NaN values, etc. are caught before the issue is opened.
- Authenticated via the user's
ghCLI; no token-management required. - Doctest / unit-test coverage for the body-building logic (no live GitHub call required for those).
- Mention in
src/MEDS_DEV/web/README.mdas the recommended submission path; preserve the form as a fallback.
Related
- PR #295 — surfaced this as a follow-up.
- #296 (stricter form) — orthogonal improvement to the form-based submission path. Both can land; they don't conflict.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with MEDS_DEV.web.submit_result or submit_submission and the existing Result.from_json validation flow, then trace how the current result-submission issue body is formed. Add unit or doctest coverage for body building without a live GitHub call, and update src/MEDS_DEV/web/README.md. Done means the CLI validates a result.json, uses authenticated gh to create the issue, and returns its URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, python
- Domain
- cli, documentation, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100