Giter Site home page Giter Site logo

gitbucket-announce-plugin's Issues

Add exception handling

There is no specific exception handling for sending e-mail. This cause a lot of undesirable behavior:

  1. No log record are created
  2. No e-mail is sended, even if only one rcpt is invalid
  3. Server returns HTTP STATUS 500 with the stackstrace string as body, making the browser to show the body as text

You could use setSendPartial to prevent behavior number 2, but it still will needed to handle exception.

It also will be nice to log which e-mails were invalid with SendFailedException.getInvalidAddresses.

Sorry not to provide a PR, but I don't work with Scala.

Update to gitbucket 4.17

  • Use new Mailer API which is introduced in GitBucket 4.17.0
  • Separate database access as a service

Separate SMTP settings from the GitBucket "base" settings for the plugin

SMTP settings for the announce should be splitted up:

  • SMTP settings (announce plugin)
  • SMTP notification settings ("base" GitBucket)

Doing so, we could separate the GIT notifications and it's underlying SMTP usage from any other feature that would require to send email.

We needed to remove the "base" SMTP settings and "send notifications" from the bare GitBucket configuration since it became too verbose with no ability to modity to whom and when the emails are sent out. This, naturally disables the possibility to use announce plugin.

Error:Plugin version is 1.6.0, but database version is 1.1

Hello, I use gitbucket in version 4.13 and the plugins "gitbucket-announce-plugin.jar" in version 1.6.
I have this error message: "Plugin version is 1.6.0, but database version is 1.1".
For information gitbucket version 4.2.1 and gitbucket-announce-plugin.jar version v1.4 works.
Do you have any solutions?
Thank you in advance

Support GitBucket 4.35.0

GitBucket v4.35.0 and latest version of this plugin v1.13.0 causes following error because of binary incompatibility.

