JetBrains! Let’s improve and simplify plugin development!

    Hello everyone and especially Jetbrains employee. I would like to talk about plugin development for Teamcity: what I think can be improved.

    First of all, my name is Grigory. Currently I work at mail.ru as build manager. Beside my casual responsibilities I do some python/Java programming to improve infrastructure, QA Team workflow and automate some routine tasks. I’m not a professional developer, so I could be wrong in some cases.


Why plugins are important?
    First, I would like to discuss why plugins rock. In my humble opinion, JetBrains team should concentrate theirs work on core features of Teamcity: performance, stability, persistence etc.  Everything else should be implemented with plugins. For now, a lot of plugins is created and a lot of bundled - that is great! Plugins enlarge functionality, they can add specific features, that core team don’t have time for. So, plugins are just great, I think we all know that. Especially, because community is huge power - motivated and interested person can do much more even if he doesn’t get reward. He got more - satisfaction.


Problems and solutions
    Some time ago I’ve made a couple plugins for Jira (good issue tracker by Atlassian). So I will compare plugin development with this platform.

  1. Plugin template: what do we have with JetBrains is zip archive with some sample plugin. It has examples of some common things, jsp code, controllers, etc. Nice. But what if I know that already? I want to start to write new plugin from scratch, without any samples and other trash. Recently I’ve found repository on github with plugin template. That is a good start - why not to make it official? As far as I know, there is public repository with all JetBrains products. Additional benefit: you can create additional branch for new version of TC and everyone can easily get exectly that version he needs.
  2. Build system and dependencies: ANT was good. Long, long time ago. I think, it’s time to upgrade. I check out your svn repository with plugin samples - almost 4Gb. Maaann... All dependencies lay in lib. That’s not cool, not at all. Additionally to item 1, I suggest to replace ant with maven and add all Teamcity dependencies to public repositories. Or create your own. If you ever know, it’s so convenient to say what you want - and maven just get it. Awesome! And no additional lib/*jars.  Another option is Gradle.
  3. Documentation: if you want developers, you have to update your docs. What would I suggest. Introduction: requirements, where to get plugin template (or sample plugin), how to build (with Idea and from command line), platform specific things should be highlighted. Than there could be several pages, each describing separate technology, or feature. Also, check forum for frequent questions and update docs to eliminated them.


So, that were main topic. Next is unsorted thoughts, but I hope, it will help you.
  • I love REST. Why don’t you use it in plugin development? I saw some classes for Ajax handling - for Jira all ajax call I did with my REST API.
  • OSGi - when developing  plugins for Jira, I can just Shift-F5 and plugin automagically rebuilded and redeployed. Take a look in this direction - this way plugins can be installed/uninstalled without Teamcity restart. Also very handy for plugin development.
  • Want more examples in docs for simple things: how to get current user, hot to store setting for user, how to make ajax call, how to catch error in controller and propagate it to frontend, how to create dialog, how to get jQuery (for those, who didn’t know it’s $j) and much more. Some FAQ and best practices for quick start.
  • Tests - would be cool to have howto on testing. Basic junit tests and something for web testing (Selenium).
  • I18n - neat feature, but not obligatory. Would be nice to replace all hardcoded text values with internalization constants, so translation would be possible. We don’t mind default English interface, but as additional feature if would be nice (Spring should support i18n).



    So, that is more or less I want to say.
    I encourage you to checks Atlassian pages on plugin development documentation. Also, find some time and create simple plugin for Jira/Confluence just to feel difference.
    Sorry, if my post looks negative - it’s not. It is constructive critics :) I don’t know a man in our company (and as a buildmanager I know everyone), who doesn’t like products of Jetbrains - we use TC as CI, our core server programmers use Idea and some uses PyCharm. Your products are really great! All I ask, that we could develop plugins with pleasure :)

If you have any questions, feel free to ask.
Happy holidays!

0
10 comments

Hello Grigory,

First of all, thank you very much for the feedback. Indeed, our plugin development environment needs some love.

To start with (as a part of upcoming 8.0 release) we are creating Maven artifacts for TeamCity API (you can watch/vote for relevant request in our tracker)

You are more than welcome to give it a try. Here is the basic documentation page. Any comments are appreciated.

0
Avatar
Permanently deleted user

Yay! Good start! B-)

Correct me if I'm wrong, but currently only 8.0-SNAPSHOT jars are available? Would be nice to get artifacts at least for 7.x.
Also it would be great, if you could give to users ready-to-use pom.xml: compile, make jar, pack it into zip and deploy to data directory.
Or you can provide this pom.xml with plugin template. For example, in this template everything is ready to use. Would be nice to have same or better functionality with maven.

Looking forward for new improvements :)

0

Grigory,

Publishing correct artifacts for previous releases is a bit tricky and wont fit to 8.0 timeframe.

As to ready-to-use poms, please check maven archetypes section.

E.g., following command will create a ready-to-go Maven project with bare Teamcity plugin:

mvn archetype:generate -DarchetypeRepository=http://repository.jetbrains.com/all -DarchetypeArtifactId=teamcity-plugin -DarchetypeGroupId=org.jetbrains.teamcity.archetypes -DarchetypeVersion=8.0-SNAPSHOT

0
Avatar
Permanently deleted user

Ooups, I'm sorry, missed that...

I've tried sample command and it stucked. Just blinking cursor.
Can you check on your side?

grundic@hp-pavilion-dv5:/tmp/teamcity$ mvn archetype:generate -DarchetypeRepository=http://repository.jetbrains.com/all -DarchetypeArtifactId=teamcity-server-plugin -DarchetypeGroupId=org.jetbrains.teamcity.archetypes -DarchetypeVersion=8.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype defined by properties
Downloading: http://repository.jetbrains.com/all/org/jetbrains/teamcity/archetypes/teamcity-server-plugin/8.0-SNAPSHOT/maven-metadata.xml
Downloaded: http://repository.jetbrains.com/all/org/jetbrains/teamcity/archetypes/teamcity-server-plugin/8.0-SNAPSHOT/maven-metadata.xml (778 B at 3.5 KB/sec)

0

my guess is, it is waiting for you to enter the GroupId, isn't it?

Downloaded: http://repository.jetbrains.com/all/org/jetbrains/teamcity/archetypes/teamcity-server-plugin/8.0-SNAPSHOT/maven-metadata.xml (778 B at 5.9 KB/sec)

Define value for property 'groupId':

you need to enter group id, artifact id and version number for your plugin.
0
Avatar
Permanently deleted user

Looks weird: I've copy-pasted exact output from command - there was not any request for user input.
But after printing random text and hitting <Enter> it worked. Strange...

Can you execute the same command and check?

0

That's what I did, actually (and copy-pasted the output as well). Seems to be some maven related problem.

After all, were you able to create a project?

0
Avatar
Permanently deleted user

Yep, I've created project, looks good.

And here is my maven version, just in case:

grundic@hp-pavilion-dv5:~$ mvn --version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
Java home: /opt/jdk1.6.0_33/jre
Default locale: ru_RU, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-41-generic", arch: "amd64", family: "unix"

0

Thank you. I will double check maven behaviour.

0
Avatar
Permanently deleted user

Nikita,
I found a problem, it was on my side. I configured maven output colorizing and this lead to hiding user input.
After disabling it I can see requests to set group id and artifact id.

Sorry.
Hope it would help someone in future.

0

Please sign in to leave a comment.