Skip to content

Integrate gitStream with AI

Required gitStream Plugins

This example requires you to install the askAI plugin.

Learn more about gitStream plugins.

Ask AI to Summarize the Changes in a PR

Use AI to generate a concise bullet-point summary of the changes in the pull request.

summarized-pr

Configuration Description

Conditions (all must be true):

  • A PR is created or new code has been committed to the PR.
  • The PR has a label "askai summarize"

Automation Actions:

  • Add a comment with a summary of the PR

Configuration Example

manifest:
  version: 1.0

triggers:
  on:
    - commit
    - pr_created

automations:
  ask_ai_describe:
    if:
      - {{ pr.labels | match(term="askai summarize") | some }}
    run:
      - action: add-comment@v1
        args:
          comment: |
            # ๐Ÿ“œ PR Summary ๐Ÿ“œ
            {{ source | askAI("Experienced developer",
              "Summarize the changes in this PR in bullet points.", env.OPEN_AI_TOKEN) | encode }}

Ask AI to Suggest Tests

Use AI to suggests additional test cases for uncovered or modified functions in the PR, including edge cases.

Configuration Description

Conditions (all must be true):

  • A PR is created or new code has been committed to the PR.
  • The PR has a label "askai tests"

Automation Actions:

  • Add a comment with suggested tests generated by an AI model

Configuration Example

manifest:
  version: 1.0

triggers:
  on:
    - commit
    - pr_created

automations:
  ask_ai_describe:
    if:
      - {{ pr.labels | match(term="askai tests") | some }}
    run:
      - action: add-comment@v1
        args:
          comment: |
            # ๐Ÿงช Test Suggestions ๐Ÿงช
            {{ source | askAI("QA tester",
              "Identify any new or modified functions without test coverage in this PR.
              Suggest specific test cases to add, including edge cases.
              If all functions are covered, return 'No additional tests needed.'", env.OPEN_AI_TOKEN) | encode }}

Ask AI for a Code Review

Use AI to perform a comprehensive code review, identify bugs, security risks, performance issues, deprecated methods, and style guide violations, and suggests improvements.

Configuration Description

Conditions (all must be true):

  • A PR is created or new code has been committed to the PR.
  • The PR has a label "askai cr"

Automation Actions:

  • Add a comment with a code review generated by an AI model

Configuration Example

manifest:
  version: 1.0

triggers:
  on:
    - commit
    - pr_created

automations:
  ask_ai_describe:
    if:
      - {{ pr.labels | match(term="askai cr") | some }}
    run:
      - action: add-comment@v1
        args:
          comment: |
            # โœจ gitStream Review โœจ
            {{ source | askAI("Code reviewer",
              "Review the PR code diff.
              - Identify bugs, security risks, and performance issues
              - Check for deprecated methods and style guide violations
              - Provide specific improvement suggestions based on the changes", env.OPEN_AI_TOKEN) | encode }}

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

More Automations can be found on the Automation Library and Integrations pages.