How to use the watchtower.commits_.update_commits function in watchtower

To help you get started, we’ve selected a few watchtower examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github docathon / docathon / src / watchtower / update_project_database.py View on Github external
projects = pd.read_csv(args.filename)
# Pull user/project info
columns = ['Github organization and project (if applicable)', 'branch']
projects = projects[columns].values
# Remove missing projects
projects = [ii.split('/') + [br] for ii, br in projects if isinstance(ii, str)]
# Remove non GH projects
projects = [ii for ii in projects if len(ii) == 3]

# Iterate projects and retrieve its latest info
print('Updating commits for %s projects' % len(projects))
exceptions = []
for user, project, branch in projects:
    try:
        branch = None if isinstance(branch, float) else branch
        commits_.update_commits(user, project, auth,
                                since=since, branch=branch)
        issues_.update_issues(user, project, auth,
                              since=since, state='all')
    except Exception as e:
        exceptions.append(project)

print('Finished updating commits.\nFailed for: {}'.format(exceptions))