Giter VIP home page Giter VIP logo

teamcity-browser-notify's Introduction

Teamcity browser notify

Description

Browser notify is a plugin for JetBrains Teamcity server, that adds notification via web api notification mechanism.

demo

Installation

To install plugin download zip archive it and copy it to Teamcity <data directory>/plugins (it is $HOME/.BuildServer/plugins under Linux and C:\Users<user_name>.BuildServer\plugins under Windows). For more information, take a look at official documentation

Configuration

Configuration is accessible from user preferences, in Notification Rules tabs. Select Browser Notifier sub item. First time you should see a warning, because browser notification should be manually accepted by user for each site.

settings denied

Click on Request notification access button and you should see a pop-up from a browser, asking for permission.

settings requested

After access would be granted, you could try send test notification from this page by clicking Test notification button.

settings granted

You could set a timeout for notification to be presented on a screen. Next you have to actually configure notification rules for this type of notifier, the same as you probably done for other notifiers. You can read more in official documentation.

License

MIT

Icons made by Freepik, Madebyoliver from www.flaticon.com.

teamcity-browser-notify's People

Contributors

grundic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

teamcity-browser-notify's Issues

Plugin is unusable with Java 11 due to sun.misc.BASE64Encoder

This plugin uses sun.misc.BASE64Encoder which always was an internal class and with Java 11 is not available anymore.
TeamCity 2020.1 now recommends using Java 11.
You should replace sun.misc.BASE64Encoder usages by java.util.Base64 to make your plugin compatible with Java 11.

Notifications indicating status should more clearly identify pass/fail

A notification that tells me pass or fail is the same, except for the text of "succeeded" or "failed". It would be nice if the notification included an green check or red X icon if it failed, or some other kind of indicator. Or perhaps different font colors? Something distinct would make it a little friendlier.

Clicking browser notification takes you to build configuration, not build.

Thanks for a great tool.

My current issue, clicking the notification links in Safari (or Chrome) takes me to the build configuration, not the build that passed/failed/investigation was assigned to me. It seems to me it should be similar to the Slack notifiers, where it takes you directly to the build (i.e. build #528491)

`UnsatisfiedDependencyException` when installing as uploaded .zip

Were on TeamCity 2018.2 and get the following stacktrace upon uploading the .zip

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jetbrains.buildServer.serverSide.BuildServerListenerEventDispatcher': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler] for bean with name 'com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler#0' defined in Byte array resource [plugin: teamcity-browser-notify#teamcity-browser-notify-1.0.3.jar!/META-INF/build-server-plugin-teamcity-browser-notify.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/atmosphere/handler/AbstractReflectorAtmosphereHandler 
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:343)
at jetbrains.buildServer.plugins.spring.PerPluginAdditionalSpringContextProvider.createEventDispatcherWrapper(PerPluginAdditionalSpringContextProvider.java:44)
at jetbrains.buildServer.plugins.spring.PerPluginAdditionalSpringContextProvider.registerServerEventDispatchers(PerPluginAdditionalSpringContextProvider.java:52)
at jetbrains.buildServer.plugins.spring.PerPluginAdditionalSpringContextProvider.registerEventDispatcherWrappers(PerPluginAdditionalSpringContextProvider.java:54)
at jetbrains.buildServer.plugins.spring.PerPluginAdditionalSpringContextProvider.updatePluginContext(PerPluginAdditionalSpringContextProvider.java:43)
at jetbrains.buildServer.plugins.spring.SpringPluginLoader$TeamCityPluginContext.prepareBeanFactory(SpringPluginLoader.java:233)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:518) 
at jetbrains.buildServer.plugins.spring.SpringPluginLoader.pluginClassesLoaded(SpringPluginLoader.java:114) 
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at jetbrains.buildServer.util.EventDispatcher$3.run(EventDispatcher.java:128) 
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:76) 
at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:122) 
at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:72) 
at com.sun.proxy.$Proxy25.pluginClassesLoaded(Unknown Source) 
at jetbrains.buildServer.plugins.PluginManagerImpl$5.visitPlugin(PluginManagerImpl.java:417) 
at jetbrains.buildServer.plugins.PluginsCollection$6.run(PluginsCollection.java:280) 
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
at java.util.concurrent.FutureTask.run(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
at java.lang.Thread.run(Unknown Source) 
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler] for bean with name 'com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler#0' defined in Byte array resource [plugin: teamcity-browser-notify#teamcity-browser-notify-1.0.3.jar!/META-INF/build-server-plugin-teamcity-browser-notify.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/atmosphere/handler/AbstractReflectorAtmosphereHandler 
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1388) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:641)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:609)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484) 
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:220) 
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1267)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 28 more 
Caused by: java.lang.NoClassDefFoundError: org/atmosphere/handler/AbstractReflectorAtmosphereHandler 
at java.lang.ClassLoader.defineClass1(Native Method) 
at java.lang.ClassLoader.defineClass(Unknown Source) 
at java.security.SecureClassLoader.defineClass(Unknown Source) 
at java.net.URLClassLoader.defineClass(Unknown Source) 
at java.net.URLClassLoader.access$100(Unknown Source) 
at java.net.URLClassLoader$1.run(Unknown Source) 
at java.net.URLClassLoader$1.run(Unknown Source) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(Unknown Source) 
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.doLoadClass(TeamCityClassLoader.java:73) 
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.loadClass(TeamCityClassLoader.java:40) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
at org.springframework.util.ClassUtils.forName(ClassUtils.java:250) 
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:401)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1432)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1377) 
... 39 more 
Caused by: java.lang.ClassNotFoundException: Class 'org.atmosphere.handler.AbstractReflectorAtmosphereHandler' was not found 
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.doLoadClass(TeamCityClassLoader.java:85) 
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.loadClass(TeamCityClassLoader.java:40) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
... 55 more

