Skip to content

Releases: tcplugins/tcWebHooks

tcWebHooksPlugin 1.1-alpha18.241.356

01 Sep 12:19
Compare
Choose a tag to compare
Pre-release

Bugfix release to address changes in TeamCity 2018.1.2.

A change in the TeamCity REST API (removal of a class) caused the tcWebHooks REST API plugin to interfere with the TeamCity REST API plugin.

In recent versions of TeamCity, Jetbrains have started to use the REST API for many of the reqests made to build the UI. Therefore, degradation of the TeamCity REST API actually causes the whole UI to run slowly, and throw errors in the log.

This release contains a fix which re-instates the missing class locally within the plugin. It is a workaround until I can find a better fix for the issue.

If you have updated to TeamCity 2018.1.2, and are using the tcWebHook REST API plugin, I would strongly recommend updating to this release.

More details on TeamCity bug tracker issue TW-56626 and issue #112 raised against tcWebHooks.

tcWebHooksPlugin 1.1-alpha17.235.354

21 Jul 03:37
Compare
Choose a tag to compare
Pre-release

This release focuses on previewing and executing webhooks whilst editing a WebHook Template

Preview and Test Template changes
This release adds the ability to preview a template as it is being edited. No need to save the template, and run a build to test a template change. Just click "Preview Template" and select a build from the history and your edits will be previewed.
Then to execute that webhook, choose an existing webhook config, or enter a URL and click "Send Test Webhook for Build Event"

