コード例 #1
0
ファイル: project.py プロジェクト: pawelkopka/ogr
 def get_commit_statuses(self, commit: str) -> List[CommitFlag]:
     """
     Get the statuses of a commit in a project.
     :param commit: The SHA of the commit.
     :return: [CommitFlag]
     """
     return GitlabCommitFlag.get(project=self, commit=commit)
コード例 #2
0
ファイル: project.py プロジェクト: pawelkopka/ogr
    def set_commit_status(
        self,
        commit: str,
        state: Union[CommitStatus, str],
        target_url: str,
        description: str,
        context: str,
        trim: bool = False,
    ) -> "CommitFlag":
        """
        Create a status on a commit

        :param commit: The SHA of the commit.
        :param state: The state of the status.
        :param target_url: The target URL to associate with this status.
        :param description: A short description of the status
        :param context: A label to differentiate this status from the status of other systems.
        :param trim: Whether to trim the description to 140 characters
        :return: CommitFlag
        """
        return GitlabCommitFlag.set(
            project=self,
            commit=commit,
            state=state,
            target_url=target_url,
            description=description,
            context=context,
            trim=trim,
        )