Skip to content
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

ChangeSet not have value #250

Open
ChenAdminChen opened this issue Jul 5, 2022 · 4 comments
Open

ChangeSet not have value #250

ChenAdminChen opened this issue Jul 5, 2022 · 4 comments
Assignees
Labels

Comments

@ChenAdminChen
Copy link

ChenAdminChen commented Jul 5, 2022

jenkins version: Jenkins 2.357

I use java code, not have changeSet information

JenkinsClient client = JenkinsClient.builder()
                .endPoint("http://127.0.0.1:8080") // Optional. Defaults to http://127.0.0.1:8080
                .credentials("admin:admin") // Optional.
                .build();

        JobsApi jobsApi = client.api().jobsApi();

        BuildInfo buildInfo = jobsApi.buildInfo(null, "test", 36);
        System.out.println(buildInfo);
// buildInfo.changeSets is 0

I use rest api , have changeSet information

curl http://127.0.0.1:8080/job/test/36/api/json

result:
{
.......
"changeSet": {
"_class": "hudson.scm.SubversionChangeLogSet",
"items": [
{
"_class": "hudson.scm.SubversionChangeLogSet$LogEntry",
"affectedPaths": [
"test/src/main/resources/application-dev.yml"
],
"author": {
"absoluteUrl": "http://127.0.0.1:8080/user/admin",
"fullName": "admin"
},
"commitId": "450",
"timestamp": 1655719517084,
"date": "2022-06-20T10:05:17.084449Z",
"msg": "+ 调整redis database",
"paths": [....],
.......
},

@cdancy
Copy link
Owner

cdancy commented Jul 6, 2022

@ChenAdminChen have a look at THIS CODE and see if that works out for you.

@ChenAdminChen
Copy link
Author

I

@ChenAdminChen have a look at THIS CODE and see if that works out for you.

I found out the cause of the problem, the http://127.0.0.1:8080/job/test/36/api/json API return changeSet but not changeSets, and the changeSet is Object but not List Conllection

I pull code and adjust the code, is ok
image

I use jenkins version is 2.357, I don't know if it's a version problem???

@dongxishaonian
Copy link

i have the same problem , and i found it call "changeSet" in FreeStyleProject and call "changeSets" in WorkflowJob.
maybe it should be become the same

@cdancy
Copy link
Owner

cdancy commented Jan 12, 2023

If someone would like to send in a PR for this quickfix I'd be more than happy to merge it and kick a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants