~nacc/git-ubuntu:further-orphan-tag-fix-lp1753800

Last commit made on 2018-03-07
Get this branch:
git clone -b further-orphan-tag-fix-lp1753800 https://git.launchpad.net/~nacc/git-ubuntu
Only Nish Aravamudan can upload to this branch. If you are Nish Aravamudan please log in for upload directions.

Branch merges

Branch information

Name:
further-orphan-tag-fix-lp1753800
Repository:
lp:~nacc/git-ubuntu

Recent commits

fb977c4... by Nish Aravamudan

import: check if an orphan tag matches the imported tree in all cases

If we attempt to use an import tag, but the tree does not match, we will
orphan, but it's possible this is the *second* time seeing the same
publish event, in which case we should possibly use the orphan tag's
tree this time.

LP: #1753800

1fbf541... by Robie Basak

Initial test for import_unapplied_spi

Not got the verification at the end though.

[Nishanth Aravamudan]
Fix some coding bugs.
Add verification of the result.
Add pytest.mark to indicate this test should be converted eventually.

7088c93... by Nish Aravamudan

source_builder: add second assertion

This assertion is complementary to the other. Also add a test.

---

Originally, I had included a change that automatically set the native
variable based upon the version passed in (so you only had to specify
one of version or native), but I'm no longer confident that is what you
want the API to be. This change is sufficient to catch the issue and
ensures 100% code coverage with the test.

17256cf... by Nish Aravamudan

git_repository: drop ensure_importer_branches_exist

Much like 1d658869b56b ("Create dsc branch on first use"), create the
pristine-tar necessary branches on first use, which all occurs within
the context manager in git_repository.py.

This should not result in any functional change, but should ensure there
are no side-effects of simply instantiating a GitUbuntuRepository
object and the helper function is no longer necessary.

LP 1733895

---

It is a separate issue as to whether these branches need to exist or
not.

eacd895... by Nish Aravamudan

import: handle orphan tags as changelog parents

It is possible that any given version might be an orphan import (due not
finding any changelog parents). When this happens, we want to ensure
that when importing the same (to-be-orphaned) publication record for a
different series, we simply use the same logic we have now for import
tags. That is, when determining what to do with a given published
version:

1) If there is a corresponding import tag for version
        1a) If the tag's treeish matches, just move the branch
        1b) If the tag's treeish does not match, orphan this publish
2) If there is a corresponding orphan tag for version
        1a) If the tag's treeish matches, just move the branch
        1b) If the tag's treeish does not match, fail (unhandled still)
3) If there is a corresponding upload tag for version
        1a) If the tag's treeish matches, incorporate the rich history
        1b) If the tag's treeish does not match, emit a warning but
                ignore this tag

2) is inserted by these changes.

A similar change should be done in the lookup of the unapplied changelog
parent itself, which previously only searched for import tags, but should
search for import or orphan tags. It is not incorrect to use an orphan
tag as a changelog parent, it just implies there is a break in the
publishing record relative to the changelog.

LP: #1733856

0b45702... by Nish Aravamudan

import: fix case of reimport of a not-yet imported repository

In that case lp_git_repo will be None and we should skip the check.

287df3a... by Nish Aravamudan

version: bump to 0.7.4

3e9e2d7... by Nish Aravamudan

apt_repo: fix mis-use of os.path.join

When os.path.join is given an absolute path as any component,
it resets the computed path to that value. This is obviously
the case in our usage (since we are appending a system path to
the snap's path). Fix this by abstracting out the root path and
appending the same relative path in both cases.

3b21bbe... by Nish Aravamudan

Revert "snap: scripts need a custom LD_LIBRARY_PATH"

This reverts commit acdbf24e77bf4af64de82557794cbcfc26b328c0.

This was a regression in snapcraft, as it worked before the recent
updates.

acdbf24... by Nish Aravamudan

snap: scripts need a custom LD_LIBRARY_PATH