Build WebAPI docs for DiffCommit resources

Review Request #10118 — Created Aug. 13, 2018 and submitted

Information

Review Board
release-4.0.x
0150021...

Reviewers

The docs fixtures now include DiffCommit objects, which allows
documentation to be built for the diff commit resource pages, which are
now also included in the documentation.

The repository used for these is the git_repo shipped in
reviewboard/scmtools/testdata, but since repositories require an
absolute file path, we ship the fixtures with a placeholder path and
replace it when we build the documentation.

Built docs and looked through them.

Description From Last Updated

The review request info makes it sound like this is purely about the fixtures, but this change is truly about …

chipx86chipx86

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

E128 continuation line under-indented for visual indent

reviewbotreviewbot

Can you add comments here about what we're doing and why? I think we could also simplify this a fair …

chipx86chipx86

Diff commits should be after diff (immediately before the file attachments).

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

brennie
chipx86
  1. 
      
  2. Show all issues

    The review request info makes it sound like this is purely about the fixtures, but this change is truly about being able to document and build docs for the new resources, with the fixture changes supporting that purpose.

  3. docs/manual/_ext/webapidocs.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    Can you add comments here about what we're doing and why?

    I think we could also simplify this a fair amount:

        Repository.objects.filter(name='Git Repo', path='/placeholder').update(
            path=os.path.abspath(os.path.join(reviewboard.__file__, '..',
                                              'scmtools', 'testdata', 'git_repo')))
    

    One SQL query instead of two, less data to fetch, fewer lines, and the path join is cheap. Of course, this is not exactly an expensive code path, but no point in doing extra work.

  4. 
      
brennie
brennie
chipx86
  1. 
      
  2. docs/manual/webapi/2.0/resources/index.rst (Diff revision 3)
     
     
     
     
     
    Show all issues

    Diff commits should be after diff (immediately before the file attachments).

  3. 
      
brennie
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (22911eb), release-4.0.x (9a10cd7)
Loading...