12:57:22.045 [qtp42768293-229] ERROR f.b.g.a.c.AnnounceController - Catch unhandled error in request: Request(GET //localhost:8080/admin/announce)@7e5e76f1
java.lang.NoSuchMethodError: gitbucket.core.html.main$.apply(Ljava/lang/String;Lscala/Option;Lplay/twirl/api/Html;Lgitbucket/core/controller/Context;)Lplay/twirl/api/Html;
        at fr.brouillard.gitbucket.announce.html.announce$.apply(announce.template.scala:25)
        at fr.brouillard.gitbucket.announce.controller.AnnounceControllerBase.$anonfun$$init$$2(AnnounceController.scala:33)
        at gitbucket.core.util.AdminAuthenticator.authenticate(Authenticator.scala:77)
        at gitbucket.core.util.AdminAuthenticator.adminOnly(Authenticator.scala:72)
        at gitbucket.core.util.AdminAuthenticator.adminOnly$(Authenticator.scala:72)
        at fr.brouillard.gitbucket.announce.controller.AnnounceController.adminOnly(AnnounceController.scala:16)
        at fr.brouillard.gitbucket.announce.controller.AnnounceControllerBase.$anonfun$$init$$1(AnnounceController.scala:33)
        at org.scalatra.ScalatraBase.liftAction(ScalatraBase.scala:282)
        at org.scalatra.ScalatraBase.$anonfun$invoke$1(ScalatraBase.scala:276)
        at org.scalatra.ApiFormats.withRouteMultiParams(ApiFormats.scala:180)
        at org.scalatra.ApiFormats.withRouteMultiParams$(ApiFormats.scala:171)
        at gitbucket.core.controller.ControllerBase.withRouteMultiParams(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.invoke(ScalatraBase.scala:275)
        at org.scalatra.ScalatraBase.invoke$(ScalatraBase.scala:274)
        at gitbucket.core.controller.ControllerBase.invoke(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$runRoutes$3(ScalatraBase.scala:250)
        at scala.Option.flatMap(Option.scala:283)
        at org.scalatra.ScalatraBase.$anonfun$runRoutes$1(ScalatraBase.scala:248)
        at scala.collection.immutable.Stream.flatMap(Stream.scala:202)
        at org.scalatra.ScalatraBase.runRoutes(ScalatraBase.scala:247)
        at org.scalatra.ScalatraBase.runRoutes$(ScalatraBase.scala:245)
        at gitbucket.core.controller.ControllerBase.runRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.runActions$1(ScalatraBase.scala:169)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$6(ScalatraBase.scala:181)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.cradleHalt(ScalatraBase.scala:201)
        at org.scalatra.ScalatraBase.executeRoutes(ScalatraBase.scala:181)
        at org.scalatra.ScalatraBase.executeRoutes$(ScalatraBase.scala:150)
        at gitbucket.core.controller.ControllerBase.executeRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$handle$1(ScalatraBase.scala:123)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withResponse(DynamicScope.scala:75)
        at org.scalatra.DynamicScope.withResponse$(DynamicScope.scala:73)
        at gitbucket.core.controller.ControllerBase.withResponse(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.$anonfun$withRequestResponse$1(DynamicScope.scala:55)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.withRequestResponse(DynamicScope.scala:54)
        at org.scalatra.DynamicScope.withRequestResponse$(DynamicScope.scala:52)
        at gitbucket.core.controller.ControllerBase.withRequestResponse(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.handle(ScalatraBase.scala:123)
        at org.scalatra.ScalatraBase.handle$(ScalatraBase.scala:119)
        at gitbucket.core.controller.ControllerBase.org$scalatra$servlet$ServletBase$$super$handle(ControllerBase.scala:35)
        at org.scalatra.servlet.ServletBase.handle(ServletBase.scala:42)
        at org.scalatra.servlet.ServletBase.handle$(ServletBase.scala:35)
        at gitbucket.core.controller.ControllerBase.org$scalatra$FlashMapSupport$$super$handle(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.$anonfun$handle$1(FlashMap.scala:197)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.handle(FlashMap.scala:172)
        at org.scalatra.FlashMapSupport.handle$(FlashMap.scala:171)
        at gitbucket.core.controller.ControllerBase.handle(ControllerBase.scala:35)
        at org.scalatra.ScalatraFilter.$anonfun$doFilter$1(ScalatraFilter.scala:41)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.ScalatraFilter.doFilter(ScalatraFilter.scala:41)
        at org.scalatra.ScalatraFilter.doFilter$(ScalatraFilter.scala:36)
        at gitbucket.core.controller.ControllerBase.doFilter(ControllerBase.scala:73)
        at gitbucket.core.servlet.PluginControllerFilter.$anonfun$process$2(PluginControllerFilter.scala:39)
        at gitbucket.core.servlet.PluginControllerFilter.$anonfun$process$2$adapted(PluginControllerFilter.scala:32)
        at scala.collection.immutable.List.foreach(List.scala:305)
        at gitbucket.core.servlet.PluginControllerFilter.process(PluginControllerFilter.scala:32)
        at gitbucket.core.servlet.ControllerFilter.doFilter(CompositeScalatraFilter.scala:25)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1591)
        at org.scalatra.ScalatraFilter.$anonfun$doNotFound$1(ScalatraFilter.scala:80)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$5(ScalatraBase.scala:172)
        at scala.Option.getOrElse(Option.scala:201)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$3(ScalatraBase.scala:172)
        at scala.Option.getOrElse(Option.scala:201)
        at org.scalatra.ScalatraBase.runActions$1(ScalatraBase.scala:172)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$6(ScalatraBase.scala:181)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.cradleHalt(ScalatraBase.scala:201)
        at org.scalatra.ScalatraBase.executeRoutes(ScalatraBase.scala:181)
        at org.scalatra.ScalatraBase.executeRoutes$(ScalatraBase.scala:150)
        at gitbucket.core.controller.ControllerBase.executeRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$handle$1(ScalatraBase.scala:123)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withResponse(DynamicScope.scala:75)
        at org.scalatra.DynamicScope.withResponse$(DynamicScope.scala:73)
        at gitbucket.core.controller.ControllerBase.withResponse(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.$anonfun$withRequestResponse$1(DynamicScope.scala:55)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.withRequestResponse(DynamicScope.scala:54)
        at org.scalatra.DynamicScope.withRequestResponse$(DynamicScope.scala:52)
        at gitbucket.core.controller.ControllerBase.withRequestResponse(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.handle(ScalatraBase.scala:123)
        at org.scalatra.ScalatraBase.handle$(ScalatraBase.scala:119)
        at gitbucket.core.controller.ControllerBase.org$scalatra$servlet$ServletBase$$super$handle(ControllerBase.scala:35)
        at org.scalatra.servlet.ServletBase.handle(ServletBase.scala:42)
        at org.scalatra.servlet.ServletBase.handle$(ServletBase.scala:35)
        at gitbucket.core.controller.ControllerBase.org$scalatra$FlashMapSupport$$super$handle(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.$anonfun$handle$1(FlashMap.scala:197)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.handle(FlashMap.scala:172)
        at org.scalatra.FlashMapSupport.handle$(FlashMap.scala:171)
        at gitbucket.core.controller.ControllerBase.handle(ControllerBase.scala:35)
        at org.scalatra.ScalatraFilter.$anonfun$doFilter$1(ScalatraFilter.scala:41)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.ScalatraFilter.doFilter(ScalatraFilter.scala:41)
        at org.scalatra.ScalatraFilter.doFilter$(ScalatraFilter.scala:36)
        at gitbucket.core.controller.ControllerBase.doFilter(ControllerBase.scala:73)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1591)
        at gitbucket.core.servlet.TransactionFilter.$anonfun$doFilter$1(TransactionFilter.scala:39)
        at gitbucket.core.servlet.TransactionFilter.$anonfun$doFilter$1$adapted(TransactionFilter.scala:30)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.$anonfun$withTransaction$2(BlockingProfile.scala:207)
        at slick.JdbcProfileBlockingSession$BlockingSession.withTransaction(TransactionalJdbcBackend.scala:26)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.$anonfun$withTransaction$1(BlockingProfile.scala:207)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.withSession(BlockingProfile.scala:200)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.withTransaction(BlockingProfile.scala:207)
        at gitbucket.core.servlet.TransactionFilter.doFilter(TransactionFilter.scala:30)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1583)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:494)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
        at java.lang.Thread.run(Thread.java:748)

update to gitbucket 4.10

update plugin to be compatible with gitbucket 4.10:

  • scala 2.12
  • blocking-slick 0.0.7 & slick 3.2

allow to choose target audience of email announce

When writing an email announce in System Administration panel, offer the possibility to send the announce:

  • globally, actual behavior (all active users)
  • to a defined audience: users and/or groups like in image below

image

move send button outside of the box container

the "send notification" button should be put outside of the box container so that it does not make visible a grey panel at the bottom of the page.

image

It should look like the System Settings page of gitbucket.

image

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.