Exemplo n.º 1
0
def post_task_instructions():
    lines = [
        actionable('Note on Using "compiledb":'),
        '    A Clang JSON Compilation Database (compiledb) can be generated for the mongo repository by running',
        '', '    `ninja compiledb` (from the mongo repo at ~/mongodb/mongo)',
        '',
        '    It enables features like jump to definition and semantic code completion in code editors. Please refer',
        '    to the following web page on how to integrate compiledb with your favorite editor',
        '',
        '    https://sarcasm.github.io/notes/dev/compilation-database.html#text-editors-and-ides',
        '',
        '    When you switch branches or add/remove files, compiledb needs to be updated by running `ninja compiledb`',
        '',
        '    If you\'d like to use an editor that "just works", The CLion IDE is a good option. You just need',
        '    to install it and open the "mongo" directory. Code completion and jumping to definitions will',
        '    automatically work', '',
        '    To install CLion, run: `brew cask install clion`'
    ]

    log_multiline(get_logger().info, lines)
Exemplo n.º 2
0
def ship(ctx):
    """
    Step 5: Provide instructions on pushing your changes to master

    Also add the URL of the latest patch build to the Jira ticket.
    """
    helpers.check_mongo_repo_root()
    ticket_conf = helpers.get_ticket_conf(ctx)
    cur_branch = git.cur_branch_name(ctx)

    if ticket_conf.patch_ids:
        jira.add_comment(
            cur_branch.upper(),
            f'Patch Build: {urllib.parse.urljoin(config.EVG_PATCH_URL_BASE, ticket_conf.patch_ids[-1])}',
            visibility={'type': 'role', 'value': 'Developers'}
        )
    else:
        get_logger().warning('No patch builds were created for this ticket, not adding patch build URL to Jira')

    # This will implicitly check for uncommitted changes on the feature branch
    git.refresh_repos(ctx, ticket_conf.base_branch)

    lines = [
        actionable('Please run the following commands to push your changes to the upstream MongoDB repository:'),
        '',
        f'    git rebase --interactive {ticket_conf.base_branch}',
        f'    git checkout {ticket_conf.base_branch}',
        f'    git merge --ff-only {cur_branch}',
        f'    git push origin {ticket_conf.base_branch} --dry-run',
        f'    git push origin {ticket_conf.base_branch}',
        '',
        'As part of `git rebase --interactive`, you should squash your local commits into one commit. Please refer to',
        'this guide for an intro to interactive rebase: https://git-scm.com/docs/git-rebase#_interactive_mode',
        '',
        'If you encounter errors during any of the above steps, please ask your mentor for advice.',
        '',
        'Finally, when you\'ve pushed your changes, run `workflow zzz` to delete your local branches'
    ]
    log.log_multiline(get_logger().info, lines)