Code Monkey home page Code Monkey logo

grails-slack's People

Contributors

helgew avatar mathifonseca avatar theconnman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grails-slack's Issues

actions

I unable to send buttons via actions.

Allow channel ids instead of names

Allow channel ids to be used.

channel nullable:true, matches: "^[@|#].+\$"

it should not always start with # or @; U (user), C (public channel) and G (private channel) are also allowed (maybe even more, I think it's best to remove the check).

See section "channel override" on https://api.slack.com/incoming-webhooks:

If you prefer, you can also specify a channel ID or user ID like so: "channel": "U024BE7LH".

Validation failing on Grails 3.3.2

Running:
Grails - 3.3.2
org.grails.plugins:slack - 3.2.0

trying to send a message:

slackService.send {
  text "test"
}

results in the following error:

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'org.grails.datastore.gorm.validation.constraints.eval.DefaultConstraintEvaluator@7289c1f2' with class 'org.grails.datastore.gorm.validation.constraints.eval.DefaultConstraintEvaluator' to class 'grails.validation.ConstraintsEvaluator'
grails.validation.Validateable$Trait$Helper.validate(Validateable.groovy:159)
grails.validation.Validateable$Trait$Helper.validate(Validateable.groovy:93)
grails.plugin.slack.builder.SlackMessageBuilder.getMessage(SlackMessageBuilder.groovy:15)
grails.plugin.slack.SlackService.buildMessage(SlackService.groovy:61)
grails.plugin.slack.SlackService.send(SlackService.groovy:15)

3.1.5 Compatibility

The plugin does not work under grails 3.1.5 . After recompilation and declaring a runtime dependency on 'org.grails:grails-datastore-rest-client:5.0.0.RC2', the following error is produced when trying to send a message:
ERROR reactor.bus.EventBus - Could not write request: no suitable HttpMessageConverter found for request type [grails.converters.JSON] and content type [application/json;charset=UTF-8]; nested exception is reactor.core.support.Exceptions$ValueCause: Exception while signaling value: reactor.bus.Event.class : Event{id=null, headers=null, replyTo=null, key=user.new, data=example.User : 4} org.springframework.web.client.RestClientException: Could not write request: no suitable HttpMessageConverter found for request type [grails.converters.JSON] and content type [application/json;charset=UTF-8]; nested exception is reactor.core.support.Exceptions$ValueCause: Exception while signaling value: reactor.bus.Event.class : Event{id=null, headers=null, replyTo=null, key=user.new, data=example.User : 4} at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:810) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:594) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:565) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:484) at grails.plugins.rest.client.RestBuilder.invokeRestTemplate(RestBuilder.groovy:310) at grails.plugins.rest.client.RestBuilder.doRequestInternal(RestBuilder.groovy:274) at grails.plugins.rest.client.RestBuilder.doRequestInternal(RestBuilder.groovy:262) at grails.plugins.rest.client.RestBuilder.post(RestBuilder.groovy:148) at grails.plugins.rest.client.RestBuilder$post.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) at grails.plugin.slack.SlackService.send(SlackService.groovy:35) at grails.plugin.slack.SlackService$$FastClassBySpringCGLIB$$1a9b6f8a.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at grails.plugin.slack.SlackService$$EnhancerBySpringCGLIB$$55ee8b3b.send(<generated>) at grails.plugin.slack.SlackService$send.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at MySlackService.onNewUser(MySlackService.groovy:16) at MySlackService$$FastClassBySpringCGLIB$$41451afb.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at MySlackService$$EnhancerBySpringCGLIB$$94dca18c.onNewUser(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:216) at reactor.spring.context.config.ConsumerBeanAutoConfiguration$Invoker.apply(ConsumerBeanAutoConfiguration.java:351) at reactor.spring.context.config.ConsumerBeanAutoConfiguration$ServiceConsumer.accept(ConsumerBeanAutoConfiguration.java:297) at reactor.spring.context.config.ConsumerBeanAutoConfiguration$ServiceConsumer.accept(ConsumerBeanAutoConfiguration.java:284) at reactor.bus.EventBus$3.accept(EventBus.java:317) at reactor.bus.EventBus$3.accept(EventBus.java:310) at reactor.bus.routing.ConsumerFilteringRouter.route(ConsumerFilteringRouter.java:72) at reactor.bus.EventBus.accept(EventBus.java:591) at reactor.bus.EventBus.accept(EventBus.java:63) at reactor.core.dispatch.AbstractLifecycleDispatcher.route(AbstractLifecycleDispatcher.java:160) at reactor.core.dispatch.MultiThreadDispatcher$MultiThreadTask.run(MultiThreadDispatcher.java:74) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: reactor.core.support.Exceptions$ValueCause: Exception while signaling value: reactor.bus.Event.class : Event{id=null, headers=null, replyTo=null, key=user.new, data=example.User : 4} at reactor.core.support.Exceptions.addValueAsLastCause(Exceptions.java:127) at reactor.bus.routing.ConsumerFilteringRouter.route(ConsumerFilteringRouter.java:77) ... 7 common frames omitted

