Esempio n. 1
0
def change_status(issue_id, status):
    handler = GitManager().perform_git_workflow(lambda: IssueHandler())

    if not handler.does_issue_exist(issue_id):
        print("Error: Issue does not exist")
        return

    issue = handler.get_issue_from_issue_id(issue_id)
    original_status = issue.status
    issue.status = status
    handler.store_issue(issue, "edit")
    print(f"Status of {issue.id} changed from '{original_status}' to '{issue.status}'")
Esempio n. 2
0
def edit(args):
    handler = GitManager().perform_git_workflow(lambda: IssueHandler())
    if not handler.does_issue_exist(args.issue):
        print("Error: Issue does not exist")
        return

    issue = handler.get_issue_from_issue_id(args.issue)

    if (issue == None):
        print("There was a problem ")

    print("Issue before editing:")
    handler.display_issue(issue)

    issue.summary = args.summary if args.summary != None else issue.summary
    issue.description = args.description if args.description != None else issue.description
    issue.assignee = GitUser(email=args.assignee) if args.assignee != None else issue.assignee
    issue.reporter = GitUser(email=args.reporter) if args.reporter != None else issue.reporter
    issue.status = args.status if args.status != None else issue.status

    print()
    confirm_operation(issue, lambda: handler.store_issue(issue, "edit"))
Esempio n. 3
0
 def operation():
     handler = GitManager().perform_git_workflow(lambda: IssueHandler())
     new_issue = handler.store_issue(issue, "creation", True, True)
     print(f"ID of newly created issue: {new_issue.id}")