def __init__(self, service, deploy_info, deploy_group, commit, old_commit, git_url): self.sc = get_slack_client() self.service = service self.deploy_info = deploy_info self.deploy_group = deploy_group self.channels = deploy_info.get('slack_channels', []) self.commit = commit self.old_commit = self.lookup_production_deploy_group_sha() or old_commit self.git_url = git_url self.authors = self.get_authors_to_be_notified() self.url_message = self.get_url_message()
def get_slack_client(self) -> SlackClient: return get_slack_client().sc
sc.post(channels=[buttonpress.channel], message=followup_message, thread_ts=buttonpress.thread_ts) action = buttonpress.action blocks = get_slack_blocks_for_initial_deployment( message="New Message", last_action=action, status=f"Taking action on the {action} button", active_button=action, ) buttonpress.update(blocks) if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) sc = get_slack_client() watch_for_slack_webhooks(sc) class TransitionDefinition(TypedDict): trigger: str source: str dest: str class DeploymentProcess(abc.ABC): if TYPE_CHECKING: # These attributes need to be defined in this `if TYPE_CHECKING` block, because if they exist at runtime then # transitions will refuse to overwrite them. state: str