`rbt post` command uses API's DiffValidation endpoint before upload
Review Request #6407 — Created Oct. 6, 2014 and submitted
Before updating a review request or creating a new one, `rbt post`
command validates the diff file and terminates if it does not pass
validation. This prevents the command from creating empty review
requests when the supplied diff file is invalid.
Tested
rbt post
with:
1. Empty diff (error 219)
2. Diff from a different repository (error 207)
3. Non-diff file as a diff (error 224)
4. Valid diff (success)using:
1. Git
2. MercurialAlso tested
base_dir
with a subversion reporitory.
Description | From | Last Updated |
---|---|---|
Col: 21 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 11 E111 indentation is not a multiple of four |
reviewbot | |
Col: 11 E111 indentation is not a multiple of four |
reviewbot | |
Col: 11 E111 indentation is not a multiple of four |
reviewbot | |
Col: 11 E111 indentation is not a multiple of four |
reviewbot | |
Col: 11 E111 indentation is not a multiple of four |
reviewbot | |
Can you move this to come after DiffResource? You just stuck it in between DiffListResource and DiffResource. |
david | |
The resource isn't actually a "List", it's just a bug in the API docs. Let's just document it here as … |
SM smacleod | |
This should have a comment mentioning the TODO of unifying this and DiffListResource.update_diff (and probably a correspending comment in update_diff) |
david | |
You should avoid breaking lines with \\ whenever possible. This should probably be written: RESOURCE_MAP['application/vnd.reviewboard.org.diff-validation'] = ( DiffValidationResource) |
SM smacleod | |
You need to pass in the parent diff and base dir, if they exist. Parent diffs can be tested by … |
david | |
Can you make sure that everything here uses single quotes? |
david | |
Can you use single quotes for these strings? |
david |
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/api/resource.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/api/resource.py
-
If this is more or less complete, you should remove the 'WIP' tag from the summary.
I'd like to see more testing with additional version control systems (and some testing of parent diffs).
-
Can you move this to come after DiffResource? You just stuck it in between DiffListResource and DiffResource.
-
This should have a comment mentioning the TODO of unifying this and DiffListResource.update_diff (and probably a correspending comment in update_diff)
-
You need to pass in the parent diff and base dir, if they exist.
Parent diffs can be tested by making two commits on git, and then running 'rbt post HEAD' with the latest commit checked out. The base dir can be tested by connecting an SVN repository and posting a change against it.
-
-
The resource isn't actually a "List", it's just a bug in the API docs. Let's just document it here as
The Validate Diff resource specific base class.
-
You should avoid breaking lines with
\\
whenever possible. This should probably be written:
RESOURCE_MAP['application/vnd.reviewboard.org.diff-validation'] = (
DiffValidationResource)
- Change Summary:
-
Moved small issues mainly about coding style.
- Commit:
-
eb61604ce95a7a9f25aeef9914c4528dd39f5cdcad488ba558657147c386ffb9498c96bac3ee3673
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/api/resource.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/api/resource.py
- Change Summary:
-
Now passing parent diff and base dir to
validate_diff()
method. - Summary:
-
[WIP] `rbt post` command uses API's DiffValidation endpoint before upload`rbt post` command uses API's DiffValidation endpoint before upload
- Testing Done:
-
Tested
rbt post
with:1. Empty diff (error 219) 2. Diff from a different repository (error 207) 3. Non-diff file as a diff (error 224) 4. Valid diff (success) + + using:
+ 1. Git + 2. Mercurial + + I'm having trouble installing
subvertpy
, so I haven't testedbase_dir
yet. - Commit:
-
ad488ba558657147c386ffb9498c96bac3ee3673f9c33e6d322602589191fd79aa4e6d076748f3f3
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/api/resource.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/api/resource.py
- Testing Done:
-
Tested
rbt post
with:1. Empty diff (error 219) 2. Diff from a different repository (error 207) 3. Non-diff file as a diff (error 224) 4. Valid diff (success) using:
1. Git 2. Mercurial ~ I'm having trouble installing
subvertpy
, so I haven't testedbase_dir
yet.~ Also tested
base_dir
with a subversion reporitory.
- Change Summary:
-
- Replaced double quotes with singe quotes in some places
- Removed dublicate code for
repository
andbase_dir
- Commit:
-
f9c33e6d322602589191fd79aa4e6d076748f3f3a288b2c139d4a5fb00b93932aaca6f191fba27f3