Closed matt-richardson closed 5 months ago
I thought there might be some other bit that needed work. I'll take a look later in the week.
BTW, this should work (I am using Java 8).
mvn test package
From what I can tell - these are to do with test setup. I didn't get very far with debugging though.
From what I can tell - these are to do with test setup. I didn't get very far with debugging though.
ah, ok. I'll pull the branch and run it up locally. Not sure when yet.
Just pushed a change - I think it should pass the tests.
(When I run it locally, I get a bunch of test failures similar to java.lang.IllegalStateException: @NotNull method webhook/teamcity/settings/entity/WebHookTemplateEntity.getTemplateDescription must not return null
. Not sure why it's doing that for me, and not you?)
Yep, that's fixed all the core tests. Just the REST api ones failing now. But don't spend time on that, as I am in the middle of migrating all that code to rest-api-legacy project.
I'm unblocked now - I manually modified the id's in the config, and after restarting teamcity, all the webhooks are showing up in the right place.
Now, it's only future project copies that I'm thinking about, but not expecting that to happen too soon, so no rush.
Good luck with the legacy fun :)
I'm really sorry. I didn't realise you were blocked by this. D'oh!
No stress - I was only "blocked" until I found how the code worked, and even then, it wasn't a biggie - if push came to shove, I could've edited the config directly.
I thought I had implemented a partial work around where a "save" of the webhook forces a reload on that project's webhooks, but I still have the code here and it never made it into a release.
This would have allowed you to edit plugin-settings and then create a new webhook would would've fixed the ids in the cache map.
But now we know the actual reason for that issue, so that's a win :-)
I have it compiled and running. Copying a project works, but does not refresh the cache. If I edit and save or create a new webhook, the the old webhooks that were copied over show up. However, the ID is the same and so items in the history will be misleading. Eg, if you click the right most icon in a history page, it will show two webhooks since they have the same ID.
I'll look further into the copy event that Pavel mentioned, and look to do a regenerate of the UniqueId on Project copy.
Closing because this was done as part of #242 and #238
To avoid duplicates when projects are copied.
Fixes https://github.com/tcplugins/tcWebHooks/issues/238.
Note: I haven't tested this, as I'm struggling to compile locally. (I'm also not a java developer, so there's a lot of things that I dont know that I dont know :smile:).