Example #1
0
 def run_args(cls, config, args):
     releases = git_util.get_releases(args.repo_path, config)
     pairs = zip(releases[0:-1], releases[1:])
     for from_tag, to_tag in pairs:
         if args.release is not None and to_tag != args.release:
             continue
         print_header('{} -> {}'.format(from_tag, to_tag))
         summaries = git_util.get_release_notes(args.repo_path, from_tag,
                                                to_tag)
         for summary in summaries:
             sys.stdout.write(summary)
             sys.stdout.write('\n')
Example #2
0
    def run_args(cls, config, args):
        import jira
        jira_client = jira_util.get_jira(**config.jira.auth)
        releases = git_util.get_releases(args.repo_path, config)
        pairs = zip(releases[0:-1], releases[1:])
        if args.url:
            wrapper = textwrap.TextWrapper(width=80,
                                           initial_indent=' ' * 4,
                                           subsequent_indent=' ' * 4)
        else:
            wrapper = textwrap.TextWrapper(width=80,
                                           initial_indent='',
                                           subsequent_indent=' ' * 11)

        for from_tag, to_tag in pairs:
            if args.release is not None and to_tag != args.release:
                continue
            print_header('{} -> {}'.format(from_tag, to_tag))
            sys.stdout.write('\n')
            issues = git_util.get_issues_closed_in_series(
                args.repo_path, from_tag, to_tag, config.gerrit_jira.tag_map)
            summaries = git_util.get_release_notes(args.repo_path, from_tag,
                                                   to_tag)

            for issue in issues:
                try:
                    issue_obj = jira_client.issue(issue, 'summary')
                except jira.JIRAError:
                    sys.stdout.write('{}: N/A\n'.format(issue))
                    continue

                if args.url:
                    sys.stdout.write('{}/browse/{}\n'.format(
                        config.jira.auth['url'], issue))
                    sys.stdout.write(wrapper.fill(issue_obj.fields.summary))
                    sys.stdout.write('\n')
                else:
                    text = wrapper.fill('{}: {}'.format(
                        issue, issue_obj.fields.summary))
                    sys.stdout.write(text)
                    sys.stdout.write('\n')

            if issues and summaries:
                sys.stdout.write('\n')

            for summary in summaries:
                sys.stdout.write(summary)
                sys.stdout.write('\n')
Example #3
0
    def run_args(cls, config, args):
        import jira
        jira_client = jira_util.get_jira(**config.jira.auth)
        releases = git_util.get_releases(args.repo_path, config)
        pairs = zip(releases[0:-1], releases[1:])

        for from_tag, to_tag in pairs:
            if args.release is not None and to_tag != args.release:
                continue

            print_header('{} -> {}'.format(from_tag, to_tag))
            issues = git_util.get_issues_closed_in_series(
                args.repo_path, from_tag, to_tag, config.gerrit_jira.tag_map)
            for issue in issues:
                try:
                    issue_obj = jira_client.issue(
                        issue, config.jira.fixed_release_field)
                    issue_obj.update(
                        fields={config.jira.fixed_release_field: to_tag})
                    sys.stdout.write('  {}: {}\n'.format(issue, to_tag))
                except jira.JIRAError:
                    sys.stdout.write(
                        '  {}: failed (non-existant?)\n'.format(issue))
                    continue
Example #4
0
 def run_args(cls, config, args):
     for version in git_util.get_releases(args.repo_path, config):
         sys.stdout.write(version)
         sys.stdout.write('\n')