Represent all custom fields in the Change resource in the API.

Review Request #6887 — Created Feb. 1, 2015 and submitted

Information

Review Board
release-2.0.x
9cd3d58...

Reviewers

The Change resource was hard-coding support for a number of built-in
fields, and wasn't even getting all of them. It was never updated to
take into account any registered fields. Now, instead of using a bunch
of custom logic in the resource, it iterates through all change entries,
locates a matching field (if any), and serializes that.

This also gets rid of some bad, broken caching that could both cause
results to contain stale information from the database and could cause
memory bloat if traversing a large number of Change resources. It does
mean there's a performance hit in the database with repeated calls, but
HTTP caching should help with that. Some queries were also optimized to
reduce the number of hits to the database. Overall, it should be a
performance win.

Unit tests pass.

No longer saw stale payloads.

Description From Last Updated

'DiffSet' imported but unused

reviewbotreviewbot

'User' imported but unused

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/webapi/resources/change.py
        reviewboard/reviews/fields.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/webapi/resources/change.py
        reviewboard/reviews/fields.py
    
    
  2. reviewboard/webapi/resources/change.py (Diff revision 1)
     
     
    Show all issues
     'DiffSet' imported but unused
    
  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/webapi/resources/change.py
        reviewboard/reviews/fields.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/webapi/resources/change.py
        reviewboard/reviews/fields.py
    
    
  2. reviewboard/webapi/resources/change.py (Diff revision 2)
     
     
    Show all issues
     'User' imported but unused
    
  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/webapi/resources/change.py
        reviewboard/reviews/fields.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/webapi/resources/change.py
        reviewboard/reviews/fields.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (224ceee)