Now there are two "Browser Notifier" tabs in the notification settings with 2020.1

TC implemented an own "Browser Notifier" which works as browser plugins and is intended to replace the Windows tray notifier.
Due to that they also renamed the "Windows Tray Notifier" tab to "Browser Notifier" which now results in two tabs with the same name with this plugin installed.

Maybe you should consider renaming your configuration tab slightly to at least have them distinguishable.

Please update to support TeamCity 2017.2 EAP

When installing the plugin on a TeamCity 2017.2 EAP instance it fails to load:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mainAutowireCandidateResolver' defined in URL [jar:file:/teamcity/webapps/ROOT/WEB-INF/lib/common-impl.jar!/META-INF/teamcity-global-spring-candidate-resolver.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [jetbrains.buildServer.spring.candidates.TeamCityAutowireCandidateResolver[]]: Error loading class [com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler] for bean with name 'com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler#0' defined in Byte array resource [plugin: teamcity-browser-notify#teamcity-browser-notify-1.0.1.jar!/META-INF/build-server-plugin-teamcity-browser-notify.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/atmosphere/handler/AbstractReflectorAtmosphereHandler; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler] for bean with name 'com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler#0' defined in Byte array resource [plugin: teamcity-browser-notify#teamcity-browser-notify-1.0.1.jar!/META-INF/build-server-plugin-teamcity-browser-notify.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/atmosphere/handler/AbstractReflectorAtmosphereHandler
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:179)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
at jetbrains.buildServer.plugins.spring.SpringPluginLoader.pluginClassesLoaded(SpringPluginLoader.java:102)
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at jetbrains.buildServer.util.EventDispatcher$3.run(EventDispatcher.java:126)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:71)
at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:120)
at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:70)
at com.sun.proxy.$Proxy22.pluginClassesLoaded(Unknown Source)
at jetbrains.buildServer.plugins.PluginManagerImpl$2.visitPlugin(PluginManagerImpl.java:140)
at jetbrains.buildServer.plugins.PluginsCollection$6.run(PluginsCollection.java:257)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:748)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler] for bean with name 'com.github.grundic.browser.notificator.websocket.BrowserNotificationHandler#0' defined in Byte array resource [plugin: teamcity-browser-notify#teamcity-browser-notify-1.0.1.jar!/META-INF/build-server-plugin-teamcity-browser-notify.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/atmosphere/handler/AbstractReflectorAtmosphereHandler
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:445)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:415)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:220)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1177)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1041)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 28 more
Caused by: java.lang.NoClassDefFoundError: org/atmosphere/handler/AbstractReflectorAtmosphereHandler
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.doLoadClass(TeamCityClassLoader.java:73)
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.loadClass(TeamCityClassLoader.java:40)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:394)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1397)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1344)
... 39 more
Caused by: java.lang.ClassNotFoundException: Class 'org.atmosphere.handler.AbstractReflectorAtmosphereHandler' was not found
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.doLoadClass(TeamCityClassLoader.java:85)
at jetbrains.buildServer.plugins.classLoaders.TeamCityClassLoader.loadClass(TeamCityClassLoader.java:40)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more

Clicking browser notifcation takes you to a non-existant page

Clicking a browser notification popup takes me to this URL:

http://MyServer/viewType.html?buildTypeId=MyBuildId

Where it should be taking me is

http://MyServer/teamcity/viewType.html?buildTypeId=MyBuildId

Similar to issue #1 , I do not have teamcity installed as the root application in tomcat.

I get a 404 error as Tomcat doesn't have that resource:
HTTP Status 404 - /viewType.html

type Status report

message /viewType.html

description The requested resource is not available.

Apache Tomcat/7.0.59

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.