-
Notifications
You must be signed in to change notification settings - Fork 28
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
Copy (or move) webhook when build copied (or moved) #10
Comments
Thanks for your comments. Was the webhook configured against:
By that I'm meaning did you customise anything on the builds tab of the webhook ui form? |
Oh. Don't forget to remove the URL of the webhook config if it contains your api key or something sensitive. |
Can you confirm whether the webhook existed in either project after the move? |
Hi, thanks for following up so quickly and for the detailed instructions - they were very helpful in finding the data. The webhook is configured for the specific build, but I'd like to check to make sure I'm using the correct terminology. I can go to my build configuration page and click on the "WebHooks" tab. On this page I see "There are no WebHooks configured for this project." and below I see "There are 1 WebHooks for this specific build." I looked at the old project and the old WebHook is still there. We had to add it to the new project, so I think you have summarized it correctly as "Moving a build does not move the webhook with it. It still exists in the old project." Here's the change in the project plugin settings when we re-added it (it's the same as still exists in the old project):
|
Yes, it looks like we are seeing the same issue. Thanks for raising it. I had not really considered this use case before. I presume I can hook into the the move events so that I am notified when a build is copied or moved by TeamCity. Then I could run some logic to see if the build moved or copied has a specific webhook configured. The question then arises: What should happen when a build is copied or moved and there are webhooks configured for that project.
|
These look promising for build or project moves. Copying might be trickier. class jetbrains.buildServer.serverSide.BuildServerAdapter {
public void projectMoved(@NotNull final SProject project,
@NotNull final SProject originalParentProject) {
}
public void buildTypeMoved(@NotNull final SBuildType buildType,
@NotNull final SProject original) {
}
} |
Yes, those do look promising. If it helps, I don't have a strong use case for copying projects right now; build type moves would be enough for my needs. |
Understood. I just think that when copying a build, one would expect the same behaviour between the two commands. |
Works for me, thank you! |
The ever helpful @pavelsher has replied back. Copy seems "possible" through an internal API call. |
Assuming you're still interested in this, I have been thinking about a few scenarios:
|
We are using tcWebHooks version 0.9.27.61 on TeamCity 9.0.2 build 32915 on several projects; thank you for creating this plugin!
I moved a build configuration from one project to another and noticed that the WebHook was removed after the move. In the TeamCity server log, we see this event confirming success of the move:
[2015-07-27 21:56:39,926] INFO - tbrains.buildServer.ACTIVITIES - "Old Project :: My Build Configuration {id=..., internal id=...}" was moved from "New Project :: My Build Configuration" by "'user' (...) {id=...}"
We later re-added the WebHook to the build configuration and things work as expected.
Do you know of any way to preserve the build configuration's WebHooks when moving to different projects?
The text was updated successfully, but these errors were encountered: