[Launchpad-reviewers] [Merge] ~pappacena/launchpad:ocirecipe-subscribe-removal-job into launchpad:master

2021-04-06 Thread noreply
The proposal to merge ~pappacena/launchpad:ocirecipe-subscribe-removal-job into 
launchpad:master has been updated.

Status: Approved => Merged

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/399889
-- 
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:ocirecipe-filter-private.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pappacena/launchpad:ocirecipe-subscribe-removal-job into launchpad:master

2021-04-06 Thread Thiago F. Pappacena
The proposal to merge ~pappacena/launchpad:ocirecipe-subscribe-removal-job into 
launchpad:master has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/399889
-- 
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:ocirecipe-filter-private.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pappacena/launchpad:ocirecipe-subscribe-removal-job into launchpad:master

2021-04-06 Thread Colin Watson
The proposal to merge ~pappacena/launchpad:ocirecipe-subscribe-removal-job into 
launchpad:master has been updated.

Commit message changed to:

Consider OCIRecipeSubscription on IRemoveArtifactSubscriptionsJobSource

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/399889
-- 
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:ocirecipe-filter-private.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] ~pappacena/launchpad:ocirecipe-subscribe-removal-job into launchpad:master

2021-04-06 Thread Colin Watson
Review: Approve


-- 
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/399889
Your team Launchpad code reviewers is subscribed to branch 
~pappacena/launchpad:ocirecipe-filter-private.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~pappacena/launchpad:ocirecipe-subscribe-removal-job into launchpad:master

2021-03-18 Thread Thiago F. Pappacena
Thiago F. Pappacena has proposed merging 
~pappacena/launchpad:ocirecipe-subscribe-removal-job into launchpad:master with 
~pappacena/launchpad:ocirecipe-filter-private as a prerequisite.

Commit message:
Consider OCIRecupeSubscription on IRemoveArtifactSubscriptionsJobSource

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/399889
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~pappacena/launchpad:ocirecipe-subscribe-removal-job into launchpad:master.
diff --git a/database/schema/security.cfg b/database/schema/security.cfg
index 5e5e000..e149a3c 100644
--- a/database/schema/security.cfg
+++ b/database/schema/security.cfg
@@ -2110,6 +2110,9 @@ public.gitrepository= SELECT
 public.gitsubscription  = SELECT, UPDATE, DELETE
 public.emailaddress = SELECT
 public.job  = SELECT, INSERT, UPDATE
+public.ociproject   = SELECT
+public.ocirecipe= SELECT
+public.ocirecipesubscription= SELECT, UPDATE, DELETE
 public.person   = SELECT
 public.product  = SELECT
 public.sharingjob   = SELECT, INSERT, UPDATE
diff --git a/lib/lp/registry/model/sharingjob.py b/lib/lp/registry/model/sharingjob.py
index 81e6a9e..b123547 100644
--- a/lib/lp/registry/model/sharingjob.py
+++ b/lib/lp/registry/model/sharingjob.py
@@ -69,6 +69,12 @@ from lp.code.model.gitrepository import (
 GitRepository,
 )
 from lp.code.model.gitsubscription import GitSubscription
+from lp.oci.interfaces.ocirecipe import IOCIRecipe
+from lp.oci.model.ocirecipe import (
+get_ocirecipe_privacy_filter,
+OCIRecipe,
+)
+from lp.oci.model.ocirecipesubscription import OCIRecipeSubscription
 from lp.registry.interfaces.person import IPersonSet
 from lp.registry.interfaces.product import IProduct
 from lp.registry.interfaces.sharingjob import (
@@ -78,6 +84,7 @@ from lp.registry.interfaces.sharingjob import (
 ISharingJobSource,
 )
 from lp.registry.model.distribution import Distribution
+from lp.registry.model.ociproject import OCIProject
 from lp.registry.model.person import Person
 from lp.registry.model.product import Product
 from lp.registry.model.teammembership import TeamParticipation
@@ -271,6 +278,7 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
 gitrepository_ids = []
 snap_ids = []
 specification_ids = []
+ocirecipe_ids = []
 if artifacts:
 for artifact in artifacts:
 if IBug.providedBy(artifact):
@@ -283,6 +291,8 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
 snap_ids.append(artifact.id)
 elif ISpecification.providedBy(artifact):
 specification_ids.append(artifact.id)
+elif IOCIRecipe.providedBy(artifact):
+ocirecipe_ids.append(artifact.id)
 else:
 raise ValueError(
 'Unsupported artifact: %r' % artifact)
@@ -295,6 +305,7 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
 'gitrepository_ids': gitrepository_ids,
 'snap_ids': snap_ids,
 'specification_ids': specification_ids,
+'ocirecipe_ids': ocirecipe_ids,
 'information_types': information_types,
 'requestor.id': requestor.id
 }
@@ -338,6 +349,10 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
 return self.metadata.get('specification_ids', [])
 
 @property
+def ocirecipe_ids(self):
+return self.metadata.get('ocirecipe_ids', [])
+
+@property
 def information_types(self):
 if not 'information_types' in self.metadata:
 return []
@@ -365,6 +380,7 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
 'gitrepository_ids': self.gitrepository_ids,
 'snap_ids': self.snap_ids,
 'specification_ids': self.specification_ids,
+'ocirecipe_ids': self.ocirecipe_ids,
 'pillar': getattr(self.pillar, 'name', None),
 'grantee': getattr(self.grantee, 'name', None)
 }
@@ -382,6 +398,7 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
 gitrepository_filters = []
 snap_filters = []
 specification_filters = []
+ocirecipe_filters = []
 
 if self.branch_ids:
 branch_filters.append(Branch.id.is_in(self.branch_ids))
@@ -393,6 +410,8 @@ class RemoveArtifactSubscriptionsJob(SharingJobDerived):
 if self.specification_ids:
 specification_filters.append(Specification.id.is_in(
 self.specification_ids))
+if self.ocirecipe_ids:
+