Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement delete_progress API for resetting progress #42235

Merged
merged 2 commits into from
Sep 2, 2021

Conversation

jamescodeorg
Copy link
Contributor

@jamescodeorg jamescodeorg commented Aug 27, 2021

This PR implements the the delete_progress API that will be used by admins to reset progress. See the tech spec for details on the design. As part of this work, soft-deletes are now enabled on the UserScript, UserLevel, and ChannelToken models.

The tests try to use the same methods to query the data that our primary codepaths use where possible to make the tests as realistic as possible.

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@jamescodeorg jamescodeorg requested a review from a team August 27, 2021 17:42
end

test "delete_progress deletes channel tokens" do
# TODO: Write this test after the work to add script_ids to channel tokens is completed.
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be written now since there is a script_id column on channel tokens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to use the same query methods that are used in the primary codepaths if possible and those haven't been updated to look at script_id yet, right?

assert driver_user_level.driver?
assert_equal 1, PairedUserLevel.pairs(driver_user_level).count

# delete the driver's progress
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be # delete the navigator's progress

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks!

Copy link
Contributor

@maureensturgeon maureensturgeon left a comment

Choose a reason for hiding this comment

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

Just left a few questions/comments!

Base automatically changed from jamescodeorg/confirm-delete-progress-form to staging August 31, 2021 17:32
@jamescodeorg jamescodeorg force-pushed the jamescodeorg/delete-progress-api branch from 84a2d6a to 016eab7 Compare August 31, 2021 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants