diff --git a/docs/automations/integrations/amazon-q/flag-amazon-q-pr/README.md b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/README.md new file mode 100644 index 000000000..28869331c --- /dev/null +++ b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/README.md @@ -0,0 +1,105 @@ +--- +title: Automation - Label Amazon Q PRs +description: Automatically apply labels to PRs that are assisted by Amazon Q +category: [quality, genai, amazon_q, quickstart] +starter_kits: [genai] +--- +# Automatically Label Amazon Q 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. + +=== "Label by Prompt" + 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](/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-prompt.png) + + !!! info "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. + + !!! example "Ask the PR author about Amazon Q usage" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/amazon_q/comment_amazon_q_prompt.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/amazon_q/comment_amazon_q_prompt.cm){ .md-button } + +
+ + !!! info "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 + + !!! example "Label PRs where the user indicated Amazon Q usage" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_prompt.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_prompt.cm){ .md-button } + +
+=== "Label by Known Users" + Automatically apply labels to PRs that are created by known users of generative AI coding tools. + + ![Label by Contributors](/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-contributors.png) + !!! info "Configuration Description" + Conditions: + + * The PR author is one of a specified list of contributors + + Automation Actions: + + * Apply a `🤖 Amazon Q` label to the PR + + !!! example "Label by Contributors" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_contributors.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_contributors.cm){ .md-button } + +
+=== "Label by Tag" + 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](/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-tag.png) + !!! info "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 + + !!! example "Label Amazon Q by Tag" + ```yaml+jinja + --8<-- "docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_tag.cm" + ``` +
+ + [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_tag.cm){ .md-button } + +
+ +## 📈 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 + + diff --git a/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-contributors.png b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-contributors.png new file mode 100644 index 000000000..1ca1136f7 Binary files /dev/null and b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-contributors.png differ diff --git a/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-prompt.png b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-prompt.png new file mode 100644 index 000000000..946a6e374 Binary files /dev/null and b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-prompt.png differ diff --git a/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-tag.png b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-tag.png new file mode 100644 index 000000000..4189f8bfe Binary files /dev/null and b/docs/automations/integrations/amazon-q/flag-amazon-q-pr/label-amazon-q-by-tag.png differ diff --git a/docs/downloads/automation-library/integrations/amazon_q/comment_amazon_q_prompt.cm b/docs/downloads/automation-library/integrations/amazon_q/comment_amazon_q_prompt.cm new file mode 100644 index 000000000..cd7513be5 --- /dev/null +++ b/docs/downloads/automation-library/integrations/amazon_q/comment_amazon_q_prompt.cm @@ -0,0 +1,20 @@ +-*- 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 \ No newline at end of file diff --git a/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_contributors.cm b/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_contributors.cm new file mode 100644 index 000000000..08cc874cf --- /dev/null +++ b/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_contributors.cm @@ -0,0 +1,18 @@ +# -*- 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 \ No newline at end of file diff --git a/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_prompt.cm b/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_prompt.cm new file mode 100644 index 000000000..d22537a0e --- /dev/null +++ b/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_prompt.cm @@ -0,0 +1,13 @@ +-*- 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' \ No newline at end of file diff --git a/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_tag.cm b/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_tag.cm new file mode 100644 index 000000000..2b9e0a229 --- /dev/null +++ b/docs/downloads/automation-library/integrations/amazon_q/label_amazon_q_by_tag.cm @@ -0,0 +1,24 @@ +# -*- 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 }} \ No newline at end of file diff --git a/docs/integrations/README.md b/docs/integrations/README.md index 1d1b3d687..51434d2d4 100644 --- a/docs/integrations/README.md +++ b/docs/integrations/README.md @@ -77,6 +77,12 @@ visible: false +
+
+[:material-alpha-a-box: Amazon Q](/integrations/amazon-q) +
+
+
[:material-brain: Claude Code](/integrations/claude-code) diff --git a/docs/integrations/amazon-q.md b/docs/integrations/amazon-q.md new file mode 100644 index 000000000..8e6305903 --- /dev/null +++ b/docs/integrations/amazon-q.md @@ -0,0 +1,15 @@ +--- +title: Integrate gitStream with Amazon Q +description: Workflow automations to improve your Amazon Q AI usage. +--- +# Integrate gitStream with Amazon Q + +## Automatically Label Amazon Q-Assisted PRs + +--8<-- "docs/automations/integrations/amazon-q/flag-amazon-q-pr/README.md:example" + +## Additional Resources + +--8<-- "docs/snippets/general.md" + +--8<-- "docs/snippets/automation-footer.md"