~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Publishing ACCEPTED Sources
===========================

As recently requested in bug #77853, successfully source-only uploads,
i.e, those uploads that only include a source package and were
processed without errors, will be automatically published as PENDING.

This aggregation of processes are intended to increase the building
throughput, because the will allow the sources to be published on disk
and built within the same publishing cycle. (previously Soyuz requires
two publishing cycles, one for publish the source on disk and another
to build it).

Let's start a new series of ed (0.2-20) and publish it:

    >>> ed_src = getUploadForSource(
    ...     'split-upload-test/ed_0.2-20_source.changes')
    >>> ed_src.process()
    >>> result = ed_src.do_accept()
    >>> ed_src.queue_root.status.name
    'NEW'

    >>> ed_src.queue_root.setAccepted()
    >>> pub_records = ed_src.queue_root.realiseUpload()

Check if the publication is available through the Soyuz package stack:

    >>> from lp.registry.interfaces.distribution import (
    ...     IDistributionSet)

    >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
    >>> hoary = ubuntu.getSeries('hoary')

    >>> ed_sp = hoary.getSourcePackage('ed')
    >>> ed_dsspr = ed_sp['0.2-20']
    >>> ed_dsspr.publishing_history.count()
    1
    >>> ed_pub = ed_dsspr.publishing_history[0]

    >>> ed_pub.sourcepackagerelease.title
    u'ed - 0.2-20'

    >>> ed_pub.distroseries.name
    u'hoary'

    >>> ed_pub.status.name
    'PENDING'

    >>> ed_pub.archive == hoary.main_archive
    True

Also check if the Soyuz archive file lookup can reach one of the
just-published file:

    >>> ubuntu.main_archive.getFileByName('ed_0.2.orig.tar.gz')
    <LibraryFileAlias...>

We have to commit in order to have new Librarian files available to
server by Librarian Server:

    >>> from lp.services.database.sqlbase import commit
    >>> commit()

Now let's submit a new source version of ed (0.2-21) which will be
automatically accepted and published resulting in a PackageUpload
record in 'DONE' state:

    >>> ed21_src = getUploadForSource(
    ...     'ed-0.2-21/ed_0.2-21_source.changes')
    >>> ed21_src.process()
    >>> result = ed21_src.do_accept()
    >>> ed21_src.queue_root.status.name
    'DONE'

This is unfortunate, but we have to manually remove the file dumped
from librarian into our tree, otherwise it will remain on disk causing
problems to the next test run.

    >>> import os
    >>> from lp.archiveuploader.tests import datadir
    >>> os.remove(datadir('ed-0.2-21/ed_0.2.orig.tar.gz'))

After the mentioned procedure-shortcut, since ed_0.2-21 was
auto-accepted (i.e, published as PENDING), it should be immediately
available via the package stack:

    >>> ed21_dsspr = ed_sp['0.2-21']
    >>> ed21_dsspr.publishing_history.count()
    1
    >>> ed21_pub = ed21_dsspr.publishing_history[0]

    >>> ed21_pub.sourcepackagerelease.title
    u'ed - 0.2-21'

    >>> ed21_pub.distroseries.name
    u'hoary'

    >>> ed21_pub.status.name
    'PENDING'

    >>> ed21_pub.archive == hoary.main_archive
    True

Same happens for the archive file lookup:

    >>> ubuntu.main_archive.getFileByName('ed_0.2-21.dsc')
    <LibraryFileAlias...>