示例#1
0
    successes = 0
    failures = 0

    for sfArtifact in sfArtifacts:
        ghArtifact = conversionFunction(sfArtifact)

        print("Adding " + githubName + " " + ghArtifact['title'] + "...")
        response = requests.post(
            'https://api.github.com/repos/' + args.repo + '/' + githubName,
            data=json.dumps(ghArtifact),
            auth=auth)

        if response.status_code == 201:
            successes += 1
        else:
            print(str(response.status_code) + ": " + response.json()['message'])
            failures += 1

    total = successes + failures
    print(githubName + ": " + str(total) + " Success: " + str(successes)
        + " Failure: " + str(failures))

collaborators = getCollaborators(auth, args.repo)

createGitHubArtifact(export['milestones'], "milestones", milestone.sf2github)
tickets = sorted(export['tickets'], key=lambda t: t['ticket_num'])
createGitHubArtifact(tickets, "issues", issue.sf2github)
prefix = getPrefix(export)
issue.updateAllIssues(auth, args.repo, export, not args.no_id_in_title, collaborators, prefix)
示例#2
0
    print("-----------------")
    print(githubName.upper())
    print("-----------------")

    successes = 0
    failures = 0

    for sfArtifact in sfArtifacts:
        ghArtifact = conversionFunction(sfArtifact)

        print("Adding " + githubName + " " + ghArtifact['title'] + "...")
        response = requests.post(
            'https://api.github.com/repos/' + args.repo + '/' + githubName,
            data=json.dumps(ghArtifact),
            auth=auth)

        if response.status_code == 201:
            successes += 1
        else:
            print(str(response.status_code) + ": " + response.json()['message'])
            failures += 1

    total = successes + failures
    print(githubName + ": " + str(total) + " Success: " + str(successes)
        + " Failure: " + str(failures))

createGitHubArtifact(export['milestones'], "milestones", milestone.sf2github)
tickets = sorted(export['tickets'], key=lambda t: t['ticket_num'])
createGitHubArtifact(tickets, "issues", issue.sf2github)
issue.updateAllIssues(auth, args.repo, export, not args.no_id_in_title)
示例#3
0
        if response.status_code == 201:
            successes += 1
        else:
            print(
                str(response.status_code) + ": " + response.json()['message'])
            failures += 1
        # sleep(sleeptime)

    total = successes + failures
    print(githubName + ": " + str(total) + " Success: " + str(successes) +
          " Failure: " + str(failures))


collaborators = getCollaborators(auth, args.repo)
# sleep(sleeptime)

if not args.skipmilestone:
    createGitHubArtifact(export['milestones'], "milestones",
                         milestone.sf2github)

tickets = sorted(export['tickets'], key=lambda t: t['ticket_num'])

if not args.skipissuecreation:
    createGitHubArtifact(tickets, "issues", issue.sf2github)
    sleep(minisleep)

prefix = getPrefix(export)
issue.updateAllIssues(auth, args.repo, export, not args.no_id_in_title,
                      collaborators, prefix)