-
Notifications
You must be signed in to change notification settings - Fork 29
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
Version level review #1073
Open
x753
wants to merge
63
commits into
master
Choose a base branch
from
version-level-review
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Version level review #1073
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move permission logic to PackagePermissionsMixin because PackageDetailView is a bad place for it
Add more filtering functions, change default visibility to private
Add review_status to PackageVersion Add reject and approve version actions to Django admin Add update_visibility method to PackageVersion
Update available_versions to exclude private versions Update recache latest to only save if latest isn't None
Add VisibilityMixin to PackageListing Add VisibilityQuerySet to PackageListingQueryset Add visibility logic to ensure_can_be_viewed_by_user Add update_visibility method to PackageListing Use listing.update_visibility in recache_latest
Add migrations to populate visibility field for PackageVersion and PackageListing
Add visibility filter to PackageListSearchView so searches do not return packages that are not publicly listed
Fix PackageListing/Version save() which would fail for new instances
Add unavailable_versions property to Package Update PackageListing Detail and Versions pages to show unavailability information
Fix latest recaching by finding any active version if the first available version is None Ensure package versions are saved before trying to create the listing Fix visibility by updating only when the related model is saved Move recache_latest from approve/reject to after update_visibility
Add authentication to package version page so users can't view rejected versions without proper permissions
Add version review buttons to versions table Add version reject/approve audit events Add APIs for rejecting/approving versions
Ensure APIs only return public listings
Update cyberstorm.package.versions and experimental.frontend.community.packages return only public_list instances
Add check for None to PackageListing's ensure_can_be_viewed_by_user Move format_category back inside get_context_data Filter review queue to moderator_list instead of public_list
Add VisibilityFlagsFactory Add test for returning only visible packages Add test for returning only packages with an available version Add test for returning only visible versions Add test for ensuring latest is visible if possible
Update webhook audits to display approval, rejection, and warnings for listings, versions, and packages
Move permission logic to PackagePermissionsMixin because PackageDetailView is a bad place for it
Add more filtering functions, change default visibility to private
Add review_status to PackageVersion Add reject and approve version actions to Django admin Add update_visibility method to PackageVersion
Update available_versions to exclude private versions Update recache latest to only save if latest isn't None
Add VisibilityMixin to PackageListing Add VisibilityQuerySet to PackageListingQueryset Add visibility logic to ensure_can_be_viewed_by_user Add update_visibility method to PackageListing Use listing.update_visibility in recache_latest
Add migrations to populate visibility field for PackageVersion and PackageListing
Add visibility filter to PackageListSearchView so searches do not return packages that are not publicly listed
Fix PackageListing/Version save() which would fail for new instances
Add unavailable_versions property to Package Update PackageListing Detail and Versions pages to show unavailability information
Fix latest recaching by finding any active version if the first available version is None Ensure package versions are saved before trying to create the listing Fix visibility by updating only when the related model is saved Move recache_latest from approve/reject to after update_visibility
Add authentication to package version page so users can't view rejected versions without proper permissions
Add version review buttons to versions table Add version reject/approve audit events Add APIs for rejecting/approving versions
Ensure APIs only return public listings
Move update_visibility() so it's called whenever something inheriting VisibilityMixin is saved
Add active() into public_list() so inactive packages are not included in public_list(), even if they're visible for some reason Remove all the now-redundant active() checks from queries that use public_list()
Fix visibility tests by changing review status rather than changing visibility directly
Remove deleting cached unavailable_versions from available_versions
The system is intended to require resolving all three user-specific context attributes for visibility, so these shorthands go against that.
Ensure inactive models are not visible by checking is_active in the update_visibility function
Refactors the package management buttons and status cards (deprecated, rejected, etc) to appear on every detail view page.
Refactor can_be_viewed_by_user from the PackageListing / PackageVersion classes into is_visible_to_user in the visibility mixin
Allow owners to see their rejected packages by populating the PackageListByOwnerView with owner_list listings
Turn review_status CharFields into TextFields
Remove redundancy in update_visibility
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1073 +/- ##
==========================================
- Coverage 92.94% 92.40% -0.55%
==========================================
Files 315 316 +1
Lines 9262 9556 +294
Branches 828 887 +59
==========================================
+ Hits 8609 8830 +221
- Misses 541 601 +60
- Partials 112 125 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Adjust views so latest can be None by supplying a version as context data
c3a2890
to
b6567cd
Compare
Move is_visible_to_user() to version/listing Also set default visibility to public
Add a rate limit to celery_post, specifically so Discord doesn't drop webhook messages that come in faster than its limit of 5/2s
Update community aggregates to take into account visibility, and to ignore cross-community listings
b406fed
to
b28c8a0
Compare
Add system() to VisibilityMixin, which returns all objects regardless of visibility so that we can always specify the visibility of objects when querying.
Add a test to ensure that models with visibility (currently PackageListing and PackageVersion) are not called without specifying visibility.
Fix package views 404ing shortly after approval due to the slow propagation of package.latest
Fix changelog view breaking when latest is None
Create a new python project for flake8 plugins, currently only containing a plugin to test for unsafe usage of models with visibility
fa9bfb7
to
39acac4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.