Commenting out line 33 in SlackService.groovy solved the issue.

Hi, I tried to compile it, however it keeps sending an error. Grails 3.0.11

Hi,
I would appreciate any help.

Thanks in advance.

this is my config.gradle:

buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
mavenCentral()

    maven { url "http://dl.bintray.com/mathifonseca/grails-plugins" }
    maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
    classpath "org.grails:grails-gradle-plugin:$grailsVersion"
    classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0'
    classpath "org.grails.plugins:hibernate:4.3.10.5"
}

}

plugins {
id "io.spring.dependency-management" version "0.5.4.RELEASE"
}

version "0.1"
group "bilore.apapi"

apply plugin: "spring-boot"
apply plugin: "war"
apply plugin: "asset-pipeline"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"

ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}

assets {
minifyJs = true
minifyCss = true
}

repositories {
mavenLocal()
mavenCentral()
maven { url "http://dl.bintray.com/mathifonseca/grails-plugins" }
maven { url "https://repo.grails.org/grails/core" }

}

dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}

dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"

compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"

//App dependencies
compile "org.grails:grails-datastore-rest-client:5.0.0.RC2"
//compile "org.grails.plugins:slack:2.0.0"

runtime "org.grails.plugins:asset-pipeline"

testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"

// Note: It is recommended to update to a more robust driver (Chrome, Firefox etc.)
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'

console "org.grails:grails-console"

}

task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}


Am I running the wrong version for Grails 2.4.3?

Hi there, thanks for sharing this plugin, definitely a time-saver.

My BuildConfig has:

repositories {
	mavenRepo 'http://dl.bintray.com/mathifonseca/grails-plugins/'
}
dependencies {
	compile "org.grails.plugins:slack:3.0.0"
}

Mine is a Grails 2.4.3 app. On startup, I get the exception below. I'm wondering if there's a problem with the version I'm running? I have tried with version 2.0.0 and 3.0.0. Poking around in the maven repo and past gh issues, I can see the name migrated from grails-slack, but I tried this as well and got the same outcome. Exception disappears when the dependency is commented out.

Any tips for this? Is it maybe a known lack of compatibility with Grails 2.x?

| Error Error executing script RunApp: grails/boot/config/GrailsAutoConfiguration (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: grails/boot/config/GrailsAutoConfiguration
at _PluginDependencies$_run_closure2.doCall(_PluginDependencies.groovy:48)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at _GrailsPackage$_run_closure2.doCall(_GrailsPackage.groovy:57)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81)
at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128)
at RunApp$_run_closure1.doCall(RunApp:28)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.lang.ClassNotFoundException: grails.boot.config.GrailsAutoConfiguration

When tried to send message from grails app 2nd time, got exception.

In the first time it posted the message correctly to slack channel, but when tried to send 2nd time it gave exception.
org.apache.commons.lang.UnhandledException:
org.codehaus.groovy.grails.web.converters.exceptions.ConverterException:
at grails.plugin.slack.SlackService.send(SlackService.groovy:27)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.