Conversation
0296c61 to
6d9421d
Compare
Collaborator
Author
|
…t_list implementations All API resources previously used a 'wrapped(list)' subclass with __getslice__ to lazily fetch data from Cassandra when Tastypie applied pagination. In Python 3, __getslice__ is never called (replaced by __getitem__ with a slice object), causing all these endpoints to return empty results. Fix by implementing the logic directly in obj_get_list for each resource, returning a proper list. Also fix remaining Python 3 str/bytes issues: - sha1() in CreateBugResource and PackageVersionNewBuckets now uses .encode() - PackageVersionNewBuckets no longer converts str buckets to bytes unnecessarily - Remove unused measure_view import and commented-out dead code in ErrorsResource Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
…hitecture Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
… Ubuntu RTM workaround Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
…ted APIs - Rename MIDDLEWARE_CLASSES to MIDDLEWARE (Django 1.10+) - Simplify WSGI to standard Django get_wsgi_application(), removing oops-wsgi wrappers - Remove deprecated SESSION_SERIALIZER = PickleSerializer - Remove ADMIN_MEDIA_PREFIX (removed in Django 1.4) - Remove ADMINS/MANAGERS (unused) - Add WSGI_APPLICATION setting - Replace django.utils.http.urlquote with urllib.parse.quote - Use config.allow_bug_filing instead of settings.ALLOW_BUG_FILING Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
In Python 2, list slicing (obj[start:end]) called __getslice__(start, end). In Python 3 this method is never called, so all resources using the wrapped(list) pattern with __getslice__ returned empty results. Fix by implementing the logic directly in each obj_get_list(), returning proper lists that Tastypie's paginator can paginate normally. Also fix remaining Python 3 str/bytes issues: - sha1() now uses .encode() everywhere (CreateBugResource, PackageVersionNewBuckets) - Remove unnecessary isinstance/encode/decode dance in PackageVersionNewBuckets - Remove isinstance(column, str) byte-encoding guard in cassie.get_bucket_counts() - Remove unused measure_view import and dead commented-out code in ErrorsResource Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
…m template - Guard vals and reports_state_fixed_master accesses against null/undefined - Remove the server-rendered 'means' variable from main.html (data comes from the API) - Pass no argument to mean_time_between_failures_graph() since means is fetched via API Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Contributor
Done. Since force-pushing isn't available, I used a revert commit to cleanly undo the WIP (and its earlier follow-up) and then re-applied everything as 6 logical commits on top:
|
935ffc2 to
3531a3f
Compare
Replace the four shell scripts (run-daisy.sh, run-errors.sh, run-retracer.sh, populate-test-data.sh) with a Makefile providing equivalent make targets: run-daisy, run-errors, run-retracer, populate-test-data. Update README.md and copilot-instructions.md to reference the new make targets." Agent-Logs-Url: https://github.com/ubuntu/error-tracker/sessions/1d98657d-4c6f-4c19-910a-fca94f9a5d11 Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
…rship with Django groups Add a custom LaunchpadTeamsOpenId backend that extends the default LaunchpadOpenId backend with the Launchpad OpenID Teams extension (http://ns.launchpad.net/2007/openid-teams). During authentication, the backend asks the OpenID provider which of the configured teams (from errors.auth.groups, including error-tracker-access) the user belongs to. Add a pipeline step (errors.pipeline.assign_groups) that maps the team memberships returned by the OpenID provider to Django groups, keeping them in sync on each login. Add python3-openid-teams as a dependency." Agent-Logs-Url: https://github.com/ubuntu/error-tracker/sessions/1d98657d-4c6f-4c19-910a-fca94f9a5d11 Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ubuntu/error-tracker/sessions/1d98657d-4c6f-4c19-910a-fca94f9a5d11 Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
This file contains hidden or 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
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.
Modernizes the
errorsDjango application by cleaning up Python 2 legacy code, updating deprecated Django APIs, and fixing all API endpoints to work correctly under Python 3.Changes Made
Django modernization (
errors)MIDDLEWARE_CLASSES→MIDDLEWARE(Django 1.10+)wsgi.pyto standardget_wsgi_application(), removingoops-wsgiwrappersSESSION_SERIALIZER = PickleSerializer,ADMIN_MEDIA_PREFIX, and unusedADMINS/MANAGERSsettingsWSGI_APPLICATIONsettingdjango.utils.http.urlquotewithurllib.parse.quoteconfig.allow_bug_filinginstead ofsettings.ALLOW_BUG_FILINGAPI endpoint fixes (
errors/api/resources.py,errors/cassie.py)wrapped(list)pattern with__getslice__, which is never called in Python 3 — every endpoint was silently returning empty results. Each resource is now converted to a directobj_get_list()implementation returning a proper list.sha1(str)→sha1(str.encode())inCreateBugResourceandPackageVersionNewBucketsisinstance/encode/decode dance for bucket strings inPackageVersionNewBucketsisinstance(column, str)byte-encoding guard incassie.get_bucket_counts()measure_viewimport and dead commented-out code inErrorsResourceJavaScript / template fixes
valsandreports_state_fixed_masterin JS filesmeansvariable frommain.html(the JS fetches it from the API)Other fixes
launchpad.py: fixed indentation bug inpocket_for_binaries, removed Ubuntu RTM 14.09 workaroundsrc/retracer/config/Ubuntu 26.04/sources.list: added[trusted=yes]to ddebs entriesREADME.md/copilot-instructions.md: documentedpopulate-test-data.sh