fake-api-server.ci.surveillance.model.config.github¶
This module provides classes and methods for managing and deserializing GitHub-related data structures, including pull requests and their associated information.
GitHubInfo(pull_request)
dataclass
¶
Bases: _BaseModel
Represents GitHub-related information within a system model.
This class encapsulates the GitHub-related information, including details about pull requests. It provides a method to deserialize data from a mapping structure into an instance of the class for further use.
ATTRIBUTE | DESCRIPTION |
---|---|
pull_request |
Encapsulates the details of a GitHub pull request.
TYPE:
|
PullRequestInfo(title=str(), body=str(), draft=False, labels=list(), change_detail=ChangeDetail(), _NO_API_CHANGE_CONTENT='No changes.')
dataclass
¶
Bases: _BaseModel
Represents information related to a pull request, including metadata such as title, body, labels, and draft status, as well as details of the changes it encompasses.
This class encapsulates details of a pull request, such as its title, body description, whether
it be marked as a draft or not, and associated labels. It can be used for creating or processing
pull requests programmatically. The deserialize
method allows reconstructing an instance of this
class from a dictionary-like mapping, supporting specific use cases related to mappings and
configuration items.
ATTRIBUTE | DESCRIPTION |
---|---|
title |
The title of the pull request.
TYPE:
|
body |
The body content of the pull request.
TYPE:
|
draft |
Indicates if the pull request is marked as a draft.
TYPE:
|
labels |
List of labels associated with the pull request.
TYPE:
|
change_detail |
An object containing statistical and summary details of API changes. This property is new in version 0.2.0.
TYPE:
|
default_pr_body()
classmethod
¶
Generates and returns a default pull request body from a file.
This method reads the content of a Markdown file named pr-body.md
located within
a _static
directory inside the surveillance
directory of the project's
file system structure. The _find_surveillance_lib_path
helper function navigates
through the file path hierarchy to locate the surveillance
directory. If the
pr-body.md
file is not found in the expected path, an assertion is raised.
The returned content of the file can be used as a template for pull request bodies.
This function is new in version 0.2.0.
RETURNS | DESCRIPTION |
---|---|
str
|
The content of the |
RAISES | DESCRIPTION |
---|---|
AssertionError
|
If the default pull request body file ( |
Source code in fake_api_server_plugin/ci/surveillance/model/config/github.py
set_change_detail(change_detail)
¶
Updates the body of the content based on the provided change details, altering it to
reflect the statistical changes and API summary. Existing placeholders in the body
are replaced with the relevant information derived from the change_detail
object.
This function is new in version 0.2.0.
PARAMETER | DESCRIPTION |
---|---|
change_detail
|
Contains statistical and summary details of API changes that are used to update the body content.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
None
|
None |