def _add_refresh_comment(self, exc: PipenvError, issue: Issue):
        """Create a refresh comment to an issue if the given master has some changes."""
        if self.sha in issue.description:
            _LOGGER.debug(
                "No need to update refresh comment, the issue is up to date")
            return

        for issue_comment in issue.get_comments():
            if self.sha in issue_comment.body:
                _LOGGER.debug(
                    f"No need to update refresh comment, comment for the current "
                    f"master {self.sha[:7]!r} found in a comment")
                break
        else:
            issue.comment(
                ISSUE_COMMENT_UPDATE_ALL.format(
                    sha=self.sha,
                    slug=self.slug,
                    environment_details=self.get_environment_details(),
                    dependency_graph=self.get_dependency_graph(graceful=True),
                    **exc.char_limit_dict(MAX_PIPENV_CMD_LEN),
                ))
Exemple #2
0
 def _advise_issue_is_fresh(self, issue: Issue):
     return not issue.get_comments(author=APP_NAME)