Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions jenkinsapi/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,11 @@ def get_changeset_items(self):
if "items" in self._data["changeSet"]:
return self._data["changeSet"]["items"]
elif "changeSets" in self._data:
if "items" in self._data["changeSets"]:
return self._data["changeSets"]["items"]
changes = []
for change in self._data["changeSets"]:
if "items" in change:
changes += change["items"]
return changes
return []

def _get_vcs(self) -> str:
Expand Down
47 changes: 26 additions & 21 deletions jenkinsapi_tests/unittests/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,32 @@
"artifacts": [],
"building": False,
"builtOn": "localhost",
"changeSets": {
"items": [
{
"affectedPaths": ["content/rcm/v00-rcm-xccdf.xml"],
"author": {
"absoluteUrl": "http://jenkins_url/user/username79",
"fullName": "username",
},
"commitId": "3097",
"timestamp": 1414398423091,
"date": "2014-10-27T08:27:03.091288Z",
"msg": "commit message",
"paths": [
{"editType": "edit", "file": "/some/path/of/changed_file"}
],
"revision": 3097,
"user": "username",
}
],
"kind": None,
},
"changeSets": [
{
"items": [
{
"affectedPaths": ["content/rcm/v00-rcm-xccdf.xml"],
"author": {
"absoluteUrl": "http://jenkins_url/user/username79",
"fullName": "username",
},
"commitId": "3097",
"timestamp": 1414398423091,
"date": "2014-10-27T08:27:03.091288Z",
"msg": "commit message",
"paths": [
{
"editType": "edit",
"file": "/some/path/of/changed_file",
}
],
"revision": 3097,
"user": "username",
}
],
"kind": None,
}
],
"culprits": [],
"description": "Best build ever!",
"duration": 5782,
Expand Down
Loading