Skip to content

Add script for adding bulk challenges to a specific journey - #316

Merged
3TTemi merged 1 commit into
masterfrom
3TTemi/bulk-challenges-script
Apr 18, 2026
Merged

3TTemi merged 1 commit into
masterfrom
3TTemi/bulk-challenges-script

Conversation

@3TTemi

@3TTemi 3TTemi commented Apr 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds scripts/bulk-add-challenges.js to import journey challenges from a local CSV file or Google Sheets URL.
  • Supports Google Sheets ingestion via GOOGLE_API_KEY (link-shared sheets) with a public CSV export fallback when no API key is configured.
  • Validates required fields, skips invalid rows with a summary, and recreates the journey’s challenge set in order; protects existing completion data unless --force is explicitly passed.

Test plan

  • Run script with a valid local CSV and verify expected challenge count/order in DB.
  • Run script with a Google Sheets URL using GOOGLE_API_KEY.
  • Run script with a public sheet and no API key
  • Confirm rows missing required fields are skipped and reported.
  • Confirm script aborts when existing challenges have completions and --force is not provided.
  • Confirm --force allows replacement and successfully recreates challenges.

@3TTemi
3TTemi merged commit 3fd6ece into master Apr 18, 2026
11 checks passed
@dti-github-bot

Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 384.

@3TTemi
3TTemi deleted the 3TTemi/bulk-challenges-script branch April 18, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants