pyjen.changeset module¶
Primitives for interacting with SCM changesets
-
class
pyjen.changeset.Changeset(api, data)[source]¶ Bases:
objectRepresents a set of changes associated with a build of a Jenkins job
See also
- Parameters
api (
/utils/jenkins_api/JenkinsAPI) – Pre-initialized connection to the Jenkins REST APIdata (dict) –
Dictionary of data elements typically parsed from the “changeSet” node of a builds source data as provided by the Jenkins REST API. Should have at least the following keys:
- ’kind’ - string describing the SCM tool associated with this set
of changes.
- ’items’ - list of 0 or more SCM revisions associated with this
change
-
affected_items¶ gets details of the changes associated with the parent build
- Returns
list of 0 or more revisions detailing each change associated with this Changeset
- Return type
listofChangesetItemobjects
-
has_changes¶ Checks whether or not there are any SCM changes
- Returns
True if changes have been found, False if not
- Return type
bool
-
scm_type¶ Gets the name of the SCM tool associated with this change
- Returns
Name of the SCM tool associated with this change
- Return type
str
-
class
pyjen.changeset.ChangesetItem(api, data)[source]¶ Bases:
objectdetails of each SCM revision associated with a given
ChangesetSee also
- Parameters
data (dict) –
Dictionary of attributes describing this revision. Required keys are as follows:
- author:
dictdescribing the Jenkins user who committed this change
- author:
- msg:
strrepresenting the commit messages from the SCM tool associated with this change
- msg:
- commitId:
strrepresenting the revision number of the change provided by the SCM tool
- commitId:
- changes:
listofdictdescribing the files modified by this change
- changes:
-
affected_files¶ Gets a list of files modified in this commit
- Return type
listofstr
- Returns
Person who committed this change to the associated SCM
- Return type
-
commit_id¶ Gets the SCM revision associated with this specific change
- Return type
str
-
message¶ - Returns
SCM commit message associated with this change
- Return type
str