Generate Tests Using GitHub Issue Labels

GitAuto can be triggered by adding a "gitauto" label to any GitHub issue. This is especially useful for existing issues or when creating issues programmatically.

1

Find or create a GitHub issue

Screenshot showing a GitHub issue page. The image displays an open issue with its title, description, and the right sidebar containing various options.

Navigate to an existing issue or create a new one in your GitHub repository. You can use any issue - both new ones and those created before GitAuto was installed.

2

Add the "gitauto" label

Screenshot showing how to add the 'gitauto' label. The image shows the GitHub issue's right sidebar with the Labels section expanded. The cursor is typing 'gitauto' in the label search field, and the label might not exist yet but can be created on-the-fly.

In the right sidebar of the issue, click on the gear icon next to "Labels" and type "gitauto" in the search field. If the label doesn't exist yet, GitHub will let you create it on the fly by clicking on "Create new label" or pressing Enter.

Note: If you're creating the label for the first time, you'll need to set a color for it. Any color works - GitAuto only cares about the label name "gitauto" (case insensitive).

3

GitAuto analyzes and responds

Screenshot showing GitAuto's response as a comment in the issue. The image displays GitAuto's automated comment that acknowledges it's analyzing the issue and will create tests.

Once the label is added, GitAuto will automatically analyze the issue and add a comment acknowledging that it's working on generating tests. This typically happens within a minute of adding the label.

4

Review and merge the pull request

Screenshot showing the pull request created by GitAuto. The image displays a GitHub pull request page with the code changes, showing the newly generated test files.

GitAuto will create a pull request with the generated tests. The PR will be linked in a comment on the issue. Review the code, make any necessary adjustments, and merge the pull request to add the tests to your repository.

Automating with GitHub Issue Labels

The label-based trigger is especially powerful for automation workflows:

  • Integration with external tools: Tools like Sentry, Jira, or other issue trackers can be configured to automatically create GitHub issues with the "gitauto" label when certain events occur.
  • Automated testing workflows: You can set up GitHub Actions or other CI/CD workflows to add the "gitauto" label to issues based on specific criteria, triggering test generation automatically.
  • Legacy issues: For repositories with many existing issues created before GitAuto was installed, you can batch-add the "gitauto" label to generate tests for multiple issues at once.