Is your feature request related to a problem? Please describe.
There is no efficient way to compute the net content difference between two non-adjacent repository versions over the REST API.
The existing repository_version_added / repository_version_removed filters only diff a version against its immediate predecessor (a single step). When two versions of interest are not adjacent — for example, two versions that were each published but have other versions created in between — there is no direct way to ask "what content is in version X but not in version Y."
The current workaround is a q= expression filter such as: q=repository_version=<X> AND NOT repository_version=<Y>
On large repositories this is expensive and puts significant load on the database, because the NOT clause is evaluated against the full content set rather than scoped to the change between the two versions.
Describe the solution you'd like
Some way to retrieve the net diff between two arbitrary repository versions where the cost scales with the size of the change rather than the size of the repository. A couple of directions that could work:
• Exposing each version's content unit IDs so clients can fetch two versions and diff the sets themselves
• A base_version parameter on the content filters — allow repository_version_added / repository_version_removed to take a base_version, so the added/removed set is computed between the two specified versions instead of only against the immediate predecessor. This would build on the existing RepositoryVersion.added() / removed() methods, which already accept a base_version argument at the model level. Omitting it would preserve today's single-step behavior.
Describe alternatives you've considered
- Filtering content by
repository_version and diffing via q=
Is your feature request related to a problem? Please describe.
There is no efficient way to compute the net content difference between two non-adjacent repository versions over the REST API.
The existing
repository_version_added/repository_version_removedfilters only diff a version against its immediate predecessor (a single step). When two versions of interest are not adjacent — for example, two versions that were each published but have other versions created in between — there is no direct way to ask "what content is in version X but not in version Y."The current workaround is a
q=expression filter such as:q=repository_version=<X> AND NOT repository_version=<Y>On large repositories this is expensive and puts significant load on the database, because the
NOTclause is evaluated against the full content set rather than scoped to the change between the two versions.Describe the solution you'd like
Some way to retrieve the net diff between two arbitrary repository versions where the cost scales with the size of the change rather than the size of the repository. A couple of directions that could work:
• Exposing each version's content unit IDs so clients can fetch two versions and diff the sets themselves
• A
base_versionparameter on the content filters — allowrepository_version_added/repository_version_removedto take abase_version, so the added/removed set is computed between the two specified versions instead of only against the immediate predecessor. This would build on the existingRepositoryVersion.added()/removed()methods, which already accept abase_versionargument at the model level. Omitting it would preserve today's single-step behavior.Describe alternatives you've considered
repository_versionand diffing viaq=