GitHub App

Summary

GitHub App brings all of the CodeMaker AI code generation features and makes them available in GitHub. This way it is possible to generate code and documentation, edit specific code blocks, or process code review comments.

CodeMaker AI GitHub App

Installation

To install GitHub App follow those steps.

  1. Sign up at https://codemaker.ai and create an account.

  2. Login to your account.

  3. Navigate to the Apps page in the CodeMaker AI Portal.

  4. Click on "Install from GitHub Marketplace".

  5. Install the GitHub App for your Organization or User.

  6. During installation, you will be redirected back to the CodeMaker AI Portal to authorize the application for your account. Click on the "Authorize" button.

GitHub Issues

You can use CodeMaker AI features on any GitHub issue by posting a comment on an open issue and starting it with the @codemakerai.

Assistant

You can use CodeMaker AI Coding Assistant directly from GitHub where it can answer your question by posting comments on the issue.

@codemakerai assistant prompt - the assistant prompt

Commands

@codemakerai help - prints this help message

GitHub Pull Requests

To start using CodeMaker AI, you can create a new pull request which should immediately prompt a help message to appear on the pull request.

Triggering the commands is as simple as posting a comment on an open pull request and starting it with the @codemakerai.

Note that some operations can be time-consuming and that currently, each command will be processed in an eventual consistent manner, to avoid any race condition it is best to post one command at a time.

Assistant

You can use CodeMaker AI Coding Assistant directly from GitHub where it can answer your question by posting comments on the pull request.

@codemakerai assistant prompt - the assistant prompt

Pull Requests Commands

Those commands can be posted as Pull Request comments.

@codemakerai help - prints this help message
@codemakerai review process - process the most recent code review and all it's comments
@codemakerai generate code [codepath] - generate code for all files in pull request, or only for matching code path.
@codemakerai generate docs [codepath] - generate documentation for all files in pull request, or only for matching code path.
@codemakerai replace code [codepath] - replace code for all files in pull request, or only for matching code path.
@codemakerai replace docs [codepath] - replace documentation for all files in pull request, or only for matching code path.
@codemakerai fix syntax - fixes the syntax in all files
@codemakerai commit undo - removes the most recent commit

Note: Square brackets indicate an optional parameter.

Pull Request Code Review Commands

Those commands can be posted as Pull Request Code Review comments on the "Files Changed" tab.

@codemakerai assistant prompt - the assistant prompt
@codemakerai explain - explains the given code
@codemakerai review - reviews the given code

Assistant prompts posted as comments on the pull requests are executed in the context of the given code block. This allows you to ask questions that the assistant will replay in the form of comments on the pull request.

Triggers

By default, CodeMaker AI GitHub App will not take any action unless explicitly requested to do so. To reduce the amount of manual work and triggering commands each time it is possible to relay on GitHub App Webhook events to automatically trigger an action. This feature works with a combination of GitHub Labels. Note that the labels need to be created manually on the repository and added per each use.

CodeMaker AI defines the following labels:

codemakerai-pull-request-generate-documentation Trigger: Pull Request Creation

Triggers automatic comment/documentation generation on every declaration that does not include it. Every existing comment/documentation will remain unchanged.

codemakerai-pull-request-syntax-autocorrection Trigger: Pull Request Creation

Triggers automatic syntax autocorrection. This feature only addresses syntax errors on the code base, if the code is valid no change will be made.

codemakerai-pull-request-review-process Trigger: Code Review Submission

Triggers automatic code review comments processing. Each comment on the supported files will be automatically processed.

Automatically addressing pull request comments

CodeMaker AI can automatically process comments published on a Pull Request code review for all support programming languages source files.

To trigger this operation simply:

  1. Write a comment on a GitHub pull request and click on the "Start a review" button.

  2. Add as many comments as needed.

  3. Once all comments are added click on the "Finish your review" button.

  4. Add a comment `@codemakerai process review` to trigger automatic code review processing of the comments.

Note that GitHub comments are internally associated with a GitHub Code Review and are identified by an associated ID. Unfortunately, GitHub UI does not expose that ID by default. It is also worth knowing that posting individual comments on the files causes each of them to be implicitly associated with its own unique Code Review Id. Whenever you trigger the automated code review processing you will be executing it against the most recently published Code Review.

CodePath

CodePath is path expression that can be used to uniquely identify part of code. It can take the form

[type.]*member

A CodePath for a method named run defined in class App will have a form:

App.run(*)

The `*` symbol in the parathesis represents a wildcard for zero or many parameters.

A CodePath for a function named sort

sort(*)

Last updated