jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/353758 )

Change subject: $correlationId -> $logId
......................................................................


$correlationId -> $logId

STOMP holdover

Change-Id: I4fd332413d0c80634a93b5ca70e5ab9e7a85559d
---
M sites/all/modules/queue2civicrm/fredge/fredge_queue_consume.drush.inc
M sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json
M sites/all/modules/queue2civicrm/tests/includes/Message.php
M sites/all/modules/wmf_common/WmfQueueConsumer.php
4 files changed, 8 insertions(+), 27 deletions(-)

Approvals:
  Mepps: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/sites/all/modules/queue2civicrm/fredge/fredge_queue_consume.drush.inc 
b/sites/all/modules/queue2civicrm/fredge/fredge_queue_consume.drush.inc
index 0782081..be4eb1c 100644
--- a/sites/all/modules/queue2civicrm/fredge/fredge_queue_consume.drush.inc
+++ b/sites/all/modules/queue2civicrm/fredge/fredge_queue_consume.drush.inc
@@ -69,6 +69,7 @@
        }
 }
 
+// FIXME: this is now broken
 function drush_fredge_queue_consume_fredge_process_messagefile( $type, $path ) 
{
     watchdog( 'queue2civicrm', "Processing input file @path and feeding to 
queue2civicrm_import.",
         array( '@path' => realpath( $path ) ), WATCHDOG_INFO );
diff --git a/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json 
b/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json
index 5472480..3ab2860 100644
--- a/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json
+++ b/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json
@@ -15,7 +15,6 @@
        "user_ip": "1.2.3.4",
        "freeform": "1",
        "gateway_txn_id": "",
-       "correlation-id": "testgateway-28713751.0",
        "date": "1445990975",
        "server": "testpayments1001",
        "gateway": "testgateway",
diff --git a/sites/all/modules/queue2civicrm/tests/includes/Message.php 
b/sites/all/modules/queue2civicrm/tests/includes/Message.php
index 6494016..cb64acf 100644
--- a/sites/all/modules/queue2civicrm/tests/includes/Message.php
+++ b/sites/all/modules/queue2civicrm/tests/includes/Message.php
@@ -4,13 +4,11 @@
     protected $defaults = array();
 
     public $body;
-    public $headers;
 
     protected $data;
 
     function __construct( $values = array() ) {
         $this->data = $this->defaults;
-        $this->headers = array();
         $this->set( $values );
     }
 
@@ -22,18 +20,8 @@
         $this->body = json_encode( $this->data );
     }
 
-    function setHeaders( $values ) {
-        if ( is_array( $values ) ) {
-            $this->headers = array_merge( $this->headers, $values );
-        }
-    }
-
     function getBody() {
         return $this->data;
-    }
-
-    function getHeaders() {
-        return $this->headers;
     }
 
     function loadDefaults( $name ) {
@@ -99,13 +87,6 @@
             $this->txn_id_key => mt_rand(),
             'order_id' => mt_rand(),
         ) + $values );
-
-        $this->setHeaders( array(
-            "persistent" => 'true',
-            // FIXME: this might indicate a key error in our application code.
-            "correlation-id" => 
"{$this->data['gateway']}-{$this->data[$this->txn_id_key]}",
-            "JMSCorrelationID" => 
"{$this->data['gateway']}-{$this->data[$this->txn_id_key]}",
-        ) );
     }
 
     function getGateway() {
diff --git a/sites/all/modules/wmf_common/WmfQueueConsumer.php 
b/sites/all/modules/wmf_common/WmfQueueConsumer.php
index 61376c8..c78952a 100644
--- a/sites/all/modules/wmf_common/WmfQueueConsumer.php
+++ b/sites/all/modules/wmf_common/WmfQueueConsumer.php
@@ -11,7 +11,7 @@
 abstract class WmfQueueConsumer extends BaseQueueConsumer {
 
        protected function handleError( $message, Exception $ex ) {
-               $correlationId = "{$message['gateway']}-{$message['order_id']}";
+               $logId = "{$message['gateway']}-{$message['order_id']}";
                if ( $ex instanceof WmfException ) {
                        watchdog(
                                'wmf_common',
@@ -20,13 +20,13 @@
                                WATCHDOG_ERROR
                        );
 
-                       $this->handleWmfException( $message, $ex, 
$correlationId );
+                       $this->handleWmfException( $message, $ex, $logId );
                } else {
                        $error = 'UNHANDLED ERROR. Halting dequeue loop. 
Exception: ' .
                                $ex->getMessage() . "\nStack Trace: " .
                                $ex->getTraceAsString();
                        watchdog( 'wmf_common', $error, NULL, WATCHDOG_ERROR );
-                       wmf_common_failmail( 'wmf_common', $error, NULL, 
$correlationId );
+                       wmf_common_failmail( 'wmf_common', $error, NULL, $logId 
);
 
                        throw $ex;
                }
@@ -35,11 +35,11 @@
        /**
         * @param array $message
         * @param WmfException $ex
-        * @param string $correlationId
+        * @param string $logId
         * @throws WmfException when we want to halt the dequeue loop
         */
        protected function handleWmfException(
-               $message, WmfException $ex, $correlationId
+               $message, WmfException $ex, $logId
        ) {
                $mailableDetails = '';
                $reject = false;
@@ -70,7 +70,7 @@
                if ( $ex->isDropMessage() ) {
                        watchdog(
                                'wmf_common',
-                               "Dropping message altogether: $correlationId",
+                               "Dropping message altogether: $logId",
                                NULL,
                                WATCHDOG_ERROR
                        );
@@ -88,7 +88,7 @@
                        );
                        $mailableDetails = self::itemUrl( $damagedId );
                } else {
-                       $mailableDetails = "Redacted contents of message ID: 
$correlationId";
+                       $mailableDetails = "Redacted contents of message ID: 
$logId";
                }
 
                if ( !$ex->isNoEmail() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/353758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4fd332413d0c80634a93b5ca70e5ab9e7a85559d
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Eileen <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: Mepps <[email protected]>
Gerrit-Reviewer: XenoRyet <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to