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

feat(projectHistoryLog): log exports TASK-944 #5241

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

rgraber
Copy link
Contributor

@rgraber rgraber commented Nov 7, 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

Record project history logs for when users export an asset.

👀 Preview steps

Bug template:

  1. ℹ️ Log in as a super user. Create and deploy a project
  2. Add at least 1 submission to the project
  3. Go to Data > Downloads and hit Export. Note: the export may get stuck in processing. This is due to an unrelated bug (https://www.notion.so/kobotoolbox/Exports-fail-with-ExportTask-matching-query-does-not-exist-1377e515f65480328422e0c8fcfed1c0) but doesn't affect this work since we want to log every attempt to export, not just successful ones
  4. 🟢 Go to api/v2/audit-logs/?q=metadata__asset_uid:<asset_uid> AND log_type='project-history'
  5. There should be a new PH log with action=export (usual metadata)

💭 Notes

Uses the AuditLoggedViewSet and create_from_related_request flows (similar to asset files, paired data, etc.)

Copy link

@rgraber rgraber changed the base branch from main to rsgraber/TASK-944-log-imports November 7, 2024 15:23
@rgraber rgraber changed the title feat(ProjectHistoryLog): log exports TASK-944 feat(projectHistoryLog): log exports TASK-944 Nov 7, 2024
@rgraber rgraber force-pushed the rsgraber/TASK-944-log-imports branch from b71ddbf to 47cf3c2 Compare November 7, 2024 20:10
@rgraber rgraber force-pushed the rsgraber/TASK-944-log-exports branch from e06e5cb to c47213c Compare November 7, 2024 20:27
Base automatically changed from rsgraber/TASK-944-log-imports to main November 12, 2024 13:41
@rgraber rgraber force-pushed the rsgraber/TASK-944-log-exports branch from 7b641d5 to 72680fb Compare November 12, 2024 13:46
@rgraber rgraber marked this pull request as ready for review November 12, 2024 14:37
@rgraber rgraber self-assigned this Nov 12, 2024
@rgraber rgraber requested review from Guitlle and removed request for jnm and noliveleger November 12, 2024 17:57
Copy link
Contributor

@Guitlle Guitlle left a comment

Choose a reason for hiding this comment

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

cool, now that the base code is in place, these new logs are straight forward

@rgraber rgraber merged commit c47f297 into main Nov 13, 2024
7 checks passed
@rgraber rgraber deleted the rsgraber/TASK-944-log-exports branch November 13, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants