Repository navigation
Conversation
233e402 to
66a9af6
Compare
d463239 to
30efdd5
Compare
Assisted By: Claude Opus 5.5
Assisted By: Claude Opus 5.5
Assisted By: Claude Opus 5.5
Assisted By: Claude Opus 5.5
Assisted By: Claude Opus 5.5
Assisted By: Claude Opus 5.5
20b1f64 to
fd47538
Compare
| "CREATE SEQUENCE core_repositorycontent_change_seq", | ||
| reverse_sql="DROP SEQUENCE core_repositorycontent_change_seq", |
There was a problem hiding this comment.
Does Django not have support for SEQUENCE?
| migrations.RemoveConstraint( | ||
| model_name="repositorycontent", | ||
| name="unique_unversioned_repository_content", | ||
| ), |
There was a problem hiding this comment.
Note for final review: Remember to squash the history of the migrations down. They can still be in different files, but operations like add & remove & add constraint that are because of developmental commits should be reduced.
| self._content_relationships() | ||
| .filter(content_id__in=pks) |
There was a problem hiding this comment.
What happens if you are adding 70K content units in this method? Would this query fail? Can we not just take all of the content from _content_relationships and subtract to get to_add, do we need to do this filter first?
| self._check_content_types(to_add) | ||
| if not to_add: | ||
| return |
There was a problem hiding this comment.
Reverse the order of these lines.
| if not removed: | ||
| return | ||
| # Removed rows are kept as tombstones so the removal shows up in changes | ||
| rows.filter(content_id__in=removed).update(removed_seq=_next_change_seq()) |
There was a problem hiding this comment.
Here I believe we have the same issue if removed is greater than 65K.
Side note: The order of operations in remove_content had to be specific when I was adding content_ids as there were scenarios where the passed in query could depend on the existing content so you had to be careful not to re-evaluate the query again after modifying the existing content. How much we should care about that scenario for this repo type, I'm not sure, but thought it would be worth mentioning.
| repository.finalize_new_version(self) | ||
| if self._added or self._removed: | ||
| repository.on_new_version(self) |
There was a problem hiding this comment.
Should we really be calling these version methods when dealing with unversioned membership. Maybe it makes the most sense for easy compatibility, but current plugins (cough, maven, cough) can do a lot of work in these methods making them unsuitable for synchronous actions.
| if publication and repo_version: | ||
| raise Exception("Either a repo_version or publication can be specified.") | ||
| content_repo_ver = repo_version or publication.repository_version | ||
| content_repo_ver = repo_version or publication.published_version |
There was a problem hiding this comment.
I do believe you need an addition to the select_related on the distribution query to also select the publication's potential unversioned_repository
| large or slow files can hit the API server timeout. | ||
| """ | ||
| # A request-less context makes the serializer run its deferred validation in-process. | ||
| context["request"] = None |
There was a problem hiding this comment.
I wonder if deferred validation even makes sense for this upload. Maybe plugins should use their sync upload serializer instead.
|
|
||
| def _patched_manifest_entries(publication, manifest): | ||
| """ | ||
| Return manifest entries made by patching the manifest of the previous publication. |
There was a problem hiding this comment.
This is pretty smart. Are you going to do any tests to see what the performance of this optimization is?
📜 Checklist
See: Pull Request Walkthrough