← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:remove-snap-webhooks-enabled-rule into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:remove-snap-webhooks-enabled-rule into launchpad:master.

Commit message:
Remove snap.webhooks.enabled feature rule

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/433656

It's been enabled everywhere for some time.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:remove-snap-webhooks-enabled-rule into launchpad:master.
diff --git a/lib/lp/snappy/interfaces/snap.py b/lib/lp/snappy/interfaces/snap.py
index 5157062..a86919c 100644
--- a/lib/lp/snappy/interfaces/snap.py
+++ b/lib/lp/snappy/interfaces/snap.py
@@ -24,7 +24,6 @@ __all__ = [
     "SNAP_PRIVATE_FEATURE_FLAG",
     "SNAP_SNAPCRAFT_CHANNEL_FEATURE_FLAG",
     "SNAP_TESTING_FLAGS",
-    "SNAP_WEBHOOKS_FEATURE_FLAG",
     "SnapAuthorizationBadGeneratedMacaroon",
     "SnapBuildAlreadyPending",
     "SnapBuildArchiveOwnerMismatch",
@@ -100,12 +99,10 @@ from lp.soyuz.interfaces.distroarchseries import IDistroArchSeries
 
 SNAP_PRIVATE_FEATURE_FLAG = "snap.allow_private"
 SNAP_SNAPCRAFT_CHANNEL_FEATURE_FLAG = "snap.channels.snapcraft"
-SNAP_WEBHOOKS_FEATURE_FLAG = "snap.webhooks.enabled"
 
 
 SNAP_TESTING_FLAGS = {
     SNAP_PRIVATE_FEATURE_FLAG: "on",
-    SNAP_WEBHOOKS_FEATURE_FLAG: "on",
 }
 
 
diff --git a/lib/lp/snappy/subscribers/snapbuild.py b/lib/lp/snappy/subscribers/snapbuild.py
index 06bde3e..a003ebc 100644
--- a/lib/lp/snappy/subscribers/snapbuild.py
+++ b/lib/lp/snappy/subscribers/snapbuild.py
@@ -6,32 +6,27 @@
 from zope.component import getUtility
 
 from lp.buildmaster.enums import BuildStatus
-from lp.services.features import getFeatureFlag
 from lp.services.scripts import log
 from lp.services.webapp.publisher import canonical_url
 from lp.services.webhooks.interfaces import IWebhookSet
 from lp.services.webhooks.payload import compose_webhook_payload
-from lp.snappy.interfaces.snap import SNAP_WEBHOOKS_FEATURE_FLAG
 from lp.snappy.interfaces.snapbuild import ISnapBuild
 from lp.snappy.interfaces.snapbuildjob import ISnapStoreUploadJobSource
 
 
 def _trigger_snap_build_webhook(snapbuild, action):
-    if getFeatureFlag(SNAP_WEBHOOKS_FEATURE_FLAG):
-        payload = {
-            "snap_build": canonical_url(snapbuild, force_local_path=True),
-            "action": action,
-        }
-        payload.update(
-            compose_webhook_payload(
-                ISnapBuild,
-                snapbuild,
-                ["snap", "build_request", "status", "store_upload_status"],
-            )
-        )
-        getUtility(IWebhookSet).trigger(
-            snapbuild.snap, "snap:build:0.1", payload
+    payload = {
+        "snap_build": canonical_url(snapbuild, force_local_path=True),
+        "action": action,
+    }
+    payload.update(
+        compose_webhook_payload(
+            ISnapBuild,
+            snapbuild,
+            ["snap", "build_request", "status", "store_upload_status"],
         )
+    )
+    getUtility(IWebhookSet).trigger(snapbuild.snap, "snap:build:0.1", payload)
 
 
 def snap_build_created(snapbuild, event):