Merge ~nacc/usd-importer:further-orphan-tag-fix-lp1753800 into ~nacc/usd-importer:import-tests

Proposed by Nish Aravamudan on 2018-03-06
Status: Needs review
Proposed branch: ~nacc/usd-importer:further-orphan-tag-fix-lp1753800
Merge into: ~nacc/usd-importer:import-tests
Diff against target: 15 lines (+3/-1)
1 file modified
gitubuntu/importer.py (+3/-1)
Reviewer Review Type Date Requested Status
Ubuntu Server Dev import team 2018-03-06 Pending
Robie Basak 2018-03-06 Pending
Review via email: mp+340876@code.launchpad.net

This proposal supersedes a proposal from 2018-03-06.

Description of the change

Make jenkins happy.

To post a comment you must log in.
Nish Aravamudan (nacc) wrote : Posted in a previous version of this proposal

A few thoughts before I forget them:

I think we need some basic import_unapplied_spi testing before these changes land.

Given three (distinctly versioned) launchpad publishes (source packages) A, B, C; Y <- X implies X is a parent of Y in the changelog

1) if the sequence is A, B <- A, C <- B, we should see three import tags, no orphan tags. If we are able to integrate publishing info into our tests, then if all three are to the same series/pocket, we would expect that branch to be at C.

2) if the sequence is A, B, C <- A, we should see two import tags, one orphan tag. Again, if all are to the same series/pocket, branch should be at C.

3) if the sequence is A, A', C <- A', where A' is the same version as A but with different tree, we should see two import tags, one orphan tag and branch at C.

4) if the sequence is A, A', A' to a different series, C <- A', we should see two import tags, one orphan tag (first fix in this branch).

5) if the sequence is A, B, C, but there is a U upload tag for B already in the repo, we should see three import tags, but the B import tag should point at U.

I am sure there are more to consider, but I think this sort of verbiage is what we want to encapsulate in the import_unapplied_spi tests.

Unmerged commits

fb977c4... by Nish Aravamudan on 2018-03-06

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 on 2017-12-22

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 on 2018-03-06

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 on 2018-03-06

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.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py
2index 91e38e0..4da6a71 100644
3--- a/gitubuntu/importer.py
4+++ b/gitubuntu/importer.py
5@@ -1255,7 +1255,9 @@ def import_unapplied_spi(
6 str(import_tag.peel().id),
7 )
8 return
9- elif orphan_tag:
10+ # if we do not have a changelog parent yet, see if an orphan tag
11+ # matches
12+ if not unapplied_changelog_parent_commit and orphan_tag:
13 if str(orphan_tag.peel().tree.id) != unapplied_import_tree_hash:
14 raise Exception(
15 "Found orphan tag %s, but the corresponding tree "

Subscribers

People subscribed via source and target branches

to all changes: