~nacc/usd-importer:lp1735744-fix-lint-arguments

Last commit made on 2017-12-04
Get this branch:
git clone -b lp1735744-fix-lint-arguments https://git.launchpad.net/~nacc/usd-importer
Only Nish Aravamudan can upload to this branch. If you are Nish Aravamudan please log in for upload directions.

Branch merges

Branch information

Name:
lp1735744-fix-lint-arguments
Repository:
lp:~nacc/usd-importer

Recent commits

52a4b3f... by Nish Aravamudan on 2017-12-04

lint: properly pass arguments to do_lint by keyword

They were passed in the wrong order before.

LP: #1735744.

57ca3bd... by Robie Basak on 2017-11-28

Fix read_timestamps()

This fails hard in the dictionary comprehension over timestamps since it
expects tuples of items instead of a list of keys. Use items() to
correctly provide the former.

f69cbb6... by Robie Basak on 2017-11-27

Correctly append '.new' to filename for rename

FileNotFoundError: [Errno 2] No such file or directory:
'/tmp/import-source-packages-log/.new'

Expected: '/tmp/import-source-packages-log.new'.

This should be a simple append rather than an os.path.join. Sorry I
missed this in my review.

e7002be... by Robie Basak on 2017-11-24

Add quilt env handling tests

f7a28df... by Robie Basak on 2017-11-24

Log applied import error traceback on exception

As we're swallowing the error in a catch-all exception handler here,
it's helpful if we at least log the full exception and traceback.

I've also filed LP 1734349 to see if this could be improved (I'm not
sure).

71d7004... by Robie Basak on 2017-11-24

import_patches_applied_tree: use correct quilt env

When quilt runs, we must use GitUbuntuRepository:quilt_env in order to
make sure that QUILT_* environment variables are set correctly.
Otherwise we rely on the importer runner having the correct quilt
environment set, which may not be the case.

Also see LP 1734137: separately we need to ensure that any /etc/quiltrc
or ~/.quiltrc is ignored correctly, but I'm treating that as a separate
bug as it needs a more significant refactor to wrap all quilt calls. We
should fix that bug before declaring hash stability, but it isn't as
important as this fix as that one is less likely to be a problem in
practice on our production importer.

4a619a1... by Robie Basak on 2017-11-24

Rename quilt_env_from_commit_hash

This implementation is actually more generic. It will accept anything
that is a treeish hex string, so relabel it and its callers
appropriately.

8a284e5... by Robie Basak on 2017-11-23

GitUbuntuRepository.quilt_env to take treeish

Take a treeish instead of a commit hash hex string and provide a wrapper
for old callers.

This is one step towards a move to using pure objects in most
parameters.

It's needed now so that the importer can also use quilt_env providing
only a treeish object. I could also have changed the method definition
to something intermediary, but as this is the eventual goal anyway,
might as well do it now.

a85e467... by Robie Basak on 2017-11-23

Factor out quilt env determination

cce925f... by Robie Basak on 2017-11-22

Find a tag for the current (not previous) import

It looks like this was an accidental regression in commit 0f3c9430.
'version' refers to the last set version in the for loop above, instead
of 'spi.version' which is the current package being imported.

'version' thus referred to the previously found tag, which of course
always exists. The code therefore assumed that the current version
doesn't need importing since the tag already exists, which is wrong.

Unfortunately this area of code doesn't have effective test coverage yet
and it isn't practical to add it here yet. My importer testing spike
will separately have to refactor and cover this. In the meantime a fix
without a test will have to do.