Skip to content

fix : added delete subscales and score reports to CLI (M2-9489) - #1942

Merged
aweiland merged 3 commits into
developfrom
M2-9489/cli-delete-subscales
Aug 29, 2025
Merged

fix : added delete subscales and score reports to CLI (M2-9489)#1942
aweiland merged 3 commits into
developfrom
M2-9489/cli-delete-subscales

Conversation

@sricharan-varanasi

@sricharan-varanasi sricharan-varanasi commented Aug 28, 2025

Copy link
Copy Markdown
Contributor
  • Tests for the changes have been added
  • Related documentation has been added / updated
  • For new features, QA automation engineers have been tagged
  • OSS packages added to
    Curious open source credit page

📝 Description

🔗 Jira Ticket M2-9489

Changes include:

  • A new CLI command: delete-subscales-for-all-applet-versions

  • Removes invalid data from:

    • subscale_setting field
    • score-type entries inside scores_and_reports
  • Applies cleanup to:

    • All activity_histories entries tied to a base applet_id
    • The current activities record for that applet
    • Adds a SQL helper function drop_score_reports() to remove only type: "score" reports without affecting others

🪤 Peer Testing

  • Identify affected applet_id with historical subscale issues
  • Run the CLI:
  • python src/cli.py activities delete-subscales-for-all-applet-versions <applet_id>
  • Verify output:
    • Confirms number of versions cleaned
    • Query database:
      • activity_histories: subscale_setting should be null
      • scores_and_reports: no type: "score" entries
      • Confirm export works as expected after cleanup

✏️ Notes

  • No changes to frontend or API schema

@github-actions

github-actions Bot commented Aug 28, 2025

Copy link
Copy Markdown

➡️ Preview environment failed to be destroyed

Comment thread src/apps/activities/commands/__init__.py Outdated
@aweiland
aweiland merged commit 9469425 into develop Aug 29, 2025
3 of 4 checks passed
@aweiland
aweiland deleted the M2-9489/cli-delete-subscales branch September 2, 2025 18:49
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.

3 participants