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
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2012-06-27 09:45:26 +0000
+++ database/sampledata/current-dev.sql 2012-07-04 22:47:20 +0000
@@ -1787,6 +1787,8 @@
17871787
1788INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 14, 65, '2007-08-09 11:39:16.836856');1788INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 14, 65, '2007-08-09 11:39:16.836856');
1789INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 63, 65, '2007-08-09 11:39:16.836856');1789INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 63, 65, '2007-08-09 11:39:16.836856');
1790INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (2, 64, 64, '2012-07-04 22:24:56.051574');
1791INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (3, 64, 64, '2012-07-04 22:24:56.615768');
17901792
17911793
1792ALTER TABLE accessartifactgrant ENABLE TRIGGER ALL;1794ALTER TABLE accessartifactgrant ENABLE TRIGGER ALL;
@@ -2062,6 +2064,8 @@
20622064
2063INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (1, 2, 1, 14);2065INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (1, 2, 1, 14);
2064INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (2, 2, 1, 63);2066INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (2, 2, 1, 63);
2067INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (3, 48, 2, 64);
2068INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (4, 48, 3, 64);
20652069
20662070
2067ALTER TABLE accesspolicygrantflat ENABLE TRIGGER ALL;2071ALTER TABLE accesspolicygrantflat ENABLE TRIGGER ALL;
@@ -3013,8 +3017,8 @@
3013INSERT 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);3017INSERT 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);
3014INSERT 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);3018INSERT 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);
3015INSERT 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);3019INSERT 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);
3016INSERT 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, '{}');3020INSERT 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}');
3017INSERT 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, '{}');3021INSERT 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}');
3018INSERT 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);3022INSERT 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);
3019INSERT 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);3023INSERT 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);
30203024
30213025
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2012-06-27 09:45:26 +0000
+++ database/sampledata/current.sql 2012-07-04 22:47:20 +0000
@@ -1787,6 +1787,8 @@
17871787
1788INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 14, 65, '2007-08-09 11:39:16.836856');1788INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 14, 65, '2007-08-09 11:39:16.836856');
1789INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 63, 65, '2007-08-09 11:39:16.836856');1789INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (1, 63, 65, '2007-08-09 11:39:16.836856');
1790INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (2, 64, 64, '2012-07-04 22:28:18.743063');
1791INSERT INTO accessartifactgrant (artifact, grantee, grantor, date_created) VALUES (3, 64, 64, '2012-07-04 22:28:19.249475');
17901792
17911793
1792ALTER TABLE accessartifactgrant ENABLE TRIGGER ALL;1794ALTER TABLE accessartifactgrant ENABLE TRIGGER ALL;
@@ -2058,6 +2060,8 @@
20582060
2059INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (1, 2, 1, 14);2061INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (1, 2, 1, 14);
2060INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (2, 2, 1, 63);2062INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (2, 2, 1, 63);
2063INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (3, 48, 2, 64);
2064INSERT INTO accesspolicygrantflat (id, policy, artifact, grantee) VALUES (4, 48, 3, 64);
20612065
20622066
2063ALTER TABLE accesspolicygrantflat ENABLE TRIGGER ALL;2067ALTER TABLE accesspolicygrantflat ENABLE TRIGGER ALL;
@@ -2950,8 +2954,8 @@
2950INSERT 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);2954INSERT 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);
2951INSERT 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);2955INSERT 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);
2952INSERT 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);2956INSERT 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);
2953INSERT 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, '{}');2957INSERT 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}');
2954INSERT 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, '{}');2958INSERT 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}');
2955INSERT 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);2959INSERT 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);
2956INSERT 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);2960INSERT 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);
29572961
29582962
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2012-07-02 14:45:56 +0000
+++ database/schema/security.cfg 2012-07-04 22:47:20 +0000
@@ -2198,8 +2198,6 @@
21982198
2199[garbo]2199[garbo]
2200groups=script,read2200groups=script,read
2201public.accessartifact = SELECT, INSERT
2202public.accessartifactgrant = SELECT, INSERT
2203public.account = SELECT, DELETE2201public.account = SELECT, DELETE
2204public.answercontact = SELECT, DELETE2202public.answercontact = SELECT, DELETE
2205public.branch = SELECT, UPDATE2203public.branch = SELECT, UPDATE
22062204
=== modified file 'lib/lp/scripts/garbo.py'
--- lib/lp/scripts/garbo.py 2012-07-03 08:04:35 +0000
+++ lib/lp/scripts/garbo.py 2012-07-04 22:47:20 +0000
@@ -51,7 +51,6 @@
51 MAX_SAMPLE_SIZE,51 MAX_SAMPLE_SIZE,
52 )52 )
53from lp.code.interfaces.revision import IRevisionSet53from lp.code.interfaces.revision import IRevisionSet
54from lp.code.model.branch import Branch
55from lp.code.model.codeimportevent import CodeImportEvent54from lp.code.model.codeimportevent import CodeImportEvent
56from lp.code.model.codeimportresult import CodeImportResult55from lp.code.model.codeimportresult import CodeImportResult
57from lp.code.model.revision import (56from lp.code.model.revision import (
@@ -59,11 +58,6 @@
59 RevisionCache,58 RevisionCache,
60 )59 )
61from lp.hardwaredb.model.hwdb import HWSubmission60from lp.hardwaredb.model.hwdb import HWSubmission
62from lp.registry.enums import PRIVATE_INFORMATION_TYPES
63from lp.registry.interfaces.accesspolicy import (
64 IAccessArtifactGrantSource,
65 IAccessArtifactSource,
66 )
67from lp.registry.model.person import Person61from lp.registry.model.person import Person
68from lp.services.config import config62from lp.services.config import config
69from lp.services.database import postgresql63from lp.services.database import postgresql
@@ -1143,46 +1137,6 @@
1143 transaction.commit()1137 transaction.commit()
11441138
11451139
1146class PopulateBranchAccessArtifactGrant(TunableLoop):
1147
1148 maximum_chunk_size = 5000
1149
1150 def __init__(self, log, abort_time=None):
1151 super(PopulateBranchAccessArtifactGrant, self).__init__(
1152 log, abort_time)
1153 self.memcache_key = '%s:branch-populate-aag' % config.instance_name
1154 watermark = getUtility(IMemcacheClient).get(self.memcache_key)
1155 self.start_at = watermark or 0
1156
1157 def findBranches(self):
1158 return IMasterStore(Branch).find(
1159 Branch,
1160 Branch.information_type.is_in(PRIVATE_INFORMATION_TYPES),
1161 Branch.id >= self.start_at).order_by(Branch.id)
1162
1163 def isDone(self):
1164 return self.findBranches().is_empty()
1165
1166 def __call__(self, chunk_size):
1167 branches = list(self.findBranches()[:chunk_size])
1168 artifacts = getUtility(IAccessArtifactSource).ensure(branches)
1169 branch_to_artifact = dict(
1170 (artifact.branch_id, artifact) for artifact in artifacts)
1171 grants = []
1172 for branch in branches:
1173 artifact = branch_to_artifact[branch.id]
1174 grants.extend(
1175 [(artifact, branchsub.person, branchsub.subscribed_by)
1176 for branchsub in branch.subscriptions])
1177 getUtility(IAccessArtifactGrantSource).grant(grants)
1178 self.start_at = branches[-1].id + 1
1179 result = getUtility(IMemcacheClient).set(
1180 self.memcache_key, self.start_at)
1181 if not result:
1182 self.log.warning('Failed to set start_at in memcache.')
1183 transaction.commit()
1184
1185
1186class BaseDatabaseGarbageCollector(LaunchpadCronScript):1140class BaseDatabaseGarbageCollector(LaunchpadCronScript):
1187 """Abstract base class to run a collection of TunableLoops."""1141 """Abstract base class to run a collection of TunableLoops."""
1188 script_name = None # Script name for locking and database user. Override.1142 script_name = None # Script name for locking and database user. Override.
@@ -1438,7 +1392,6 @@
1438 DuplicateSessionPruner,1392 DuplicateSessionPruner,
1439 BugHeatUpdater,1393 BugHeatUpdater,
1440 BugTaskFlattener,1394 BugTaskFlattener,
1441 PopulateBranchAccessArtifactGrant,
1442 ]1395 ]
1443 experimental_tunable_loops = []1396 experimental_tunable_loops = []
14441397
14451398
=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py 2012-06-27 03:45:50 +0000
+++ lib/lp/scripts/tests/test_garbo.py 2012-07-04 22:47:20 +0000
@@ -47,11 +47,7 @@
47 BranchFormat,47 BranchFormat,
48 RepositoryFormat,48 RepositoryFormat,
49 )49 )
50from lp.code.enums import (50from lp.code.enums import CodeImportResultStatus
51 BranchSubscriptionNotificationLevel,
52 CodeImportResultStatus,
53 CodeReviewNotificationLevel,
54 )
55from lp.code.interfaces.codeimportevent import ICodeImportEventSet51from lp.code.interfaces.codeimportevent import ICodeImportEventSet
56from lp.code.model.branchjob import (52from lp.code.model.branchjob import (
57 BranchJob,53 BranchJob,
@@ -59,7 +55,6 @@
59 )55 )
60from lp.code.model.codeimportevent import CodeImportEvent56from lp.code.model.codeimportevent import CodeImportEvent
61from lp.code.model.codeimportresult import CodeImportResult57from lp.code.model.codeimportresult import CodeImportResult
62from lp.registry.enums import InformationType
63from lp.registry.interfaces.distribution import IDistributionSet58from lp.registry.interfaces.distribution import IDistributionSet
64from lp.registry.interfaces.person import IPersonSet59from lp.registry.interfaces.person import IPersonSet
65from lp.scripts.garbo import (60from lp.scripts.garbo import (
@@ -1154,38 +1149,6 @@
1154 self.runHourly()1149 self.runHourly()
1155 self.assertEqual((task.id,), get_flat())1150 self.assertEqual((task.id,), get_flat())
11561151
1157 def test_PopulateBranchAccessArtifactGrant(self):
1158 # Branches without a access_policy have one set by the job.
1159 with dbuser('testadmin'):
1160 branch = self.factory.makeBranch()
1161
1162 def get_access_grants():
1163 return IMasterStore(BugTask).execute(
1164 'SELECT access_grants FROM branch WHERE id = ?',
1165 (branch.id,)).get_one()[0]
1166
1167 # The branch is public, so running the garbo job will have no effect.
1168 self.runHourly()
1169 self.assertIs(None, get_access_grants())
1170
1171 with dbuser('testadmin'):
1172 branch.transitionToInformationType(
1173 InformationType.USERDATA, branch.owner, verify_policy=False)
1174
1175 # Now the branch is USERDATA, it will have no explicit grants.
1176 self.assertEqual([], get_access_grants())
1177
1178 with dbuser('testadmin'):
1179 subscriber = self.factory.makePerson()
1180 branch.subscribe(
1181 subscriber, BranchSubscriptionNotificationLevel.NOEMAIL,
1182 None, CodeReviewNotificationLevel.NOEMAIL, branch.owner)
1183
1184 # The subscriber has been added.
1185 self.runHourly()
1186 self.assertContentEqual(
1187 [branch.owner.id, subscriber.id], get_access_grants())
1188
11891152
1190class TestGarboTasks(TestCaseWithFactory):1153class TestGarboTasks(TestCaseWithFactory):
1191 layer = LaunchpadZopelessLayer1154 layer = LaunchpadZopelessLayer