Wire JATOS pull to pbsjatos via env - #110
Conversation
Nightly Boost CA still timed out on the retired jatos.psychology host; read base URL and token from env (default pbsjatos) and pass them in the Actions workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates JATOS connectivity for the nightly Boost CA pulls by removing hardcoded legacy host/token configuration and routing all JATOS calls through environment-provided settings (defaulting to pbsjatos).
Changes:
- Read
JATOS_TOKEN(and optionalTEASE) from environment inmain_handler.pyinstead of hardcoding secrets. - Replace hardcoded retired JATOS host URLs with
JATOS_BASE_URL(defaulting tohttps://pbsjatos.psychology.uiowa.edu) in pull logic. - Wire
JATOS_TOKEN/JATOS_BASE_URLinto the GitHub Actions workflow and document the required env vars in the README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| code/main_handler.py | Removes inline token and requires JATOS_TOKEN via env; plumbs optional TEASE. |
| code/data_processing/pull_handler.py | Builds API URLs from JATOS_BASE_URL (with pbsjatos default) instead of the retired host. |
| README.md | Documents required/optional env vars and GH Actions secrets/vars. |
| .github/workflows/main.yml | Passes JATOS_TOKEN, JATOS_BASE_URL, and TEASE into the nightly job environment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| token = os.environ.get("JATOS_TOKEN", "").strip() | ||
| if not token: | ||
| raise RuntimeError( | ||
| "JATOS_TOKEN env var required (see HBC .env/.env). " | ||
| "Do not hardcode tokens in source." | ||
| ) |
| base = os.environ.get( | ||
| "JATOS_BASE_URL", "https://pbsjatos.psychology.uiowa.edu" | ||
| ).rstrip("/") | ||
| url = f"{base}/jatos/api/v1/results/metadata" |
| base = os.environ.get( | ||
| "JATOS_BASE_URL", "https://pbsjatos.psychology.uiowa.edu" | ||
| ).rstrip("/") | ||
| url = f"{base}/jatos/api/v1/results/data" |
| env: | ||
| JATOS_TOKEN: ${{ secrets.JATOS_TOKEN }} | ||
| JATOS_BASE_URL: ${{ vars.JATOS_BASE_URL || 'https://pbsjatos.psychology.uiowa.edu' }} | ||
| TEASE: ${{ secrets.TEASE }} |
HBClab/boost-beh already has a TOKEN secret from the old setup; accept it until JATOS_TOKEN is added. Co-authored-by: Cursor <cursoragent@cursor.com>
Smoke test (local)
Follow-up needed after merge
Repo already has secret |
Title-match IA/IB/IC (plus available OA/OB/OC) so pulls hit live studies; allow fewer than 6 IDs; LSS root via BOOST_LSS_ROOT. Co-authored-by: Cursor <cursoragent@cursor.com>
Follow-up: study ID + path fixLocal smoke (Michelle token → pbsjatos):
Still needed for Actions: set repo secret |
Summary
jatos.psychology.uiowa.eduURLs inpull_handler.pywithJATOS_BASE_URL(defaulthttps://pbsjatos.psychology.uiowa.edu).JATOS_TOKENfrom env inmain_handler.py(remove inline token).JATOS_TOKEN/JATOS_BASE_URL(and optionalTEASE) into the Boost CA nightly workflow.Why
Nightly Boost CA still hits the retired JATOS host and times out. Lab moved to
pbsjatos; local meta alone cannot fill missing V1 sessions until pulls succeed.Secrets / vars (Michelle)
Before re-running Boost CA workflow, add on
HBClab/boost-beh:JATOS_TOKEN(Michelle USER token for pbsjatos)JATOS_BASE_URL=https://pbsjatos.psychology.uiowa.edu(workflow defaults to this if unset)Test plan
gh workflow run "Boost CA workflow"after secrets set