Closed anttimaki closed 11 months ago
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
4688b36
) 93.04% compared to head (6e1b65d
) 93.05%. Report is 5 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The issues mentioned above were discussed in Discord and it was decided that neither is a show stopper right now.
Add PackageVersion.is_effectively_active
Helper method checks that both the PackageVersion and the related Package are active. This is acts as a pair for the existing Package.is_effectively_active helper.
Refs TS-2013
Cyberstorm API: include deactived dependencies for package listing
Even if a dependency is deactived, it's still a dependency of the package, which might not work without it. To avoid misleading information on the website, include deactived dependencies too.
PackageVersion is considered deactived if the parent Package is deactived, even if the specific version would be active.
Annotating the "effective active status" to the QuerySet was considered, but since the related package is prefetched for other purposes anyway, it seemed like an unnecessary step.
Refs TS-2013
Cyberstorm API: censor deactived package dependencies
The reason why a package has been deactivated may be an obnoxious icon or description text, so don't send those to clients.
Method serializers are used instead of annotations, since especially for the icon field the annotation isn't straightforward: the ImageField can't be directly attached to the object, and parsing the absolute URL correctly from the path representation stored in the database is error-prone.
Refs TS-2013