Open wanejen opened 1 week ago
I understand the confusion.
The config should be copied into the Swarm config file. For example: /opt/perforce/swarm/data/config.php
<?php
/* WARNING: The contents of this file is cached by Swarm. Changes to
* it will not be picked up until the cached versions are removed.
* See the documentation on the 'Swarm config cache'.
*/
return array(
'environment' => array(
'hostname' => 'xxxx.yyyyy.com',
),
'p4' => array(
'port' => 'ssl:0.1.2.3:1666',
'user' => 'swarmUser',
'password' => 'XXXXXXXXXXXX',
),
'log' => array(
'priority' => 3, // 7 for max, defaults to 3
),
'slack-notify' => array(
'token' => 'xoxb-XXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'notify_channel' => 'swarm-channel-name',
),
);
@Deams51 Thank you for your help. I have successfully received the notification after modifying the configuration. However, I found an issue during testing. I'm not sure if you are already aware, but it seems that there is an error when users submit comments under the review they created themselves (other people's comments are working fine).
2024-11-25T06:42:45+00:00 CRIT (2): TypeError: Argument 1 passed to SlackNotify\Service\SlackNotify::notifyNewComment() must be an instance of Reviews\Model\Review, null given, called in /opt/perforce/swarm/module/SlackNotify/src/Listener/ReviewActivity.php on line 131 and defined in /opt/perforce/swarm/module/SlackNotify/src/Service/SlackNotify.php:324
Stack trace:
#0 /opt/perforce/swarm/module/SlackNotify/src/Listener/ReviewActivity.php(131): SlackNotify\Service\SlackNotify->notifyNewComment()
#1 /opt/perforce/swarm/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): SlackNotify\Listener\ReviewActivity->handleReviewActivity()
#2 /opt/perforce/swarm/vendor/laminas/laminas-eventmanager/src/EventManager.php(170): Laminas\EventManager\EventManager->triggerListeners()
#3 /opt/perforce/swarm/module/Queue/src/Controller/IndexController.php(189): Laminas\EventManager\EventManager->triggerEvent()
#4 /opt/perforce/swarm/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Queue\Controller\IndexController->workerAction()
#5 /opt/perforce/swarm/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch()
#6 /opt/perforce/swarm/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners()
#7 /opt/perforce/swarm/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(103): Laminas\EventManager\EventManager->triggerEventUntil()
#8 /opt/perforce/swarm/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch()
#9 /opt/perforce/swarm/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch()
#10 /opt/perforce/swarm/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners()
#11 /opt/perforce/swarm/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil()
#12 /opt/perforce/swarm/public/index.php(69): Laminas\Mvc\Application->run()
#13 {main}
Hi,
I have followed the instructions you provided and configured the settings as suggested. However, I am still experiencing issues where Slack is not receiving any information, and I am not seeing any relevant output in the logs.
To assist with diagnosing the problem, I have attached screenshots of the current configurations for your reference. Additionally, here are some details about the environment:
The version of Swarm is "SWARM/2023.2/2458885 (2023/06/28)".
And I have already added enough permissions in Slack.