Closed solevic closed 7 years ago
Here's some insight on how we could proceed to rebuild the ChangeSet
https://stackoverflow.com/questions/31247149/get-changeset-function-from-run-class-jenkins
@solevic seems like this is the only way to get changelog from Run
. HockeyApp plugin does it too.
@egor-n I tried adding the described method to the code, but my pipeline job is not an instance of AbstractProject so I cannot get the changeSet of my last build.
Here are the super types of my job.
Job test-fabric is not AbstractProject class org.jenkinsci.plugins.workflow.job.WorkflowJob class hudson.model.Job class hudson.model.AbstractItem class hudson.model.Actionable class hudson.model.AbstractModelObject class java.lang.Object
EDIT: Oh well, the git checkout process is being done in my jenkinsFile, that might be why it's not being recognized as an AbstractProject. The method should work fine if you checkout your repository through the jenkins VCS plugin.
I'll add the code to the PR.
Ok it's done, you might want to squash these nasty commits though.
Looks fine to me – can you add a "Pipeline usage" section to the readme file?
@solevic the pipeline snippet generator doesn't want to generate the step. Instead, it outputs step <object of type fabric.beta.publisher.FabricBetaPublisher>
. Can you take a look at this? If it's a simple fix, then we might want to include it into this PR.
Here's the exception I get:
WARNING: failed to uncoerce fabric.beta.publisher.FabricBetaPublisher@2c538f4
java.lang.UnsupportedOperationException: no public field ‘releaseNotesType’ (or getter method) found in class fabric.beta.publisher.FabricBetaPublisher
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.inspect(DescribableHelper.java:749)
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.inspect(DescribableHelper.java:674)
Also, do we have to build.setResult(Result.FAILURE)
if we encounter any exceptions? Right now, it seems like if uploading fails then the build is still marked as SUCCESS.
@egor-n The pipeline snippet generator bug is fixed. I also added the build result state in case of upload failure.
I'm not sure quite sure what to add to the README, could you take care of that part?
Thank you!
Hi @egor-n and @solevic!
Could you please give us a short description on how to use the plugin on pipeline scripts?
Enables support for plugin jenkinsFile usage.
TODO: We need to find a way to get or generate the changelog through Run instead of AbstractBuild.