Merge ~nacc/usd-importer:gu-lint into usd-importer:master
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | d4dec79b2d01362372b0e8ec4701fb3820e8f31b | ||||
| Proposed branch: | ~nacc/usd-importer:gu-lint | ||||
| Merge into: | usd-importer:master | ||||
| Diff against target: |
1631 lines (+934/-285) 16 files modified
dev/null (+0/-156) doc/README.md (+1/-1) gitubuntu/__main__.py (+2/-0) gitubuntu/clone.py (+2/-1) gitubuntu/git_repository.py (+87/-74) gitubuntu/importer.py (+1/-1) gitubuntu/importlocal.py (+3/-3) gitubuntu/lint.py (+558/-0) gitubuntu/logging.py (+12/-0) gitubuntu/merge.py (+6/-4) gitubuntu/remote.py (+1/-1) gitubuntu/source_information.py (+33/-20) gitubuntu/submit.py (+26/-23) gitubuntu/tag.py (+1/-1) gitubuntu/versioning.py (+200/-0) snap/snapcraft.yaml (+1/-0) |
||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Robie Basak | 2017-07-13 | Approve on 2017-07-14 | |
|
Review via email:
|
|||
Description of the Change
This will only make sense after the MP for gitubuntu-
With these changes:
$ git ubuntu clone squid3
$ git ubuntu remote add ahasenack
$ git ubuntu lint ahasenack/
07/13/2017 17:13:12 - DEBUG:Executing: git config gitubuntu.lpuser
07/13/2017 17:13:12 - INFO:Using git repository at /home/nacc/
07/13/2017 17:13:12 - DEBUG:Executing: grep -q "* -ident" /home/nacc/
07/13/2017 17:13:12 - DEBUG:Executing: grep -q "* -text" /home/nacc/
07/13/2017 17:13:12 - DEBUG:Executing: grep -q "* -eol" /home/nacc/
07/13/2017 17:13:12 - DEBUG:Executing: git config gitubuntu.lpuser
07/13/2017 17:13:12 - DEBUG:Executing: sh -c 'echo ahasenack/
07/13/2017 17:13:12 - DEBUG:Executing: sh -c 'echo ahasenack/
Verified that only new modifications to changelog are top-most additions
07/13/2017 17:13:17 - DEBUG:Executing: sh -c 'echo pkg/ubuntu/
07/13/2017 17:13:36 - DEBUG:Executing: sh -c 'echo ahasenack/
07/13/2017 17:13:37 - DEBUG:Executing: sh -c 'echo ahasenack/
Verified that debian/changelog version is as expected
07/13/2017 17:13:37 - DEBUG:Executing: git checkout pkg/ubuntu/
07/13/2017 17:13:38 - DEBUG:Executing: update-maintainer
07/13/2017 17:13:38 - DEBUG:Executing: git --work-tree . add -f -A
07/13/2017 17:13:38 - DEBUG:Executing: git --work-tree . write-tree
07/13/2017 17:13:38 - DEBUG:Executing: git clean -f -d
07/13/2017 17:13:38 - DEBUG:Executing: git reset --hard pkg/ubuntu/
07/13/2017 17:13:38 - DEBUG:Executing: git checkout d6f2273743dbaf1
Verified that update-maintainer has been run
All lint checks passed
Without --verbose, you just get the last line "All lint checks passed" :)
Example Ubuntu merge lint:
$ git ubuntu clone samba
$ git ubuntu remote add ahsenack
$ git ubuntu lint ahasenack/
$ git ubuntu lint ahasenack/
07/13/2017 17:55:40 - DEBUG:Executing: git config gitubuntu.lpuser
07/13/2017 17:55:40 - INFO:Using git repository at /home/nacc/
07/13/2017 17:55:40 - DEBUG:Executing: grep -q "* -ident" /home/nacc/
07/13/2017 17:55:40 - DEBUG:Executing: grep -q "* -text" /home/nacc/
07/13/2017 17:55:40 - DEBUG:Executing: grep -q "* -eol" /home/nacc/
07/13/2017 17:55:40 - DEBUG:Executing: git config gitubuntu.lpuser
07/13/2017 17:55:40 - DEBUG:Executing: sh -c 'echo ahasenack/
Verified ahasenack/
Verified old/debian is the same commit as ahasenack/
Verified old/debian is the same tree as ahasenack/
Verified ahasenack/
Verified old/ubuntu is the same commit as ahasenack/
Verified old/ubuntu is the same tree as ahasenack/
Verified ahasenack/
W: Expected new/debian (f8ed72878e00e0
E: Expected new/debian (e67a4e80a20cc9
07/13/2017 17:55:40 - DEBUG:Executing: sh -c 'echo pkg/ubuntu/
07/13/2017 17:55:40 - DEBUG:Executing: sh -c 'echo pkg/ubuntu/
Verified ahasenack/
Verified pkg/import/
Verified ahasenack/
Verified pkg/import/
Verified ahasenack/
Verified debian/changelog is in diff between deconstruct and logical
Verified only update-maintainer changes are in diff between deconstruct and logical to debian/control
07/13/2017 17:55:40 - DEBUG:Executing: git checkout pkg/debian/sid
07/13/2017 17:55:40 - DEBUG:Executing: git-ubuntu.
07/13/2017 17:55:40 - DEBUG:Executing: git-merge-
07/13/2017 17:55:41 - DEBUG:Executing: git --work-tree . add -f -A
07/13/2017 17:55:41 - DEBUG:Executing: git --work-tree . write-tree
07/13/2017 17:55:41 - DEBUG:Executing: git clean -f -d
07/13/2017 17:55:41 - DEBUG:Executing: git reset --hard pkg/debian/sid
07/13/2017 17:55:41 - DEBUG:Executing: git checkout 8cdb5099524ec5e
E: More than one changelog diff hunk detected
+samba (2:4.6.
+
+ * Merge with Debian unstable (LP: #1700644). Remaining changes:
+ - debian/
+ - debian/smb.conf;
+ + Add "(Samba, Ubuntu)" to server string.
+ + Comment out the default [homes] share, and add a comment about
+ "valid users = %s" to show users how to restrict access to
+ \\server\username to only username.
+ - debian/
+ + Do not change priority to high if dhclient3 is installed.
+ - Add apport hook:
+ + Created debian/
+ + debian/rules, debian/
+ - Add extra DEP8 tests to samba (LP #1696823):
+ + d/t/control: enable the new DEP8 tests
+ + d/t/smbclient-
+ + d/t/smbclient-
+ an authenticated connection
+ + d/t/smbclient-
+ + d/t/cifs-
+ - Ask the user if we can run testparm against the config file. If yes,
+ include its stderr and exit status in the bug report. Otherwise, only
+ include the exit status. (LP #1694334)
+ - If systemctl is available, use it to query the status of the smbd
+ service before trying to reload it. Otherwise, keep the same check
+ as before and reload the service based on the existence of the
+ initscript. (LP #1579597)
+ * Refresh patches to get rid of offsets:
+ - d/p/usershare.patch
+ - d/p/xsltproc_
+ * d/p/non-
+ regression which breaks symlinks to directories on certain systems
+ (LP: #1701073)
+
+ -- Andreas Hasenack <email address hidden> Fri, 07 Jul 2017 18:07:38 -0300
+
samba (2:4.6.5+dfsg-3) unstable; urgency=medium
* Remove upstart code
9-January-1994 Bruce Perens <email address hidden>
* Added Debian GNU/Linux package maintenance system files, and
configured for Debian systems.
+
07/13/2017 17:55:41 - DEBUG:Executing: git checkout pkg/debian/sid
07/13/2017 17:55:42 - DEBUG:Executing: update-maintainer
07/13/2017 17:55:42 - DEBUG:Executing: git --work-tree . add -f -A
07/13/2017 17:55:42 - DEBUG:Executing: git --work-tree . write-tree
07/13/2017 17:55:42 - DEBUG:Executing: git clean -f -d
07/13/2017 17:55:42 - DEBUG:Executing: git reset --hard pkg/debian/sid
07/13/2017 17:55:42 - DEBUG:Executing: git checkout 8cdb5099524ec5e
Verified that update-maintainer has been run
07/13/2017 17:55:43 - DEBUG:Executing: sh -c 'echo pkg/debian/
07/13/2017 17:55:43 - DEBUG:Executing: sh -c 'echo pkg/debian/
07/13/2017 17:55:43 - DEBUG:Executing: sh -c 'echo ahasenack/
07/13/2017 17:55:43 - DEBUG:Executing: sh -c 'echo ahasenack/
Verified that debian/changelog version is as expected
Some lint checks failed. Please investigate.
- 2f18b89... by Nish Aravamudan on 2017-07-13
- 0e56f4d... by Nish Aravamudan on 2017-07-14
- f5041f5... by Nish Aravamudan on 2017-07-14
- 68151ee... by Nish Aravamudan on 2017-07-14
- 9831aa1... by Nish Aravamudan on 2017-07-14
- e3e9113... by Nish Aravamudan on 2017-07-14
| Nish Aravamudan (nacc) wrote : | # |
On Fri, Jul 14, 2017 at 11:22 AM, Robie Basak <email address hidden> wrote:
> Review: Approve
>
> Looks good, thanks!
>
> I don't want to bikeshed this too much, because it'd better it be in the repository than not landed yet, and we can improve it incrementally. I see this submodule as at a prototype stage where it's appropriate to have more slack, unlike the importer which is now mature and we need to be more careful about.
>
> I would like to have a hard rule about catch-all exception handlers though. That's the only thing I'd definitely like fixed before landing, please. It would probably be useful to fix the tab indents too. The others are at your discretion - I'd like to see them addressed (or for us to conclude they shouldn't be done if you disagree) at some point though.
Fixed most and pushed.
> Diff comments:
>
>> diff --git a/gitubuntu/
>> index abf1165..2423150 100644
>> --- a/gitubuntu/
>> +++ b/gitubuntu/
>> @@ -336,32 +339,16 @@ class GitUbuntuReposi
>> @property
>> def git_dir(self):
>> """Same as cached object in the environment"""
>> - return self._local_
>> + return self.raw_repo.path
>>
>> @property
>> - def local_repo(self):
>> + def raw_repo(self):
>> """Reference to pygit2 Repository object"""
>> - return self._local_repo
>> -
>> - @property
>> - def head_is_
>> - return self._local_
>> -
>> - @property
>> - def head_is_
>> - return self._local_
>> -
>> - @property
>> - def head(self):
>> - return self._local_
>> -
>> - @property
>> - def remotes(self):
>> - return self._local_
>> + return self._raw_repo
>
> Why not just use self.raw_repo instead of having the indirection around a property accessor method?
+1
>> def _references(self, prefix=''):
>> - return [self._
>> - self._local_
>> + return [self.raw_
>> + self.raw_
>> r.startswith(
>>
>> def references_
>> diff --git a/gitubuntu/lint.py b/gitubuntu/lint.py
>> new file mode 100644
>> index 0000000..f93cb52
>> --- /dev/null
>> +++ b/gitubuntu/lint.py
>> @@ -0,0 +1,558 @@
>> +import argparse
>> +import itertools
>> +import logging
>> +import os
>> +from subprocess import CalledProcessError
>> +import sys
>> +import tempfile
>> +from gitubuntu.
>> +from gitubuntu.logging import warning, error, fatal
>> +from gitubuntu.run import run, decode_binary
>> +from gitubuntu.
>> +from gitubuntu.
>
> I think we differ on opinion on this, but I'd prefer to see next_sru_version being called explicitly as gitubuntu.
| Robie Basak (racb) wrote : | # |
On Sat, Jul 15, 2017 at 06:27:32AM -0000, Nish Aravamudan wrote:
> >> + ret = True
> >
> > I'm not keen on this pattern. It feels error prone. How about yielding each False or True instead, and then using all() on the a call to that generator?
>
> It is, probably :) Not yet fixed, but I think I'd prefer to wrap the
> all() usage in the API? That is, I think this is equally confusing:
>
> ret = all(self.
>
> I was thinking we could drop the _check naming and make it check...
> and move the actual function into _check in this case?
I'm not sure I follow exactly. We should chat more on how we want this
to work I think. I suggest we leave it for now and try to improve just
this in separate MPs just for this, as there's no obviously right
pattern to use but we need to pick one.
Robie

Looks good, thanks!
I don't want to bikeshed this too much, because it'd better it be in the repository than not landed yet, and we can improve it incrementally. I see this submodule as at a prototype stage where it's appropriate to have more slack, unlike the importer which is now mature and we need to be more careful about.
I would like to have a hard rule about catch-all exception handlers though. That's the only thing I'd definitely like fixed before landing, please. It would probably be useful to fix the tab indents too. The others are at your discretion - I'd like to see them addressed (or for us to conclude they shouldn't be done if you disagree) at some point though.