-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate support in 1.2.0 for TeamCity 9.1 #156
Comments
@Nachiket26, lets deal with 9.1.x related issues on this ticket. |
Hi @Nachiket26 Can you please confirm which version of Java you are using with TC9? |
Yes, sure @netwolfuk |
ok, great thanks. I didn't want to have to backport to Java 7 :-) |
I've checked out and built and deployed every commit between 1.1.x.x and v1.20.alpha3. The problem was introduced in commit d89344c There is a lot to work through in that commit. The obvious one being the TeamCity version, changed from 9.1 to 10.0 Hopefully I'll get some more time over the weekend to go over the changes in that commit and find the issue. |
Thank you very much @netwolfuk for the debugging. Please let me know if I can be of any help. |
Note to self:
|
I have found the bug. I found I still had the old branch on my home computer, which has been squashed into commit d89344c. It consisted of 27 separate commits. I went though each one, checked out the point in the git history, ran the build, deployed the plugin and restarted TC9. Fortunately TC9 restarts really fast, since it's still on the old Tomcat version. I have literally restarted TeamCity 27 times this weekend! LOL. TeamCity 9 restarts faster than the build takes to run. I had to convert a Java8 stream to a Java 7 For loop, since it's not compatible with TC9. This issue is that for TC9, the TeamCity REST API uses Jersey 1.16, and asm 3.1. ASM 3.1, only supports Java7, so we can't use Java8 streams and such in the REST API if we want to support TeamCity 9. It appears that since TC10, Jetbrains have moved to using Jersey 1.19, and a newer version of ASM which supports Java 8. This is why this was never seen on TC10 and above. I eventually found this question on StackOverFlow, which helped me track down which file in the problematic commit was causing the issue. I'll link a build for you to try ASAP. |
Hi @Nachiket26 Can you please test a build from here (just login as a guest). The builds from today fix three issues: #156, #157 and also the bug we talked about with the webhooks not displaying in the Project Config page. |
Hi @netwolfuk , I can confirm that with build #367 I could configure the webhook plugin for TC 9.1, change the template to Velocity template, verify that the pages open correctly and define and use macros. Thanks a lot for all your efforts. Please let me know if I can pick up this build to configure on my prod TC or you will be publishing officially on this repo. There is a minor thing though. For the earlier builds, I used to get the value of unresolved json paths as "UNRESOLVED". I get a very specific error : Is that an intentional change introduced? It is useful but then it becomes mandatory to keep an eye on TC events / logs for webhook events. Thanks again. |
Hi @Nachiket26 thanks for taking the time to test it out for me. With regards to the 'UNRESOLVED', it's a bit different because in Velocity it's useful to have a null returned to the template engine to make a conditional decision. However I must admit this is poorly communicated. I need to update the wiki page about velocity templates. Feel free to add it if you get a chance. It would be easy to write a macro to null check the string and return 'UNRESOLVED'. However it's something useful, so I'll write it into the engine and try to get you another build to try by tomorrow. |
It'll be something like |
Hi @Nachiket26 I have added a Velocity utility called
The Example usage:
Example output:
|
@netwolfuk , could this be tried on build #368 or should I wait for tcWebHooksPlugin 1.2.0-alpha.6? |
Yes, please try it on 368. If your don't find any other showstoppers, I'll probably release that exact build as alpha 6. |
368 looks perfect. Thank you very much @netwolfuk |
Sorry a minor query, within the macro - I can define the whether to use a newline, comma or something as a separator, right? #foreach( $change in $mychanges ) seems to be taking /n (new-line) as a separator, so asking to confirm. Thanks. |
oh, I'm not sure. Do you have a reference to the docs where it says that? This is what I am building for slack with changes....
|
@netwolfuk , Sorry, I did not get a chance to do it today. I'll get back to you tomorrow. Thanks. |
Hi @netwolfuk , Sorry for the delay in response. When I am using the following in the changes (just to add a comma after the commit :: committer pair)
I get the following in the preview template for the commit :: committers
Now, I am not sure what that "\n" is coming from - which I think will add a line in the slack output. Could you please check on this? |
Is that all one line in the template? |
No it is as follows : Define macro called "showchanges"#macro( showchanges $mychanges ) |
It's pretty yucky to read, but you can actually remove the new lines like this... #if($first)#set($first = false)#else,#end That might fix it |
There is also some built in loop variables to know if you're the first iteration. |
ok, Thanks @netwolfuk - It does get resolved :-) Thanks for all your help. Are you going to make release soon with 368 as alpha 6? |
It seems that variables like velocityCount, etc are deprecated in 2.0. I tried an example it caused a error - so I thought I would stick to this logic. |
Great. I'm not 100% keen on how whitespace it handled, and will look into it in further alphas. But yes, if you're happy I'll release this build (368) as alpha 6. |
Yes, all issues are resolved. 👍 |
Oh. I was not aware of that. I think I'm still on 1.7 as that's the latest stable. I should check that though, as I was going to go to 2.2 recently. |
Btw. If you want a project to work on, I'd love editor to be smarter with suggestions for velocity. From memory it's a JavaScript callback to get the suggestions. |
Cool. I'm try to get a release out on the next 6 hours |
Alpha.6 Released |
FYI @Nachiket26 I found the page of differences from Velocity 1.7 to 2.x I'm doing some testing on 2.3, as there are some known issues with velocity prior to that version. |
TeamCity 9.x using Jersey 1.16, and asm 3.1 ASM 3.1, only supports Java7, so we can't use Java8 streams and such in the REST API if we want to support TeamCity 9. It appears that since TC10, Jetbrains have moved to using Jersey 1.19, and a newer version of ASM which supports Java 8. This is why this was never seen on TC10 and above. Fixes #156
Installing the tcWebHooks REST API in version 1.2.0 alpha5 causes the TeamCity REST API to break with the following errors:
Doesn't appear to happen in version 1.1.x.x.
See conversation at the end of #103
The text was updated successfully, but these errors were encountered: