Skip to content

Interact with Gitar Bot

DJ Feature Documentation

Overview

The DJ feature is an extension to the Gitar bot that allows developers to execute custom commands within pull requests. This feature enhances the automated code review process by enabling specific actions to be performed on the codebase.

Supported Commands

Currently, the DJ feature supports the following command:

  • skip-cleanup <variable|keyword>: This command instructs the bot to skip the cleanup process for the specified variable or keyword in the current pull request.

How It Works

  1. When reviewing Gitar’s cleanup pull request, you can leave a comment on a specific line of code.
  2. In your comment, you use the DJ command (e.g., /skip-cleanup) followed by the specific variable or keyword you want to target.
  3. The bot processes the command for that specific variable or keyword in the current pull request.

Usage

To use the DJ feature, follow these steps:

  1. Open a Gitar’s cleanup pull request in review mode.
  2. Navigate to the line containing the variable or keyword you want to skip cleanup for.
  3. Leave a comment on that line with the following format:
@gitar-bot /skip-cleanup <variable|keyword>

Replace <variable|keyword> with the specific single word you want to target.

Example

Let’s say you have the following line in your code:

unused_variable = some_function()

If you want to skip cleanup for unused_variable, you would leave a comment on this line saying:

@gitar-bot /skip-cleanup unused_variable

The bot will then skip the cleanup process for unused_variable in this pull request.

Commits for DJ Commands

Each DJ command transaction will result in a new commit in the pull request. This means:

  1. Every time you successfully use a DJ command, a new commit will be added to the pull request.
  2. You can see the exact changes made by each DJ command by reviewing these commits.
  3. The pull request history will show a clear trail of all DJ commands applied.

Future Enhancements

While currently only the skip-cleanup command is supported and limited to single-word variables or keywords, the architecture is designed to easily accommodate additional DJ commands and more complex targets in the future. This extensibility allows for the addition of more sophisticated automated actions as needed.

Feedback and Support

If you encounter any issues or have suggestions for improving the DJ feature, please contact the Gitar support team or open an issue in the repository.