Example #1
0
def query(j, app, conf):
    ops = []
    query_strings = []

    timing_query_f = '"Actual Time" is EMPTY'
    fixversion_f = "fixversion is not EMPTY"
    uncategorized_f = "fixVersion is empty or component is empty"
    project = conf.site.projects
    buckets = conf.buckets.values()

    queries = [
        ("category", "project {0} and resolution = Unresolved and ({1})".format(equality(project), uncategorized_f)),
        (
            "timing",
            "project {0} and fixVersion {1} and resolution = Unresolved and {2} and {3}".format(
                equality(project), inequality(buckets), timing_query_f, fixversion_f
            ),
        ),
        (
            "combined",
            "project {0} and resolution = Unresolved and (( {1} and {2} ) or ({3}))".format(
                equality(project), timing_query_f, fixversion_f, uncategorized_f
            ),
        ),
    ]

    for name, query in queries:
        ops.append(name)
        query_strings.append(query)

        t = app.add("task")
        t.job = j.query
        t.args = [query]
        t.description = "{0} Jira query".format(name)

    app.run()

    return zip(ops, query_strings, app.results)
Example #2
0
def query(j, app, conf):
    ops = []
    query_strings = []

    timing_query_f = '"Actual Time" is EMPTY'
    fixversion_f = "fixversion is not EMPTY"
    uncategorized_f = "fixVersion is empty or component is empty"
    project = conf.site.projects
    buckets = conf.buckets.values()

    queries = {
        "combined": "project {0} and resolution = Unresolved and (( {1} and {2} ) or ({3}))",
        "component": "project {0} and resolution = Unresolved and ({1})",
        "timing": "project {0} and fixVersion {1} and resolution = Unresolved and {2} and {3}",
        "schedule": "project {0} and fixVersion is EMPTY and resolution = Unresolved"
    }

    queries['component'] = queries['component'].format(equality(project), uncategorized_f)
    queries['timing'] = queries['timing'].format(equality(project), inequality(buckets),
                                                 timing_query_f, fixversion_f)
    queries['combined'] = queries['combined'].format(equality(project), timing_query_f,
                                                     fixversion_f, uncategorized_f)
    queries['schedule'] = queries['schedule'].format(equality(project))

    for name, query in queries.items():
        ops.append(name)
        query_strings.append(query)

        t = app.add('task')
        t.job = j.query
        t.args = [query]
        t.description = "{0} Jira query".format(name)

    app.run()

    return zip(ops, query_strings, app.results)
Example #3
0
def query(j, app, conf):
    ops = []
    query_strings = []

    timing_query_f = '"Actual Time" is EMPTY'
    fixversion_f = "fixversion is not EMPTY"
    uncategorized_f = "fixVersion is empty or component is empty"
    project = conf.site.projects
    buckets = conf.buckets.values()

    queries = [
        ('category',
         "project {0} and resolution = Unresolved and ({1})".format(
             equality(project), uncategorized_f)),
        ('timing',
         'project {0} and fixVersion {1} and resolution = Unresolved and {2} and {3}'
         .format(equality(project), inequality(buckets), timing_query_f,
                 fixversion_f)),
        ('combined',
         'project {0} and resolution = Unresolved and (( {1} and {2} ) or ({3}))'
         .format(equality(project), timing_query_f, fixversion_f,
                 uncategorized_f)),
    ]

    for name, query in queries:
        ops.append(name)
        query_strings.append(query)

        t = app.add('task')
        t.job = j.query
        t.args = [query]
        t.description = "{0} Jira query".format(name)

    app.run()

    return zip(ops, query_strings, app.results)
Example #4
0
def query(j, app, conf):
    query_base = "project {0} and fixVersion {1} and status {2}"

    project = conf.site.projects
    sprint = getattr(conf.sprints, conf.runstate.sprint)

    queries = [
        ('total', 'project {0} and fixVersion {1}'.format(equality(project), equality(sprint))),
        ('completed', query_base.format(equality(project), equality(sprint), equality(['Closed', 'Resolved']))),
        ('progressing', query_base.format(equality(project), equality(sprint), equality(['In Code Review', 'In Progress']))),
        ('remaining', query_base.format(equality(project), equality(sprint), equality(['Open', 'Reopened'])))
    ]

    ops = []

    for name, query in queries:
        ops.append(name)
        t = app.add('task')
        t.target = True
        t.job = j.query
        t.args = [query]
        t.description = "{0} Jira query".format(name)

    app.run()

    return dict(zip(ops, app.results))
Example #5
0
def query(j, app, conf):
    query_base = "project {0} and fixVersion {1} and status {2}"

    project = conf.site.projects
    sprint = getattr(conf.sprints, conf.runstate.sprint)

    queries = [
        ('total',
         'project {0} and fixVersion {1}'.format(equality(project),
                                                 equality(sprint))),
        ('completed',
         query_base.format(equality(project), equality(sprint),
                           equality(['Closed', 'Resolved']))),
        ('progressing',
         query_base.format(equality(project), equality(sprint),
                           equality(['In Code Review', 'In Progress']))),
        ('remaining',
         query_base.format(equality(project), equality(sprint),
                           equality(['Open', 'Reopened'])))
    ]

    ops = []

    for name, query in queries:
        ops.append(name)
        t = app.add('task')
        t.target = True
        t.job = j.query
        t.args = [query]
        t.description = "{0} Jira query".format(name)

    app.run()

    return dict(zip(ops, app.results))