pyjen.changeset module

Primitives for interacting with SCM changesets

class pyjen.changeset.Changeset(api, data)[source]

Bases: object

Represents a set of changes associated with a build of a Jenkins job

See also

Build

Parameters
  • api (/utils/jenkins_api/JenkinsAPI) – Pre-initialized connection to the Jenkins REST API

  • data (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

list of ChangesetItem objects

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: object

details of each SCM revision associated with a given Changeset

See also

Changeset

Parameters

data (dict) –

Dictionary of attributes describing this revision. Required keys are as follows:

  • author: dict describing the Jenkins user who committed this

    change

  • msg: str representing the commit messages from the SCM tool

    associated with this change

  • commitId: str representing the revision number of the change

    provided by the SCM tool

  • changes: list of dict describing the files modified

    by this change

affected_files

Gets a list of files modified in this commit

Return type

list of str

author
Returns

Person who committed this change to the associated SCM

Return type

User

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