Add a form for uploading DiffCommits
Review Request #9642 — Created Feb. 15, 2018 and submitted
A new form has been added to upload a
DiffCommit
and attach it to a
DiffSet
.
Ran unit tests.
Description | From | Last Updated |
---|---|---|
This looks like an unintentional change. |
|
|
Can you move this above the clean methods? The clean methods, while not private, are more akin to private methods … |
|
|
Other labels don't include periods. |
|
|
F841 local variable 'diff_file' is assigned to but never used |
![]() |
|
F841 local variable 'diffset_history' is assigned to but never used |
![]() |
|
Do we want to call this commit_message? |
|
|
Can we use forms.EmailField? (Might hit some issue with values that aren't e-mail fields, so maybe not...) If not, maybe … |
|
|
This and committer_date should probably use forms.DateTimeField. |
|
|
This needs to be the full path to the model. |
|
|
This needs to be the full path to the model. |
|
|
If using DateTimeField, we shouldn't need these. |
|
|
Missing comma at the end. Can you move the SimpleUplodaedFile out into its own variable? That'll simplify this dictionary. |
|
|
No need for a set(), since there's only one item. Probably no need to cast to anything. I imagine it'll … |
|
|
You should be able to pull these out too, and reuse them for both forms. |
|
|
Can you update this to be: data=dict({ 'parent_id': 'r1', 'commit_id': 'r2', }, **self._default_form_data) This follows the pattern we use elsewhere. |
|
|
Same comment here as above. |
|
|
And these. |
|
|
Should be "Parent diff", to match labels below. |
|
|
You can remove the first "only." |
|
|
I want to strive for more friendly errors, and think we can improve on this just a tad. How about … |
|
|
Summary shouldn't have literals. |
|
|
Let's group together repository and the spy, and then separate out the diffset. Actually, why not have a setUp() that … |
|
|
Grouping should be consistent with the above test. Same for the next test. |
|
|
Do we modify the data passed in? |
|
|
Let's use update_fields, get just a bit of a speed boost. If we start to do that in more tests, … |
|
|
Can you reverse these? |
|
|
Both of these are separate, even though they're both about dates. They're separate pieces of code with their own logic. … |
|
|
E501 line too long (80 > 79 characters) |
![]() |
|
datetime.datetime |
|
|
datetime.datetime |
|
|
Two blank lines. |
|
|
I mentioned this before, but I think we want to use list() here, since ordering matters and we want to … |
|
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+161 -7) |
Checks run (2 succeeded)
-
-
reviewboard/diffviewer/forms.py (Diff revision 2) Can you move this above the
clean
methods? Theclean
methods, while not private, are more akin to private methods thanclean
(which is meant to be used by consumers and should be more prominent).
Change Summary:
Fix depends-on
Depends On: |
|
---|
Change Summary:
Addressed Christian's issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+161 -7) |
Checks run (2 succeeded)
Change Summary:
Rebased.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+163 -7) |
Checks run (2 succeeded)
Change Summary:
Addressed David's issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+163 -7) |
Checks run (2 succeeded)
Change Summary:
- Move
diffset
argument into constructor. - Handle published diffsets (form validation fails).
- Handle parent diffs on subsequent commits (form validation fails).
- Add unit tests for above.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+323 -8) |
Checks run (1 failed, 1 succeeded)
flake8
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 6) F841 local variable 'diff_file' is assigned to but never used
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 6) F841 local variable 'diffset_history' is assigned to but never used
Change Summary:
Fix flake8 issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+319 -8) |
Checks run (2 succeeded)
Description: |
|
---|
-
-
-
reviewboard/diffviewer/forms.py (Diff revision 7) Can we use
forms.EmailField
? (Might hit some issue with values that aren't e-mail fields, so maybe not...)If not, maybe we should at least still use
EmailInput
as the widget.Here and the other form below.
-
reviewboard/diffviewer/forms.py (Diff revision 7) This and
committer_date
should probably useforms.DateTimeField
. -
-
-
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 7) Missing comma at the end.
Can you move the
SimpleUplodaedFile
out into its own variable? That'll simplify this dictionary. -
reviewboard/diffviewer/tests/test_forms.py (Diff revision 7) No need for a
set()
, since there's only one item. Probably no need to cast to anything. I imagine it'll iterate. -
reviewboard/diffviewer/tests/test_forms.py (Diff revision 7) You should be able to pull these out too, and reuse them for both forms.
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 7) Can you update this to be:
data=dict({ 'parent_id': 'r1', 'commit_id': 'r2', }, **self._default_form_data)
This follows the pattern we use elsewhere.
-
-
Change Summary:
Addressed Christian's issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 8 (+320 -9) |
Checks run (2 succeeded)
Change Summary:
catch datetime validation errors
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 9 (+328 -9) |
Checks run (2 succeeded)
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 10 (+328 -9) |
Checks run (2 succeeded)
Change Summary:
Rebase.
Remove BaseUploadDiffForm since implementation has diverged enough.
Description: |
|
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
|||||||||||||||
Diff: |
Revision 11 (+336 -12) |
Checks run (2 succeeded)
Change Summary:
Rename some fields
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 12 (+336 -12) |
Checks run (2 succeeded)
Change Summary:
Require ISO 8601 dates
Depends On: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 13 (+363 -12) |
Checks run (2 succeeded)
Change Summary:
diff_commit_count -> diffcommit_count
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 14 (+363 -12) |
Checks run (2 succeeded)
Change Summary:
Oops
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 15 (+363 -12) |
Checks run (2 succeeded)
-
-
-
-
reviewboard/diffviewer/forms.py (Diff revision 15) I want to strive for more friendly errors, and think we can improve on this just a tad. How about simply: "This date must be in ISO 8601 format."
-
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 15) Let's group together
repository
and the spy, and then separate out the diffset.Actually, why not have a
setUp()
that handles these objects? We're repeating ourselves a lot. -
reviewboard/diffviewer/tests/test_forms.py (Diff revision 15) Grouping should be consistent with the above test.
Same for the next test.
-
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 15) Let's use
update_fields
, get just a bit of a speed boost. If we start to do that in more tests, we'll speed up the test suite. -
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 15) Both of these are separate, even though they're both about dates. They're separate pieces of code with their own logic. The docstring even really acknowledges this. We should break this into two tests.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 16 (+362 -12) |
Checks run (1 failed, 1 succeeded)
flake8
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 16) E501 line too long (80 > 79 characters)
Change Summary:
flake8 fixups
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 17 (+363 -12) |
Checks run (2 succeeded)
Change Summary:
Addressed feedback.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 18 (+364 -12) |
Checks run (2 succeeded)
Change Summary:
Allow parent diff in subsequent commits
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 19 (+340 -12) |
Checks run (2 succeeded)
-
-
reviewboard/diffviewer/tests/test_forms.py (Diff revision 19) I mentioned this before, but I think we want to use
list()
here, since ordering matters and we want to know if that ever breaks.