Features

  • Add ability to preview WebHook Template edits (issue #79)
  • Add ability to execute a webhook whilst editing a WebHook Template (issue #79)
  • Added WebHook listing to REST API (required for above)
  • Added ${branch} as a WebHook Template variable. This returns a JSON object containing branch information

Bug fixes

  • ${changes} and ${branch} objects are serialised to JSON correctly in a webhook template (issue #98)
  • Required field "Rank" is now indicated as required on WebHook Template edit dialog (issue #99)
  • Fixed nested scrolling div issue on Endpoint page.
  • Re-ordered template variables on Template edit page, as they were illogical.

I am hoping this will be the last alpha. There are two stories left on milestone 1.1, and I expect the next release to be release candidate 1.

tcWebHooksPlugin 1.1-alpha16.223.329

17 Apr 00:11
Compare
Choose a tag to compare
Pre-release

tcWebHooks Alpha16 adds some more features to tcWebHooks and makes some changes to the REST API.

Features

Changes

  • REST API : Breaking change when using PUT to update Template at /app/rest/webhooks/templates/id:templateId. PUT now replaces the whole template. Previously it would just patch the meta data (which is not how PUT is supposed to work).
    To update the meta-data for a template, now POST to /app/rest/webhooks/templates/id:templateId/patch
  • REST API : When requesting a template with GET /app/rest/webhooks/templates/id:templateId?fields=$long the response no longer includes the webUrl and editable fields. To include those on the response, pass fields=$long,webUrl,editable

The two changes above simplify the export of a WebHook Template. For more information about importing and exporting Templates, see the new tcWebHooksTemplates project.

tcWebHooksPlugin 1.1-alpha15.216.313

14 Jan 01:23
Compare
Choose a tag to compare
Pre-release

Bug fix release alpha15

Issues Resolved

  • Bug: Set content-type correctly to UTF-8 - issue #92
  • Performance: Webhooks edit page is slow to load on project with many builds - issue #81
  • UX: Show history items on WebHooks tab for project and buildType - issue #80
  • UX: Provide links to /webhooks/templates.html from relevant places - issue #87
  • UX: Inform user if template is not found when editing - issue #90
  • UX: Fix scrolling on webhook edit dialog box when many builds are shown.

Other items

Added more links to documentation, and added some template info on the admin tab.

tcWebHooksPlugin 1.1-alpha14.214.303

08 Jan 07:52
Compare
Choose a tag to compare
Pre-release

This release is another alpha and is primarily a bugfix release fixing two issues and a regression.
It also includes a more enhanced History view to monitor webhook activity.

  1. REST API plugin fixes for those running TeamCity on Windows.
  2. Major HttpClient upgrade to resolve compatibility issues with Discord.
  3. Reapply PR #25 (regression)

Bug Fixes

REST API on Windows

In alpha13, The REST API plugin would not start on windows and the Jar Cleaner tool is not successful on Windows hosts due to file locking issues.
This release (alpha 14) fixes the REST plugin startup issue (thanks @Hakon) and provides better feedback for when the jaxb jars cannot be removed due to file locking on windows (thanks @padawahn)

HttpClient upgrade

HttpClient is the library on which WebHooks is based. It is responsible for actually making the WebHook POST request and handling message content, authentication, proxying, etc.
This release migrates from HttpClient 3.x to 4.5.4. This resolves an issue with webhook requests to Discord being denied.
Please raise an issue if you see connectivity problems or unexpected behaviour with tcWebHooks POSTing to endpoints which previously worked using the old 3.x library.

Reapply PR #25 (regression)

Somehow this was lost in the move from 0.9 to 1.1

New Features

WebHook reporting is now available in the TeamCity admin section on the WebHooks tab and more at /webhooks/history.html?view=errors. It's also possible to view all, ok and skipped webhooks in the history. Just click the relevant number in the boxes at the top.
Up to the last 10,000 webhook executions are stored in memory in TeamCity. These are discarded on TeamCity restart.

The history page is available for any user to view. However, if a user is not granted the Project Edit role on the project that triggered the webhook, then the URL is partially hidden so as not to reveal API keys etc. See screenshot below.

image

tcWebHooksPlugin 1.1-alpha13.203.278

06 Dec 04:14
Compare
Choose a tag to compare
Pre-release

This release will be the last 1.1 Alpha. The next will be 1.1 RC1 with a view to releasing 1.1 soon!

New Features

  • Add support for ${capitalise()}, ${capitalize()} and ${substr()} to webhook and template "macros".

Issues Resolved

  • #77 Templates can now be edited in TeamCity 9 (tested on 9.1.7)
  • #13 New and improved Slack templates.

The updated WebHook Templates for Slack take advantage of the ${capitalise()} and ${substr()} macros.

Slack WebHook Template example

The following is an example message sent by the updated Slack template:

image

Slack Compact WebHook Template example

The following is an example message sent by the updated Slack Compact template:

image

Changes and other clean-up

  • Updated icon locations for flowdock template.
  • Remove old and unused templates. All bundled templates should now be XML based.
  • Support only one template in an XML template config.

Previously XML based bundled templates had the <webhook-template> xml element wrapped inside an outer <webhook-templates> element. This is superfluous. Bundled templates will only ever include a single template. This is an internal change and will not affect any users.
However, this change means that the output from /app/rest/webhooks/templates/id:abc/rawConfig is suitable for insertion straight into a new template rather than having to wrap it in a superfluous tag.

Examples of using the capitalise, capitalize and substr macros

  • ${substr(build.vcs.number,0,7,32)} turns 3b0a11eda029aaeb349993cb070a1c2e5987906c into 3b0a11e. This takes chars from 0 to 7 but only because the string is 32 chars in length or greater. In this exmaple, any string passed to substr which is less than 32 chars will not be changed.
  • ${capitalise(string)} turns we are all lowercase into We Are All Lowercase by capitalising the first letter of each word.
  • ${capitalize(string)} is the same as above, but in American rather than English ;-)

tcWebHooksPlugin 1.1-alpha12.192.263

30 Nov 11:26
Compare
Choose a tag to compare
Pre-release

This release greatly improves error handling for failed webhooks and adds a new Admin Tab for WebHooks.

Error Handling improvements

I found in testing that there is a method that loops over the configured webhooks and executes them in sequence. However, if one of those webhook executions failed it could - in certain circumstances - prevent any further webhooks from executing for that build event. The error handling has been improved and errors are now logged to the new WebHooks administration tab. The 10,000 most recent log events are stored in memory and are discarded when TeamCity is restarted.

Added new admin tab for WebHooks

There is a new WebHook tab in the Administration section of TeamCity. For this release it shows the most recent 20 failed webhook executions.

Future releases will allow further analysis of failures and other events (skipped, successful) as well as a list of all configured webhooks.

tcWebHooksPlugin 1.1-alpha11.180.231

11 Nov 09:48
Compare
Choose a tag to compare
Pre-release

This is a long awaited release which supports editing of WebHook Templates in the UI.

Note: XML Schema changes. Please backup your BuildServer/config/webhook-templates.xml (if it exists).

New Features

  • REST API for Template management
  • Editing of WebHook Templates within the UI (which makes use of the REST API)
  • WebHooks REST API section added to the TeamCity Administration pages
  • Tool for working around issue #43 (removes offending jars from teamCity REST API plugin).

Changes

There are two schema changes in the webhook-template.xml file. If you have defined your own templates, they should automatically be upgraded to the new format. It would pay to backup your BuildServer/config/webhook-templates.xml if you have defined your own WebHook Templates.

  1. WebHook Templates can now only support one format
  2. The WebHook name attribute is renamed to id to better reflect its purpose.

The following should be automatically migrated...
From

<webhook-template name="mytemplate" rank="30" enabled="true">
	<formats>
		<format name="jsontemplate" enabled="true" />
	</formats>
       ...
</webhook-template>

To:

<webhook-template id="mytemplate" format="jsontemplate" rank="30" enabled="true">
       ...
</webhook-template>

If multiple formats were listed in the formats element, the first is chosen and migrated into the format attribute.

Please note: WebHook Templates are not the same as Custom Templates. Any defined custom templates are unaffected by this change.

Branch change

This release is based off the long running custom-templates-with-rest-api branch, which has been in development for a couple of years.
It was impossible to merge this branch with the custom-templates branch (the one previous 1.1.x.x versions were released from) due to some major refactoring and my lack of experience with GIT.
I have spent many hours pouring over diffs of the two branches, and believe I have applied all the fixes from recent versions. If you find any regressions, please raise an issue.
I have also renamed the custom-templates-with-rest-api to master and it will be the default branch going forward.

Two plugin files

I have bundled the plugin as two separate files.

  1. tcWebHooksPlugin
  2. tcWebHooksPlugin-REST-API
    The second file is only required for editing and saving the webhook-templates.xml file. Creating webhooks from bundled templates or editing the webhook-template.xml file by hand does not require the REST API.

tcWebHooks REST API

This provides an API for reading and writing WebHook Templates. I plan to extend it to support reading and writing webhook configurations in future releases.

tcWebHooksPlugin 1.1-alpha10.157.147

25 May 13:59
Compare
Choose a tag to compare
Pre-release
  • Bug fix for HTTP time-outs defaulting to infinity. Now set to 120 seconds
    Timeouts can be changed by editing main-config.xml and adding a section similar to the following:
  <webhooks>
	<http-timeout connect="10" response="10" />
  </webhooks>

tcWebHooksPlugin 1.1-alpha9.155.145

16 May 11:33
Compare
Choose a tag to compare
Pre-release

Performance improvements, bug fixes, UI improvements

  • Efficiency improvements when determining build delta information.
    Now retrieves previousNonPersonalBuild by recursively comparing previous builds, rather than retrieving list of all previous builds and working through them until the most recent non-personal build is found.
  • UI improvement when editing authentication settings.
    Fields that are marked required in WebHookAuthenticationParameter are now validated in the UI and an error shown when trying to save the webhook if missing.