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

Jenkins build response data has 'changeSets' as a list, but build.get_changeset_items() is expecting a dict #748

Closed
decimalst opened this issue Nov 8, 2019 · 1 comment · May be fixed by #850
Labels
stale Issues not active for more than 30 days

Comments

@decimalst
Copy link

ISSUE TYPE

Bug Report

Jenkinsapi VERSION

  • 0.3.10

Jenkins VERSION

  • 2.150.3

SUMMARY

Jenkins API is returning
Experiencing an issue while attempting to use the get_changeset_items() method.
The relevant lines are here:

elif 'changeSets' in self._data:
if 'items' in self._data['changeSets']:
return self._data['changeSets']['items']

It appears that self._data['changeSets'] is a list rather than a dict, so checking if 'items' is in it will not return true.

EXPECTED RESULTS

I'd expect that the method would return the changeset items for the build.

ACTUAL RESULTS

An empty list is returned.

USEFUL INFORMATION

Picture of type returned in the build._data:
Screen Shot 2019-11-08 at 2 58 54 PM

@decimalst decimalst changed the title Jenkins response body has 'changeSets' as a list, causing get_changeset_items() to return nothing Jenkins response body has 'changeSets' as a list, but get_changeset_items() is expecting a dict Nov 8, 2019
@decimalst decimalst changed the title Jenkins response body has 'changeSets' as a list, but get_changeset_items() is expecting a dict Jenkins build response data has 'changeSets' as a list, but build.get_changeset_items() is expecting a dict Nov 8, 2019
@stale
Copy link

stale bot commented Jan 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues not active for more than 30 days label Jan 7, 2020
kaltsi added a commit to kaltsi/jenkinsapi that referenced this issue Dec 9, 2023
Fixes pycontribs#748

Jenkins pipeline build returns a list of changesets instead of a
single changeset dict.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues not active for more than 30 days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant