Advertise TFS support in Power Pack

Review Request #7758 — Created Nov. 6, 2015 and submitted

Information

Review Board
release-2.5.x

Reviewers

Add support for fake SCMTools entries that Review Board does not
provide, but Power Pack does. These tools are not implemented; they
simply appear in the Tool dropdown in the "Add Repository" form when
Power Pack is not enabled.

When a fake tool is selected in the form, an advertisement for Power
Pack is shown and the form becomes unsubmittable. This is to ensure
that users don't end up getting an error when trying to use a tool that
is not actually registered in the database.

This patch also moves all of the tool information serialization into
the RepositoryForm instead of the JS template.

Ran unit tests.

Manually verified the following:

  • The form cannot be submitted when a fake tool is selected.
  • The Power Pack advertisement shows when a fake tool is selected.
  • The fake SCM Tool entries do not appear when Power Pack is installed.

Description From Last Updated

We usually use "scmtool" all as one piece.

daviddavid

This doesn't seem like a useful comparison.

daviddavid

Can we set the text before showing? $powerPackToolAdvert .find('.power-pack-advert-missing') .text($tool.find(':selected').text()) .end() .show();

daviddavid

This seems silly and inefficient. These selectors shouldn't match more than one element, right? Let's just do: $repoPathRow.hide(); $repoMirrorPathRow.hide(); $bugTrackerTypeRow.hide();

daviddavid

Same here.

daviddavid

Missing period. All comments should be complete sentences.

chipx86chipx86

Can we call this last_tool_pk?

daviddavid

Missing trailing comma.

chipx86chipx86

I don't understand the purpose of this variable? Maybe it needs a better name.

chipx86chipx86

We should probably have some sanity checking now that we have things that don't exist in the db.

daviddavid

Let's move this to one var statement.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/static/rb/js/repositoryform.js
        reviewboard/templates/admin/repository_fields.js
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/scmtools/forms.py (Diff revision 4)
     
     
    Show all issues

    We usually use "scmtool" all as one piece.

  3. Show all issues

    This doesn't seem like a useful comparison.

  4. reviewboard/static/rb/js/repositoryform.js (Diff revision 4)
     
     
     
     
     
    Show all issues

    Can we set the text before showing?

    $powerPackToolAdvert
        .find('.power-pack-advert-missing')
            .text($tool.find(':selected').text())
        .end()
        .show();
    
    1. I didn't know about .end(). This is exactly what I was looking for!

  5. reviewboard/static/rb/js/repositoryform.js (Diff revision 4)
     
     
     
     
     
     
    Show all issues

    This seems silly and inefficient. These selectors shouldn't match more than one element, right? Let's just do:

    $repoPathRow.hide();
    $repoMirrorPathRow.hide();
    $bugTrackerTypeRow.hide();
    
  6. reviewboard/static/rb/js/repositoryform.js (Diff revision 4)
     
     
     
     
     
     
    Show all issues

    Same here.

  7. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/templates/admin/repository_fields.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/templates/admin/repository_fields.js
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/scmtools/forms.py (Diff revision 5)
     
     
    Show all issues

    Can we call this last_tool_pk?

  3. reviewboard/scmtools/forms.py (Diff revision 5)
     
     
    Show all issues

    We should probably have some sanity checking now that we have things that don't exist in the db.

  4. 
      
chipx86
  1. 
      
  2. reviewboard/scmtools/forms.py (Diff revision 5)
     
     
    Show all issues

    Missing period. All comments should be complete sentences.

  3. reviewboard/scmtools/forms.py (Diff revision 5)
     
     
    Show all issues

    Missing trailing comma.

  4. reviewboard/scmtools/forms.py (Diff revision 5)
     
     
    Show all issues

    I don't understand the purpose of this variable? Maybe it needs a better name.

  5. Show all issues

    Let's move this to one var statement.

  6. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/templates/admin/repository_fields.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/fake.py
        reviewboard/scmtools/forms.py
    
    Ignored Files:
        reviewboard/templates/admin/repository_fields.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.5.x (6673971)