-
Notifications
You must be signed in to change notification settings - Fork 76
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
include instanceId in client audit csv export #335
Conversation
Yay for your first PR! 🎉 Oops, I wasn't very explicit in the issue. The new column should be the first one and it should be named You and @issa-tseng will no doubt discuss the details. I have a couple high-level/process suggestions. Github has a nifty "draft" feature you might consider using for PRs that are not ready to merge. You can also convert a PR once it's up. The contribution docs have some guidance on writing commit messages (totally fine to amend commits and force push to a branch even if there's a PR on it). |
I've moved the I've also tried it on more realistic data (submissions collected through Collect app with auditing enabled). I've noticed a couple other things:
Briefcase export screenshots
|
Thanks for actually trying the Briefcase export to compare! I think you're mostly running into getodk/briefcase#740. Briefcase just concatenates all the CSVs and uses a fixed header which definitely should be addressed at some point. I would expect the location columns if https://docs.getodk.org/form-audit-log/#location-tracking is enabled on the Briefcase side but it's not clear to me whether maybe they're after all the change columns and not visible because they have no values and no header? I use something like this app so Collect gets locations that aren't my home when testing.
Yes, the files are technically apparently in the zip but most zip clients won't make them accessible. The combined log is definitely higher priority but at some point it might be nice to do something like put audits in their own folder and add a submissionID prefix to the filenames. I see a bunch of test failures on CI. Are those expected and also failing locally or a CI special? |
Tests have been updated now! |
This addresses issue #333 and forum comment https://forum.getodk.org/t/update-the-audit-log-structure/31887. Now each row of client audit events contains an extra
uuid
column referring to the unique ID of the corresponding submission.The new
uuid
column id named that because of the forum post, but it should possibly be namedKEY
orinstanceID
to be more consistent with other exported files.Turns out, although there's a complicated query in
model/query/client-audits.js
spanning many tables, thesubmissions
table withinstanceId
column is already one of the tables active in that big join so this doesn't impact the database performance.