tom/dependencies.py
def run(self, branch):
        """Run the dependency update for a branch, creating PR in the end"""
        self.slack.reply("Running dependency updates for " + branch)
        # prepare repo
        repo_name = 'buildscripts'
        upstream_name = 'cfengine'
        local_path = "../" + repo_name
        self.buildscripts = GitRepo(local_path, repo_name, upstream_name, self.username, branch)
        timestamp = re.sub('[^0-9-]', '_', str(datetime.datetime.today()))
        new_branchname = '{}-deps-{}'.format(branch, timestamp)
        self.buildscripts.checkout(new_branchname, True)
        self.readme_file_path = 'deps-packaging/README.md'
        readme_file = self.buildscripts.get_file(self.readme_file_path)
        self.readme_lines = readme_file.split('\n')
        self.monitoring_file_path = 'deps-packaging/release-monitoring.json'
        self.monitoring_ids = json.loads(self.buildscripts.get_file(self.monitoring_file_path))
        updates_summary = []
        only_deps = self.get_deps_list(branch)
        for dep in only_deps:
            single_result = self.update_single_dep(dep)
            if single_result:
                updates_summary.append(single_result)
                self.slack.reply(single_result)
        if len(updates_summary) == 0:
            self.slack.reply("Dependency checked, nothing to update")
            return
        self.buildscripts.push(new_branchname)
        updates_summary = '\n'.join(updates_summary)
        pr_text = self.github.create_pr(
            target_repo='{}/{}'.format(upstream_name, repo_name),
            target_branch=branch,
            source_user=self.username,
            source_branch=new_branchname,
            title='Dependency updates for ' + branch,
            text=updates_summary)
        self.slack.reply("Dependency updates:\n```\n{}\n```\n{}".format(updates_summary, pr_text), True)
Run the dependency update for a branch, creating PR in the end
Run the dependency update for a branch, creating PR in the end
Run the dependency update for a branch creating PR in the end
def run(self, branch):
        self.slack.reply("Running dependency updates for " + branch)
        repo_name = 'buildscripts'
        upstream_name = 'cfengine'
        local_path = "../" + repo_name
        self.buildscripts = GitRepo(local_path, repo_name, upstream_name, self.username, branch)
        timestamp = re.sub('[^0-9-]', '_', str(datetime.datetime.today()))
        new_branchname = '{}-deps-{}'.format(branch, timestamp)
        self.buildscripts.checkout(new_branchname, True)
        self.readme_file_path = 'deps-packaging/README.md'
        readme_file = self.buildscripts.get_file(self.readme_file_path)
        self.readme_lines = readme_file.split('\n')
        self.monitoring_file_path = 'deps-packaging/release-monitoring.json'
        self.monitoring_ids = json.loads(self.buildscripts.get_file(self.monitoring_file_path))
        updates_summary = []
        only_deps = self.get_deps_list(branch)
        for dep in only_deps:
            single_result = self.update_single_dep(dep)
            if single_result:
                updates_summary.append(single_result)
                self.slack.reply(single_result)
        if len(updates_summary) == 0:
            self.slack.reply("Dependency checked, nothing to update")
            return
        self.buildscripts.push(new_branchname)
        updates_summary = '\n'.join(updates_summary)
        pr_text = self.github.create_pr(
            target_repo='{}/{}'.format(upstream_name, repo_name),
            target_branch=branch,
            source_user=self.username,
            source_branch=new_branchname,
            title='Dependency updates for ' + branch,
            text=updates_summary)
        self.slack.reply("Dependency updates:\n```\n{}\n```\n{}".format(updates_summary, pr_text), True)
def run ( self , branch ) : self . slack . reply ( "Running dependency updates for " + branch ) repo_name = 'buildscripts' upstream_name = 'cfengine' local_path = "../" + repo_name self . buildscripts = GitRepo ( local_path , repo_name , upstream_name , self . username , branch ) timestamp = re . sub ( '[^0-9-]' , '_' , str ( datetime . datetime . today ( ) ) ) new_branchname = '{}-deps-{}' . format ( branch , timestamp ) self . buildscripts . checkout ( new_branchname , True ) self . readme_file_path = 'deps-packaging/README.md' readme_file = self . buildscripts . get_file ( self . readme_file_path ) self . readme_lines = readme_file . split ( '\n' ) self . monitoring_file_path = 'deps-packaging/release-monitoring.json' self . monitoring_ids = json . loads ( self . buildscripts . get_file ( self . monitoring_file_path ) ) updates_summary = [ ] only_deps = self . get_deps_list ( branch ) for dep in only_deps : single_result = self . update_single_dep ( dep ) if single_result : updates_summary . append ( single_result ) self . slack . reply ( single_result ) if len ( updates_summary ) == 0 : self . slack . reply ( "Dependency checked, nothing to update" ) return self . buildscripts . push ( new_branchname ) updates_summary = '\n' . join ( updates_summary ) pr_text = self . github . create_pr ( target_repo = '{}/{}' . format ( upstream_name , repo_name ) , target_branch = branch , source_user = self . username , source_branch = new_branchname , title = 'Dependency updates for ' + branch , text = updates_summary ) self . slack . reply ( "Dependency updates:\n```\n{}\n```\n{}" . format ( updates_summary , pr_text ) , True )
Run the dependency update for a branch, creating PR in the end
Run the dependency update for a branch creating PR in the end
"""Run the dependency update for a branch, creating PR in the end""" # prepare repo
self
branch