Open ghost opened 6 years ago
I have a similar problem, build status is updated, but the ticker for successful build is not. Could you share your solution, however inelegant?
It looks like this otherwise very fine plugin has become orphaned as of last year. I'm looking for an alternate solution with post-commit hooks, but stash does not make that easy for our use-case.
My poor solution is to remove the internal "client" object in the StashRepository class and add a "getClient" method that returns a new StashClient() every time it is invoked, and then replace all references to the internal "client" object with an invocation of getClient(). It can be seen here: https://github.com/nemccarthy/stash-pullrequest-builder-plugin/compare/master...vproman:issues/135
FWIW my team just ended up utilizing the old-style jenkins jobs for our PR builder since those still work, it's just pipeline-style jobs that don't work.
This is with an hpi build from the commit https://github.com/nemccarthy/stash-pullrequest-builder-plugin/commit/b2be6792adc2e9e3670189908b09b2331da05d30 manually installed into a jenkins docker container.
The initial build comment is successfully posted, but fails to be deleted once the workflow job completes. I've traced this to the following scenario:
I'm confused as to why StashRespository.client gets finalized before the StashRespository object itself is finalized. I see nowhere where StashRespository is getting set to null, so StashRespository should still have a reference to the client created in the StashRepository.init method, should it not?
I was able to fix this by simply always allocating a new StashApiClient when needed. This is inefficient so I'd much rather understand why the StashApiClient is being garbage collected so soon.