Conditions for adding DefaultReviewers to reviewrequest
Review Request #9579 — Created Feb. 3, 2018 and discarded
Replaces
file_match
field with a user set conditions which applied
will be tested on all posted review requests for the corresponding
repositories.Changes:
-
Removed
file_match
field from form -
Added Conditions widget to form
-
Added description field to form and as a list column
-
Added diffed file options (corresponding to old regex functionality)
-
Added evolution for database
-
Refactored code for adding default reviewers to a ReviewRequest
-
Added lazy migration for default reviewers
-
Migrated when tested against review requests
-
Migrated when before being edited by an admin
-
- Created a test repository with a test struture to try various
conditions including string matching and files diffed. - Created commit to trigger migrations and be applied to review
request. - Test commit as review request to verify expected behavior
before applying evolution - Applied evolution
- Posted review request to verify same behavior was exhibited
- Test other string operations
- ends with
- starts with
- contains
Description | From | Last Updated |
---|---|---|
E122 continuation line missing indentation or outdented |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
F401 'djblets.conditions.choices.BaseConditionChoice' imported but unused |
reviewbot | |
F401 'reviewboard.scmtools.conditions.RepositoriesChoice' imported but unused |
reviewbot | |
F401 'reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin' imported but unused |
reviewbot | |
F811 redefinition of unused 'ReviewRequestRepositoryTypeChoice' from line 19 |
reviewbot | |
F811 redefinition of unused 'ReviewRequestRepositoriesChoice' from line 19 |
reviewbot | |
F811 redefinition of unused 'ReviewRequestConditionChoices' from line 19 |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E501 line too long (86 > 79 characters) |
reviewbot | |
E501 line too long (85 > 79 characters) |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E122 continuation line missing indentation or outdented |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
F401 'djblets.conditions.choices.BaseConditionChoice' imported but unused |
reviewbot | |
F401 'reviewboard.scmtools.conditions.RepositoriesChoice' imported but unused |
reviewbot | |
F401 'reviewboard.reviews.conditions.ReviewRequestConditionChoiceMixin' imported but unused |
reviewbot | |
F811 redefinition of unused 'ReviewRequestRepositoryTypeChoice' from line 19 |
reviewbot | |
F811 redefinition of unused 'ReviewRequestRepositoriesChoice' from line 19 |
reviewbot | |
F811 redefinition of unused 'ReviewRequestConditionChoices' from line 19 |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E501 line too long (86 > 79 characters) |
reviewbot | |
E501 line too long (85 > 79 characters) |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
F401 'djblets.conditions.choices.BaseConditionChoice' imported but unused |
reviewbot | |
F811 redefinition of unused 'ReviewRequestRepositoryTypeChoice' from line 19 |
reviewbot | |
F811 redefinition of unused 'ReviewRequestRepositoriesChoice' from line 19 |
reviewbot | |
F811 redefinition of unused 'ReviewRequestConditionChoices' from line 19 |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
F401 'djblets.conditions.Condition' imported but unused |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
F401 'djblets.conditions.Condition' imported but unused |
reviewbot | |
F401 'djblets.conditions.ConditionSet' imported but unused |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
Please undo this change. |
david | |
The comma isn't necessary here. We probably also don't need to say it replaces X fields here in the UI, … |
david | |
django before djblets (alphabetical order) |
david | |
Having each of the models in their own file is an implementation detail. We still want to import from reviewboard.reviews.models. |
david | |
Please undo this change. |
david | |
Please add a trailing comma to this line. |
david | |
Can you add a module docstring to this? |
david | |
Swap these two lines. |
david | |
No blank line here. |
david | |
No blank lines here. |
david | |
Shouldn't have the blank line above this, but this should be sorted with the other reviewboard.reviews imports. |
david | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
Can you use single-quotes here? |
david | |
Condition -> Conditions? |
david | |
Blank line between these two please. |
david | |
Blank line between these two please. |
david | |
What was the case that was causing this? |
david | |
Blank line between these two please. |
david | |
No blank line here. |
david | |
c before d |
david | |
I know the other fields use double-quotes and lower case, but we should have new stuff use single-quotes and uppercase. … |
david | |
Review Bot complained about this but indentation is wacky. How about: conditions = JSONField(default={ 'mode': ConditionSet.DEFAULT_MODE, 'conditions': [], }) |
david | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
review_request should probably be called draft because it's operating on a draft. |
david | |
Docstring summaries should be in the imperative mood (Return X) rather than passive (Returns X). There's also a typo (wether) … |
david | |
This should be prefixed with "Args:" and indented another 4 spaces. We're missing docs for the review_request argument (well, if … |
david | |
These two conditions can be combined together: if (check_repo and review_request.repository not in self.repository.all()): |
david | |
Blank line between these two. |
david | |
Blank line between these two. |
david | |
This looks like it probably will fit on one line. |
david | |
Needs a docstring. |
david | |
Needs a docstring. |
david | |
Needs a docstring. |
david | |
Needs a docstring. |
david | |
u prefixes on strings aren't necessary (we're importing unicode_literals at the top of the file). |
david | |
Trailing comma. |
david | |
Trailing comma. |
david | |
Trailing comma. |
david | |
E261 at least two spaces before inline comment |
reviewbot | |
E262 inline comment should start with '# ' |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
F401 'djblets.conditions.ConditionSet' imported but unused |
reviewbot | |
F401 'nose.tools.set_trace' imported but unused |
reviewbot | |
F401 'pdb' imported but unused |
reviewbot | |
F401 'json' imported but unused |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
F401 'nose.tools.set_trace' imported but unused |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
F401 'djblets.webapi.fields.ListFieldType' imported but unused |
reviewbot | |
F401 'nose.tools.set_trace' imported but unused |
reviewbot | |
E226 missing whitespace around arithmetic operator |
reviewbot | |
F841 local variable 'ke' is assigned to but never used |
reviewbot | |
E303 too many blank lines (2) |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot | |
E501 line too long (97 > 79 characters) |
reviewbot |
- Change Summary:
-
JS changes
- Diff:
-
Revision 2 (+88 -19)
Checks run (1 failed, 1 succeeded)
flake8
- Change Summary:
-
progress from Fed 9th added.
- Summary:
-
WIP CODE DROP 2: Getting closer but still not workingWIP CODE DROP: ConditionField for DefaultReviewers
- Description:
-
~ CODE DROP 2: Getting closer but still not working
~ Replaces 'file_match' field and the select repository field with user a
+ set conditions which applied will be tested on all posted review + requests. ~ Didn't get as much time as I would've liked to flesh this out. But I
~ got a really good idea where I need to go since I've tried a fair ~ amount of things. The big issue is getting the condition options ~ to display. Most of the other examples I found with conditions are ~ integrations which build forms differently than anything part of ~ reviewboard as far as I can tell. ~ This update provides an evolution to add a column for a json entry
~ that stores the condition set. Now, settings selected in the add ~ default reviewers for the condition field will be saved and reloaded ~ if a default reviewer is viewed from the admin panel. ~ This also changes the labels displayed when the list view for all the ~ default reviewers is displayed. Now, there is only the name. A + description could be a possible solution for describing this + condition. - Testing Done:
-
+ Created a new default reviewer, viewed that the count of reviewers
+ changed. Edited the default reviwer, reloaded it to verify that the + settings changed. - Diff:
-
Revision 3 (+99 -10)
Checks run (1 failed, 1 succeeded)
flake8
- Change Summary:
-
Now adds options for diffed file regex and readds the specified repository field.
- Description:
-
~ Replaces 'file_match' field and the select repository field with user a
~ Replaces
file_match
field with user aset conditions which applied will be tested on all posted review ~ requests. ~ requests for a specified repository. ~ This update provides an evolution to add a column for a json entry
~ that stores the condition set. Now, settings selected in the add ~ default reviewers for the condition field will be saved and reloaded ~ if a default reviewer is viewed from the admin panel. ~ This also changes the labels displayed when the list view for all the ~ default reviewers is displayed. Now, there is only the name. A ~ description could be a possible solution for describing this ~ condition. ~ Progress to far:
~ * Add Conditions widget to form ~ * Remove file_match
field from form~ * Add evoluion for database ~ * Add diffed file option ~ * Add code to execute conditions on review request post ~ ~ Work to be done:
+ * Add migration + * Tweak regex options + * Add description field - Diff:
-
Revision 4 (+85 -5)
- Change Summary:
-
Grammar, bullet points, words.
- Description:
-
Replaces
file_match
field with user aset conditions which applied will be tested on all posted review requests for a specified repository. ~ Progress to far:
~ Progress to far:
- * Add Conditions widget to form - * Remove file_match
field from form- * Add evoluion for database - * Add diffed file option - * Add code to execute conditions on review request post ~ Work to be done:
~ * Add migration ~ * Tweak regex options ~ * Add description field ~ -
Add Conditions widget to form
~ -
Remove
file_match
field from form
~ -
Add evolution for database
~ -
Add diffed file option
+ -
Add code to execute conditions on review request post
+ + Work to be done:
+ + -
Add migration
+ -
Tweak regex options
+ -
Add description field
-
- Change Summary:
-
Now adds migrations from file_regex to conditions, automatic application of conditions to new review request (still buggy),
- Description:
-
Replaces
file_match
field with user aset conditions which applied will be tested on all posted review requests for a specified repository. Progress to far:
-
Add Conditions widget to form
-
Remove
file_match
field from form
-
Add evolution for database
-
Add diffed file option
-
Add code to execute conditions on review request post
+ - Added migrations
Work to be done:
~ -
Add migration
~ -
Tweak regex options
~ - Add description field
~ - Create Test cases
- -
Add description field
-
- Testing Done:
-
Created a new default reviewer, viewed that the count of reviewers
changed. Edited the default reviwer, reloaded it to verify that the settings changed. + + Fair amount, will update one current issue is fixed.
- Commit:
-
fd1ed14ead060f0b38cdd0827b27d5321077660cc072e9936a24c25f60fd6d5e5fd061fcd70ab51b
- Diff:
-
Revision 5 (+570 -30)
Checks run (1 failed, 1 succeeded)
flake8
- Change Summary:
-
Finished task so far. Now requires reviewing
- Summary:
-
WIP CODE DROP: ConditionField for DefaultReviewersConditions for adding DefaultReviewers to reviewrequest
- Description:
-
~ Replaces
file_match
field with user a~ set conditions which applied will be tested on all posted review ~ requests for a specified repository. ~ Replaces
file_match
field with a user set conditions which applied~ will be tested on all posted review requests for the corresponding ~ repositories. ~ Progress to far:
~ Changes:
~ -
Add Conditions widget to form
~ -
Remove
file_match
field from form
~ -
Add evolution for database
~ -
Add diffed file option
~ -
Add code to execute conditions on review request post
~ - Added migrations
~ ~ -
Removed
file_match
field from form
~ -
Added Conditions widget to form
~ -
Added description field to form and as a list column
~ -
Added diffed file options (corresponding to old regex functionality)
~ -
Added evolution for database
~ -
Refactored code for adding default reviewers to a ReviewRequest
~ -
Added lazy migration for default reviewers
-
Migrated when tested against review requests
-
Migrated when before being edited by an admin
-
- Work to be done:
- - - Add description field
- - Create Test cases
-
- Testing Done:
-
~ Created a new default reviewer, viewed that the count of reviewers
~ changed. Edited the default reviwer, reloaded it to verify that the ~ settings changed. ~ ~ Fair amount, will update one current issue is fixed.
~ - Created a test repository with a test struture to try various
conditions including string matching and files diffed.
~ - Created commit to trigger migrations and be applied to review
request.
~ - Test commit as review request to verify expected behavior
before applying evolution
~ - Applied evolution
~ - Posted review request to verify same behavior was exhibited
+ - Test other string operations
- ends with
- starts with
- contains
- Created a test repository with a test struture to try various
- Commit:
-
c072e9936a24c25f60fd6d5e5fd061fcd70ab51bd6e14f4f738e41e6ae6e11b852567d110c4305fb
- Diff:
-
Revision 6 (+128 -56)
- Change Summary:
-
Forgot to add the student projects to the reviewers...
- Groups:
-
-
-
The comma isn't necessary here. We probably also don't need to say it replaces X fields here in the UI, since those fields are no longer present (and it would be confusing to users who are looking at this for the first time). We'll talk about the change in the release notes.
-
-
Having each of the models in their own file is an implementation detail. We still want to import from
reviewboard.reviews.models
. -
-
-
-
-
-
-
Shouldn't have the blank line above this, but this should be sorted with the other reviewboard.reviews imports.
-
-
-
-
-
-
-
-
-
I know the other fields use double-quotes and lower case, but we should have new stuff use single-quotes and uppercase.
(the names all get title-cased by the UI display anyway--we'll fix up the older code at some point in the future)
-
Review Bot complained about this but indentation is wacky. How about:
conditions = JSONField(default={ 'mode': ConditionSet.DEFAULT_MODE, 'conditions': [], })
-
-
Docstring summaries should be in the imperative mood (Return X) rather than passive (Returns X).
There's also a typo (wether) and some weird grammar (this requests). How about:
Return whether this default reviewer rule matches the draft.
-
This should be prefixed with "Args:" and indented another 4 spaces. We're missing docs for the
review_request
argument (well, if you make the above change,draft
).We also need a "Returns:" section explaining the type and meaning of the return value.
-
These two conditions can be combined together:
if (check_repo and review_request.repository not in self.repository.all()):
-
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
Messing with pdb to find out the issue with the test cases. WIP
- Commit:
-
d6e14f4f738e41e6ae6e11b852567d110c4305fb3fd535ff50c16c2e2e499b29af9c53b9fe41f968
- Diff:
-
Revision 7 (+236 -68)
Checks run (2 timed out)
- Change Summary:
-
Current progress on moving repositories to conditions.
- Commit:
-
3fd535ff50c16c2e2e499b29af9c53b9fe41f968a8dbfd785d5005411962ed5cee5976f55cb4703a
- Diff:
-
Revision 8 (+851 -175)