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

fix(projectHistoryLogs): rename incorrectly-formatted action TASK-944 #5320

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

rgraber
Copy link
Contributor

@rgraber rgraber commented Dec 3, 2024

πŸ—’οΈ Checklist

  1. run linter locally
  2. update all related docs (API, README, inline, etc.), if any
  3. draft PR with a title <type>(<scope>)<!>: <title> TASK-1234
  4. tag PR: at least frontend or backend unless it's global
  5. fill in the template below and delete template comments
  6. review thyself: read the diff and repro the preview as written
  7. open PR & confirm that CI passes
  8. request reviewers, if needed
  9. delete this section before merging

πŸ“£ Summary

Change the action modify_sharing to modify-sharing in project history logs for consistency.

πŸ‘· Description for instance maintainers

Change the AuditAction modify_sharing to modify-sharing, including a migration to update existing logs. Also adds the migration for all the new audit action types, although this migration seems to be a no-op in SQL.

πŸ‘€ Preview steps

  1. ℹ️ have an account and a project
  2. Go to Project > Settings > Connect Projects and enable data sharing. Select a specific question to share.
  3. πŸ”΄ [on main] Go to api/v2/assets/<uid>/history. Notice the action for the latest project history log is modify_sharing
  4. 🟒 [on PR] After running migrations, reload the history endpoint. Notice the action is now modify-sharing
  5. [on PR] Select another question to share
  6. 🟒 [on PR] Reload the endpoint. The latest log should have action=modify-sharing

πŸ’­ Notes

I didn't even realize this needed a migration until I ran ./manage makemigrations audit_log. It seems to work fine without the migration but this way there will be no unexpected changes next time we have to make a real migration.
The migration of existing logs should be pretty light since it's a fairly rare type of log.

@rgraber rgraber changed the base branch from main to rsgraber/TASK-973-create-endpoints December 3, 2024 17:05
@rgraber rgraber changed the title Rsgraber/task 973 migration fixx(projectHistoryLogs): rename incorrectly-formatted action TASK-944 Dec 3, 2024
@rgraber rgraber added API Changes related to API endpoints Back end labels Dec 3, 2024
@rgraber rgraber changed the title fixx(projectHistoryLogs): rename incorrectly-formatted action TASK-944 fix(projectHistoryLogs): rename incorrectly-formatted action TASK-944 Dec 3, 2024
Base automatically changed from rsgraber/TASK-973-create-endpoints to main December 5, 2024 15:07
@rgraber rgraber force-pushed the rsgraber/TASK-973-migration branch from 19cefa9 to 7c71538 Compare December 5, 2024 15:20
@rgraber rgraber marked this pull request as ready for review December 5, 2024 15:39
@rgraber rgraber requested a review from Guitlle December 5, 2024 16:44
@rgraber rgraber merged commit 3df2281 into main Dec 5, 2024
4 checks passed
@rgraber rgraber deleted the rsgraber/TASK-973-migration branch December 5, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes related to API endpoints Back end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants