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. |
david | |
Can you move this above the clean methods? The clean methods, while not private, are more akin to private methods … |
chipx86 | |
Other labels don't include periods. |
david | |
F841 local variable 'diff_file' is assigned to but never used |
reviewbot | |
F841 local variable 'diffset_history' is assigned to but never used |
reviewbot | |
Do we want to call this commit_message? |
chipx86 | |
Can we use forms.EmailField? (Might hit some issue with values that aren't e-mail fields, so maybe not...) If not, maybe … |
chipx86 | |
This and committer_date should probably use forms.DateTimeField. |
chipx86 | |
This needs to be the full path to the model. |
chipx86 | |
This needs to be the full path to the model. |
chipx86 | |
If using DateTimeField, we shouldn't need these. |
chipx86 | |
Missing comma at the end. Can you move the SimpleUplodaedFile out into its own variable? That'll simplify this dictionary. |
chipx86 | |
No need for a set(), since there's only one item. Probably no need to cast to anything. I imagine it'll … |
chipx86 | |
You should be able to pull these out too, and reuse them for both forms. |
chipx86 | |
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. |
chipx86 | |
Same comment here as above. |
chipx86 | |
And these. |
chipx86 | |
Should be "Parent diff", to match labels below. |
chipx86 | |
You can remove the first "only." |
chipx86 | |
I want to strive for more friendly errors, and think we can improve on this just a tad. How about … |
chipx86 | |
Summary shouldn't have literals. |
chipx86 | |
Let's group together repository and the spy, and then separate out the diffset. Actually, why not have a setUp() that … |
chipx86 | |
Grouping should be consistent with the above test. Same for the next test. |
chipx86 | |
Do we modify the data passed in? |
chipx86 | |
Let's use update_fields, get just a bit of a speed boost. If we start to do that in more tests, … |
chipx86 | |
Can you reverse these? |
chipx86 | |
Both of these are separate, even though they're both about dates. They're separate pieces of code with their own logic. … |
chipx86 | |
E501 line too long (80 > 79 characters) |
reviewbot | |
datetime.datetime |
chipx86 | |
datetime.datetime |
chipx86 | |
Two blank lines. |
chipx86 | |
I mentioned this before, but I think we want to use list() here, since ordering matters and we want to … |
chipx86 |
- Commit:
-
fe4eb70deb54c0ea1681351770c4a8f9eab82ed3c873a131535fe9c303f969fa7e0aa7696db28b64
Checks run (2 succeeded)
- Change Summary:
-
Fix depends-on
- Change Summary:
-
Addressed Christian's issues.
- Commit:
-
c873a131535fe9c303f969fa7e0aa7696db28b641bfa88fb446b72d0de60c0fe51749ca06c896f72
Checks run (2 succeeded)
- Change Summary:
-
Rebased.
- Commit:
-
1bfa88fb446b72d0de60c0fe51749ca06c896f729acb842bd8af5b3f09b052ba3b2e04742c8ed2c4
Checks run (2 succeeded)
- Change Summary:
-
Addressed David's issues.
- Commit:
-
9acb842bd8af5b3f09b052ba3b2e04742c8ed2c495922560dcbd2e158ef6419c871263969d94f3c1
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.
- Move
- Commit:
-
95922560dcbd2e158ef6419c871263969d94f3c13aa1b16cf2bee17e41599f656544ab9ce37999bc
- Change Summary:
-
Fix flake8 issues.
- Commit:
-
3aa1b16cf2bee17e41599f656544ab9ce37999bc88e25fecc47035bb3bd4b23b8eaad77c9616716c
Checks run (2 succeeded)
- Description:
-
A new form has been added to upload a
DiffCommit
and attach it to aDiffSet
. The common functionality (almost all of the implementation)~ with the UploadDiffForm has been refactored out into the
BaseUploadDiffForm`.~ with the UploadDiffForm
has been refactored out into the+ BaseUploadDiffForm
.
-
-
-
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.
-
-
-
-
-
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 iterate. -
-
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:
-
88e25fecc47035bb3bd4b23b8eaad77c9616716ce7dc1f410e117ef41f5a4ba7da2062c35df8d46c
Checks run (2 succeeded)
- Change Summary:
-
catch datetime validation errors
- Commit:
-
e7dc1f410e117ef41f5a4ba7da2062c35df8d46c63cecf6cc5e32e72b3a78b7ed892b77971e4b20b
Checks run (2 succeeded)
- Commit:
-
63cecf6cc5e32e72b3a78b7ed892b77971e4b20b9ae2988be66d334ff0796da4da00faeee7833388
Checks run (2 succeeded)
- Change Summary:
-
Rebase.
Remove BaseUploadDiffForm since implementation has diverged enough. - Description:
-
A new form has been added to upload a
DiffCommit
and attach it to a~ DiffSet
. The common functionality (almost all of the implementation)~ DiffSet
.- with the UploadDiffForm
has been refactored out into the- BaseUploadDiffForm
. - Commit:
-
9ae2988be66d334ff0796da4da00faeee78333886a97d4171e4466564daac3ed1a7e307cb9a95749
Checks run (2 succeeded)
- Change Summary:
-
Rename some fields
- Commit:
-
6a97d4171e4466564daac3ed1a7e307cb9a957499e137434c663fb494c60b9aacb976ac3a3bfbc9b
Checks run (2 succeeded)
- Change Summary:
-
Require ISO 8601 dates
- Depends On:
-
- Commit:
9e137434c663fb494c60b9aacb976ac3a3bfbc9b746d4ac6c83fa088ca4332463363a4ae511c1cbb- Diff:
Revision 13 (+363 -12)
Checks run (2 succeeded)
flake8 passed.JSHint passed.
- Change Summary:
-
diff_commit_count -> diffcommit_count
- Commit:
-
746d4ac6c83fa088ca4332463363a4ae511c1cbb833aa54a17549f6f22f41bf52e2c039381bcf087
Checks run (2 succeeded)
- Change Summary:
-
Oops
- Commit:
-
833aa54a17549f6f22f41bf52e2c039381bcf087cdf686f830798bb31432b659981093427a51edba
Checks run (2 succeeded)
-
-
-
-
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."
-
-
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. -
-
-
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. -
-
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.
- Change Summary:
-
flake8 fixups
- Commit:
-
f5385c32f09db3759c50cecd4aa6a419422bd1147d05e96119044a8eec793c072ac977a389e0533c
Checks run (2 succeeded)
- Change Summary:
-
Addressed feedback.
- Commit:
-
7d05e96119044a8eec793c072ac977a389e0533ca68c157419c4c8a6a2712be7bce7ef43cf85a252
Checks run (2 succeeded)
- Change Summary:
-
Allow parent diff in subsequent commits
- Commit:
-
a68c157419c4c8a6a2712be7bce7ef43cf85a252e50fa3063f074d7649fa4dcdadcc6ddebc98f77e