Add audit trail functionality for collections #198

Merged
cmo merged 17 commits from audit-trail into master 2026-03-17 09:03:05 +00:00

2026-03-16

Christian Monch
add audit-backend documentation
All checks were successful
Test execution / Test-all (push) Successful in 2m2s
This commit adds a description of the
audit-backend of type `git-audit`. That
means, it describes its configuration and
features in the changelog and in
`README.md`.

It also adds a short description of the
associated reporting tool, i.e, of
`dump-things-report-gitaudit`.
2026-03-16 15:30:17 +01:00
Christian Monch
set git-identity before runing tests
All checks were successful
Test execution / Test-all (push) Successful in 2m1s
2026-03-16 14:53:23 +01:00
Christian Monch
remove unused import from test_gitaudit.py
Some checks failed
Test execution / Test-all (push) Failing after 1m9s
2026-03-16 14:33:37 +01:00
Christian Monch
add reference to branch minilad of datalad-core
Some checks failed
Test execution / Test-all (push) Failing after 57s
2026-03-16 14:31:23 +01:00
Christian Monch
add audit-backdend handling
Some checks failed
Test execution / Test-all (push) Failing after 49s
This commit adds `audit_backends` to configuration
specifications. It also adds audit trails for every
record that is stored via the curator-interface.

For each record that is stored via the curator interface,
an audit entry is added to every audit-backend. The
audit entry contains:

1. timestamp when the record was added to the audit trail
2. the id of the token that was used to store the record
3. the changes that were made to the record (git diff format)
4. the content of the new record

The audit trail for a given PID can be printed by
using the command:

	dump-things-report-gitaudit <git-audit-dir> <PID>
2026-03-16 13:41:58 +01:00
Christian Monch
use apply_change_set
Some checks failed
Test execution / Test-all (push) Failing after 44s
Use the code from the minilad branch of
datalad-core.
2026-03-16 09:25:38 +01:00

2026-03-13

Christian Monch
fix change detection
Some checks failed
Test execution / Test-all (push) Failing after 52s
Due to the empty worktree, `git status` reports
even unchanged files as deleted. This lead to
unnecessary audit-commits. This commit fixes
the behavior.
2026-03-13 16:15:03 +01:00
Christian Monch
implement worktree-free audit trail
Add changes directly to git-index, and
commit from there. This keeps the worktree
empty.
2026-03-13 14:46:45 +01:00

2026-03-12

Christian Monch
create gitaudit-dir if it does not exist
Some checks failed
Test execution / Test-all (push) Failing after 55s
2026-03-12 14:46:03 +01:00
Christian Monch
add change reports for IDs
Some checks failed
Test execution / Test-all (push) Failing after 51s
This commit adds a method that reports all
changes that were applied to a record with
a specific ID.

The report is a dictionaries. The keys are
ISO timestamps, the values are tuples containing
the following entries:

0: the user id that did the change
2: the git diff of the change
3: the content of the record after the change
2026-03-12 10:11:50 +01:00