Merge lp:~stevenk/launchpad/drop-populate-branch-aag into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 15557
Proposed branch: lp:~stevenk/launchpad/drop-populate-branch-aag
Merge into: lp:launchpad
Diff against target: 221 lines (+13/-91)
5 files modified
database/sampledata/current-dev.sql (+6/-2)
database/sampledata/current.sql (+6/-2)
database/schema/security.cfg (+0/-2)
lib/lp/scripts/garbo.py (+0/-47)
lib/lp/scripts/tests/test_garbo.py (+1/-38)
To merge this branch: bzr merge lp:~stevenk/launchpad/drop-populate-branch-aag
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+113467@code.launchpad.net

Commit message

Delete the PopulateBranchAccessArtifactGrant garbo job, it's done. Run it across both lots of sampledata.

Description of the change

Thank PopulateBranchAccessArtifactGrant for its work by kicking it out of the tree. I have also ran it across both sets of sampledata before removing it.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/sampledata/current-dev.sql'
2--- database/sampledata/current-dev.sql 2012-06-27 09:45:26 +0000
3+++ database/sampledata/current-dev.sql 2012-07-04 22:47:20 +0000
4@@ -1787,6 +1787,8 @@
5
6 INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 14, 65, '2007-08-09 11:39:16.836856');
7 INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 63, 65, '2007-08-09 11:39:16.836856');
8+INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (2, 64, 64, '2012-07-04 22:24:56.051574');
9+INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (3, 64, 64, '2012-07-04 22:24:56.615768');
10
11
12 ALTER TABLE accessartifactgrant ENABLE TRIGGER ALL;
13@@ -2062,6 +2064,8 @@
14
15 INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (1, 2, 1, 14);
16 INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (2, 2, 1, 63);
17+INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (3, 48, 2, 64);
18+INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (4, 48, 3, 64);
19
20
21 ALTER TABLE accesspolicygrantflat ENABLE TRIGGER ALL;
22@@ -3013,8 +3017,8 @@
23 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (26, NULL, NULL, 12, 6, NULL, 'mirrored', NULL, NULL, NULL, 30, '2007-03-16 14:12:49.050332', NULL, 0, NULL, NULL, NULL, NULL, '2007-03-16 03:12:49.050332', 0, NULL, 1, NULL, '2007-12-06 19:58:26.858547', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'gnome-terminal', '~name12/gnome-terminal/mirrored', NULL, NULL, NULL, 1, NULL, NULL);
24 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (27, NULL, NULL, 12, 6, NULL, 'scanned', NULL, NULL, NULL, 30, '2007-03-16 14:14:29.935752', NULL, 0, NULL, '2007-03-16 14:14:29.935752', NULL, NULL, '2007-03-16 03:14:29.935752', 0, NULL, 1, NULL, '2007-12-06 19:58:26.85913', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'gnome-terminal', '~name12/gnome-terminal/scanned', NULL, NULL, NULL, 1, NULL, NULL);
25 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (28, NULL, NULL, 1, NULL, 1, 'testdoc', NULL, NULL, NULL, 30, NULL, NULL, 1, 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', NULL, NULL, NULL, '2007-05-04 01:16:03.75446', 0, NULL, 1, NULL, '2007-12-06 19:58:26.859847', 1, NULL, NULL, NULL, NULL, NULL, NULL, 'mark', NULL, '~mark/+junk/testdoc', NULL, NULL, NULL, 1, NULL, NULL);
26-INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (29, 'Landscape trunk', NULL, 64, 16, 12, 'trunk', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.860757', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'landscape-developers', 'landscape', '~landscape-developers/landscape/trunk', NULL, NULL, NULL, 4, 48, '{}');
27-INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (30, NULL, NULL, 12, 16, 12, 'feature-x', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.861424', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'landscape', '~name12/landscape/feature-x', NULL, NULL, NULL, 4, 48, '{}');
28+INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (29, 'Landscape trunk', NULL, 64, 16, 12, 'trunk', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.860757', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'landscape-developers', 'landscape', '~landscape-developers/landscape/trunk', NULL, NULL, NULL, 4, 48, '{64}');
29+INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (30, NULL, NULL, 12, 16, 12, 'feature-x', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.861424', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'landscape', '~name12/landscape/feature-x', NULL, NULL, NULL, 4, 48, '{64}');
30 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (75, 'GNOME Terminal Import Branch', NULL, 24, 6, NULL, 'import', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2006-06-25 20:04:03.9465', 0, NULL, 3, NULL, '2007-12-06 19:58:26.862009', 24, NULL, NULL, NULL, NULL, NULL, NULL, 'vcs-imports', 'gnome-terminal', '~vcs-imports/gnome-terminal/import', NULL, NULL, NULL, 1, NULL, NULL);
31 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (76, 'Evolution Import Branch', NULL, 24, 5, NULL, 'import', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2006-06-25 20:04:04.218451', 0, NULL, 3, NULL, '2007-12-06 19:58:26.862857', 24, NULL, NULL, NULL, NULL, NULL, NULL, 'vcs-imports', 'evolution', '~vcs-imports/evolution/import', NULL, NULL, NULL, 1, NULL, NULL);
32
33
34=== modified file 'database/sampledata/current.sql'
35--- database/sampledata/current.sql 2012-06-27 09:45:26 +0000
36+++ database/sampledata/current.sql 2012-07-04 22:47:20 +0000
37@@ -1787,6 +1787,8 @@
38
39 INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 14, 65, '2007-08-09 11:39:16.836856');
40 INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 63, 65, '2007-08-09 11:39:16.836856');
41+INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (2, 64, 64, '2012-07-04 22:28:18.743063');
42+INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (3, 64, 64, '2012-07-04 22:28:19.249475');
43
44
45 ALTER TABLE accessartifactgrant ENABLE TRIGGER ALL;
46@@ -2058,6 +2060,8 @@
47
48 INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (1, 2, 1, 14);
49 INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (2, 2, 1, 63);
50+INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (3, 48, 2, 64);
51+INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (4, 48, 3, 64);
52
53
54 ALTER TABLE accesspolicygrantflat ENABLE TRIGGER ALL;
55@@ -2950,8 +2954,8 @@
56 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (26, NULL, NULL, 12, 6, NULL, 'mirrored', NULL, NULL, NULL, 30, '2007-03-16 14:12:49.050332', NULL, 0, NULL, NULL, NULL, NULL, '2007-03-16 03:12:49.050332', 0, NULL, 1, NULL, '2007-12-06 19:58:26.858547', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'gnome-terminal', '~name12/gnome-terminal/mirrored', NULL, NULL, NULL, 1, NULL, NULL);
57 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (27, NULL, NULL, 12, 6, NULL, 'scanned', NULL, NULL, NULL, 30, '2007-03-16 14:14:29.935752', NULL, 0, NULL, '2007-03-16 14:14:29.935752', NULL, NULL, '2007-03-16 03:14:29.935752', 0, NULL, 1, NULL, '2007-12-06 19:58:26.85913', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'gnome-terminal', '~name12/gnome-terminal/scanned', NULL, NULL, NULL, 1, NULL, NULL);
58 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (28, NULL, NULL, 1, NULL, 1, 'testdoc', NULL, NULL, NULL, 30, NULL, NULL, 1, 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', NULL, NULL, NULL, '2007-05-04 01:16:03.75446', 0, NULL, 1, NULL, '2007-12-06 19:58:26.859847', 1, NULL, NULL, NULL, NULL, NULL, NULL, 'mark', NULL, '~mark/+junk/testdoc', NULL, NULL, NULL, 1, NULL, NULL);
59-INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (29, 'Landscape trunk', NULL, 64, 16, 12, 'trunk', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.860757', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'landscape-developers', 'landscape', '~landscape-developers/landscape/trunk', NULL, NULL, NULL, 4, 48, '{}');
60-INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (30, NULL, NULL, 12, 16, 12, 'feature-x', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.861424', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'landscape', '~name12/landscape/feature-x', NULL, NULL, NULL, 4, 48, '{}');
61+INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (29, 'Landscape trunk', NULL, 64, 16, 12, 'trunk', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.860757', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'landscape-developers', 'landscape', '~landscape-developers/landscape/trunk', NULL, NULL, NULL, 4, 48, '{64}');
62+INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (30, NULL, NULL, 12, 16, 12, 'feature-x', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2007-05-28 02:37:07.814303', 0, NULL, 1, NULL, '2007-12-06 19:58:26.861424', 12, NULL, NULL, NULL, NULL, NULL, NULL, 'name12', 'landscape', '~name12/landscape/feature-x', NULL, NULL, NULL, 4, 48, '{64}');
63 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (75, 'GNOME Terminal Import Branch', NULL, 24, 6, NULL, 'import', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2006-06-25 20:04:03.9465', 0, NULL, 3, NULL, '2007-12-06 19:58:26.862009', 24, NULL, NULL, NULL, NULL, NULL, NULL, 'vcs-imports', 'gnome-terminal', '~vcs-imports/gnome-terminal/import', NULL, NULL, NULL, 1, NULL, NULL);
64 INSERT INTO branch (id, title, summary, owner, product, author, name, home_page, url, whiteboard, lifecycle_status, last_mirrored, last_mirror_attempt, mirror_failures, mirror_status_message, last_scanned, last_scanned_id, last_mirrored_id, date_created, revision_count, next_mirror_time, branch_type, reviewer, date_last_modified, registrant, branch_format, repository_format, metadir_format, stacked_on, distroseries, sourcepackagename, owner_name, target_suffix, unique_name, size_on_disk, merge_queue, merge_queue_config, information_type, access_policy, access_grants) VALUES (76, 'Evolution Import Branch', NULL, 24, 5, NULL, 'import', NULL, NULL, NULL, 30, NULL, NULL, 0, NULL, NULL, NULL, NULL, '2006-06-25 20:04:04.218451', 0, NULL, 3, NULL, '2007-12-06 19:58:26.862857', 24, NULL, NULL, NULL, NULL, NULL, NULL, 'vcs-imports', 'evolution', '~vcs-imports/evolution/import', NULL, NULL, NULL, 1, NULL, NULL);
65
66
67=== modified file 'database/schema/security.cfg'
68--- database/schema/security.cfg 2012-07-02 14:45:56 +0000
69+++ database/schema/security.cfg 2012-07-04 22:47:20 +0000
70@@ -2198,8 +2198,6 @@
71
72 [garbo]
73 groups=script,read
74-public.accessartifact = SELECT, INSERT
75-public.accessartifactgrant = SELECT, INSERT
76 public.account = SELECT, DELETE
77 public.answercontact = SELECT, DELETE
78 public.branch = SELECT, UPDATE
79
80=== modified file 'lib/lp/scripts/garbo.py'
81--- lib/lp/scripts/garbo.py 2012-07-03 08:04:35 +0000
82+++ lib/lp/scripts/garbo.py 2012-07-04 22:47:20 +0000
83@@ -51,7 +51,6 @@
84 MAX_SAMPLE_SIZE,
85 )
86 from lp.code.interfaces.revision import IRevisionSet
87-from lp.code.model.branch import Branch
88 from lp.code.model.codeimportevent import CodeImportEvent
89 from lp.code.model.codeimportresult import CodeImportResult
90 from lp.code.model.revision import (
91@@ -59,11 +58,6 @@
92 RevisionCache,
93 )
94 from lp.hardwaredb.model.hwdb import HWSubmission
95-from lp.registry.enums import PRIVATE_INFORMATION_TYPES
96-from lp.registry.interfaces.accesspolicy import (
97- IAccessArtifactGrantSource,
98- IAccessArtifactSource,
99- )
100 from lp.registry.model.person import Person
101 from lp.services.config import config
102 from lp.services.database import postgresql
103@@ -1143,46 +1137,6 @@
104 transaction.commit()
105
106
107-class PopulateBranchAccessArtifactGrant(TunableLoop):
108-
109- maximum_chunk_size = 5000
110-
111- def __init__(self, log, abort_time=None):
112- super(PopulateBranchAccessArtifactGrant, self).__init__(
113- log, abort_time)
114- self.memcache_key = '%s:branch-populate-aag' % config.instance_name
115- watermark = getUtility(IMemcacheClient).get(self.memcache_key)
116- self.start_at = watermark or 0
117-
118- def findBranches(self):
119- return IMasterStore(Branch).find(
120- Branch,
121- Branch.information_type.is_in(PRIVATE_INFORMATION_TYPES),
122- Branch.id >= self.start_at).order_by(Branch.id)
123-
124- def isDone(self):
125- return self.findBranches().is_empty()
126-
127- def __call__(self, chunk_size):
128- branches = list(self.findBranches()[:chunk_size])
129- artifacts = getUtility(IAccessArtifactSource).ensure(branches)
130- branch_to_artifact = dict(
131- (artifact.branch_id, artifact) for artifact in artifacts)
132- grants = []
133- for branch in branches:
134- artifact = branch_to_artifact[branch.id]
135- grants.extend(
136- [(artifact, branchsub.person, branchsub.subscribed_by)
137- for branchsub in branch.subscriptions])
138- getUtility(IAccessArtifactGrantSource).grant(grants)
139- self.start_at = branches[-1].id + 1
140- result = getUtility(IMemcacheClient).set(
141- self.memcache_key, self.start_at)
142- if not result:
143- self.log.warning('Failed to set start_at in memcache.')
144- transaction.commit()
145-
146-
147 class BaseDatabaseGarbageCollector(LaunchpadCronScript):
148 """Abstract base class to run a collection of TunableLoops."""
149 script_name = None # Script name for locking and database user. Override.
150@@ -1438,7 +1392,6 @@
151 DuplicateSessionPruner,
152 BugHeatUpdater,
153 BugTaskFlattener,
154- PopulateBranchAccessArtifactGrant,
155 ]
156 experimental_tunable_loops = []
157
158
159=== modified file 'lib/lp/scripts/tests/test_garbo.py'
160--- lib/lp/scripts/tests/test_garbo.py 2012-06-27 03:45:50 +0000
161+++ lib/lp/scripts/tests/test_garbo.py 2012-07-04 22:47:20 +0000
162@@ -47,11 +47,7 @@
163 BranchFormat,
164 RepositoryFormat,
165 )
166-from lp.code.enums import (
167- BranchSubscriptionNotificationLevel,
168- CodeImportResultStatus,
169- CodeReviewNotificationLevel,
170- )
171+from lp.code.enums import CodeImportResultStatus
172 from lp.code.interfaces.codeimportevent import ICodeImportEventSet
173 from lp.code.model.branchjob import (
174 BranchJob,
175@@ -59,7 +55,6 @@
176 )
177 from lp.code.model.codeimportevent import CodeImportEvent
178 from lp.code.model.codeimportresult import CodeImportResult
179-from lp.registry.enums import InformationType
180 from lp.registry.interfaces.distribution import IDistributionSet
181 from lp.registry.interfaces.person import IPersonSet
182 from lp.scripts.garbo import (
183@@ -1154,38 +1149,6 @@
184 self.runHourly()
185 self.assertEqual((task.id,), get_flat())
186
187- def test_PopulateBranchAccessArtifactGrant(self):
188- # Branches without a access_policy have one set by the job.
189- with dbuser('testadmin'):
190- branch = self.factory.makeBranch()
191-
192- def get_access_grants():
193- return IMasterStore(BugTask).execute(
194- 'SELECT access_grants FROM branch WHERE id = ?',
195- (branch.id,)).get_one()[0]
196-
197- # The branch is public, so running the garbo job will have no effect.
198- self.runHourly()
199- self.assertIs(None, get_access_grants())
200-
201- with dbuser('testadmin'):
202- branch.transitionToInformationType(
203- InformationType.USERDATA, branch.owner, verify_policy=False)
204-
205- # Now the branch is USERDATA, it will have no explicit grants.
206- self.assertEqual([], get_access_grants())
207-
208- with dbuser('testadmin'):
209- subscriber = self.factory.makePerson()
210- branch.subscribe(
211- subscriber, BranchSubscriptionNotificationLevel.NOEMAIL,
212- None, CodeReviewNotificationLevel.NOEMAIL, branch.owner)
213-
214- # The subscriber has been added.
215- self.runHourly()
216- self.assertContentEqual(
217- [branch.owner.id, subscriber.id], get_access_grants())
218-
219
220 class TestGarboTasks(TestCaseWithFactory):
221 layer = LaunchpadZopelessLayer