Skip to content

Integrate gitStream with Amazon Q

Automatically Label Amazon Q-Assisted PRs

Automatically apply labels to PRs that are assisted by Amazon Q. You can apply labels based on a known list of Amazon Q users, PR tags, or by prompting the PR author to indicate if they used Amazon Q.

Prompt PR authors to indicate if they used Amazon Q for the PR and automatically label the PR if they did. This requires two separate automation files to handle posting the prompt and labeling accordingly.

Label Amazon Q by Prompt

Configuration Description

Conditions:

  • A PR is created

Automation Actions:

  • Post a comment prompting the author to indicate if Amazon Q assisted the author with writing the code in the PR.

Ask the PR author about Amazon Q usage

-*- mode: yaml -*-

manifest:
  version: 1.0

on:
  - pr_created

automations:
  comment_amazon_q_prompt:
    if:
      - true
    run:
      - action: add-comment@v1
        args:
          comment: |
            Please mark whether you used Amazon Q to assist coding in this PR

            - [ ] Amazon Q Assisted
            - [ ] Not Amazon Q Assisted 

Configuration Description

Conditions:

  • A PR is updated or merged where the author indicates they used Amazon Q via a prompt.

Automation Actions:

  • Apply a 🤖 Amazon Q label to the PR

Label PRs where the user indicated Amazon Q usage

-*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  label_amazon_q_pr:
    if:
      - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter (attr='content', regex=r/\- \[x\] Amazon Q Assisted/) | some}}
    run:
      - action: add-label@v1
        args:
          label: '🤖 Amazon Q' 

Automatically apply labels to PRs that are created by known users of generative AI coding tools.

Label by Contributors

Configuration Description

Conditions:

  • The PR author is one of a specified list of contributors

Automation Actions:

  • Apply a 🤖 Amazon Q label to the PR

Label by Contributors

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  label_amazon_q_contributors:
    if:
      - {{ pr.author | match(list=amazon_q_contributors) | some }}
    run:
      - action: add-label@v1
        args:
          label: '🤖 Amazon Q'

amazon_q_contributors:
  - username1
  - username2
  - etc 

Look for a specific tag in the PR title, description, comments or commit messages and if found add a label to the PR

Label Amazon Q by Tag

Configuration Description

Conditions:

  • The #amazon_q# tag is found in any of the PR title, description, comments or commit messages for commits in the PR Automation Actions:

  • Apply a 🤖 Amazon Q label to the PR

Label Amazon Q by Tag

# -*- mode: yaml -*-

manifest:
  version: 1.0

on:
  - comment_added
  - commit
  - pr_created

automations:
  label_amazon_q:
    if:
      - {{ amazon_q_tag.pr_title or amazon_q_tag.pr_desc or amazon_q_tag.pr_comments or amazon_q_tag.commit_messages }}
    run:
      - action: add-label@v1
        args:
          label: '🤖 Amazon Q'

amazon_q_tag:
  pr_title: {{ pr.title | includes(regex=r/#amazon_q#/) }}
  pr_desc: {{pr.description | includes(regex=r/#amazon_q#/) }}
  pr_comments: {{ pr.comments | map(attr='content') | match(regex=r/#amazon_q#/) | some }}
  commit_messages: {{ branch.commits.messages | match(regex=r/#amazon_q#/) | some }} 

📈 Track the Business Impact

By labeling PRs assisted by Amazon Q, you can measure:

  • Time savings (via Cycle Time, Review Time)
  • PR risk (via Refactor Rate, CFR)
  • Productivity lift from AI tools

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.