-
Notifications
You must be signed in to change notification settings - Fork 44
Measure ai #689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Measure ai #689
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
427cde6
basic cms
PavelLinearB b83f0f6
refined cms
PavelLinearB fae6fe2
Apply suggestions from code review
PavelLinearB 0284d37
Update docs/integrations/github-copilot.md
PavelLinearB 75d73fd
Update docs/integrations/github-copilot.md
PavelLinearB 795983c
Update docs/integrations/github-copilot.md
PavelLinearB 06bb32d
regex instead pattern
PavelLinearB 6e5a725
Update docs/downloads/automation-library/integrations/ai-assistance/c…
PavelLinearB 7346a6a
Update docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
PavelLinearB 32e11ef
Update docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
PavelLinearB 8834b67
Merge branch 'main' into measure-ai
PavelLinearB 487723a
Update docs/downloads/automation-library/integrations/ai-assistance/c…
PavelLinearB 0a0e05e
Update docs/downloads/automation-library/integrations/ai-assistance/c…
PavelLinearB 4ed3562
Update docs/downloads/automation-library/integrations/ai-assistance/c…
PavelLinearB 736bc80
Update docs/downloads/automation-library/integrations/ai-assistance/c…
PavelLinearB 1892857
CR
PavelLinearB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
docs/automations/integrations/ai-assistance/flag-ai-pr/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| --- | ||
| title: Automation - Label AI-Assisted PRs | ||
| description: Automatically apply labels to PRs based on AI assistance. | ||
| category: [quality, genai, ai, quickstart] | ||
| starter_kits: [genai] | ||
| --- | ||
| # Automatically Label AI-Assisted PRs | ||
| <!-- --8<-- [start:example]--> | ||
| Automatically apply labels to PRs based on whether they were assisted by AI tools. Developers can indicate the specific AI tools or models used, or pre-add an AI-related label to skip the prompt. | ||
|
|
||
| === "Ask Developers About AI Assistance" | ||
| ### Ask Developers About AI Assistance | ||
| Prompt PR authors with a convenient checkbox survey to indicate which AI tools they used for the PR. Developers can pre-add any `🤖 ai-*` label to skip the question. The automation checks for existing labels before posting the prompt. | ||
|
|
||
|  | ||
|
|
||
| !!! info "Configuration Description" | ||
| Conditions: | ||
|
|
||
| * A PR is created, and no `🤖 ai-*` label is pre-applied. | ||
| * The question hasn't been asked before. | ||
|
|
||
| Automation Actions: | ||
|
|
||
| * Post a comment with a checkbox survey about AI tools used. | ||
| * Apply labels based on the checkboxes selected. | ||
|
|
||
| !!! example "Ask the PR author about AI assistance." | ||
| ```yaml+jinja | ||
| --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm" | ||
| ``` | ||
| <div class="result" markdown> | ||
| <span> | ||
| [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm){ .md-button } | ||
| </span> | ||
| </div> | ||
|
|
||
|
|
||
| ### Track AI Tools | ||
| Add labels to the PR according to the tools that the developer checked in the micro-survey above | ||
|  | ||
|
|
||
| !!! info "Configuration Description" | ||
| Conditions: | ||
|
|
||
| * A PR with selected checkboxes for AI tools used. | ||
| * Optional: Details about AI Service and Model specified. | ||
|
|
||
| Automation Actions: | ||
|
|
||
| * Apply labels for specific AI tools (e.g., `🤖 ai-copilot`, `🤖 ai-cursor`). | ||
| * Apply labels for AI services and models if provided. | ||
|
|
||
| !!! example "Track AI tools, models and services." | ||
| ```yaml+jinja | ||
| --8<-- "docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm" | ||
| ``` | ||
| <div class="result" markdown> | ||
| <span> | ||
| [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm){ .md-button } | ||
| </span> | ||
| </div> | ||
|
|
||
| === "Skip the survey for known users" | ||
| ### Ask Developers About AI Assistance | ||
| The automation will not prompt known users for AI assistance. This allows a smoother experience for users who were predefined as AI users, to avoid answering the same questions again. | ||
| !!! example "Skip the survey for known users." | ||
| ```yaml+jinja | ||
| --8<-- "docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm" | ||
| ``` | ||
| <div class="result" markdown> | ||
| <span> | ||
| [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm){ .md-button } | ||
| </span> | ||
| </div> | ||
|
|
||
| ### Track AI Tools | ||
| Add labels to the PR according to the tools that the developer checked in the micro-survey above | ||
|  | ||
|
|
||
| !!! example "Track AI tools, models and services." | ||
| ```yaml+jinja | ||
| --8<-- "docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm" | ||
| ``` | ||
| <div class="result" markdown> | ||
| <span> | ||
| [:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm){ .md-button } | ||
| </span> | ||
| </div> | ||
|
|
||
| <!-- --8<-- [end:example]--> |
Binary file added
BIN
+168 KB
docs/automations/integrations/ai-assistance/flag-ai-pr/ask-ai-assistance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.6 KB
docs/automations/integrations/ai-assistance/flag-ai-pr/label-ai-assistance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
docs/downloads/automation-library/integrations/ai-assistance/comment_ai_prompt.cm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # -*- mode: yaml -*- | ||
|
|
||
| manifest: | ||
| version: 1.0 | ||
|
|
||
| triggers: | ||
| on: | ||
| - pr_created | ||
|
|
||
| automations: | ||
| comment_ai_assistance_prompt: | ||
| # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR | ||
| # Only do this if there's no existing AI-related label and we haven't asked before | ||
| if: | ||
| - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }} | ||
| - {{ pr.comments | filter(attr='commenter', term='gitstream-cm') | filter(attr='content', regex=r/Please mark which AI tools you used/) | nope }} | ||
| run: | ||
| - action: add-comment@v1 | ||
| args: | ||
| comment: | | ||
| Please mark which AI tools you used for this PR by checking the appropriate boxes: | ||
|
|
||
| - [ ] GitHub Copilot | ||
| - [ ] Cursor | ||
| - [ ] Tabnine | ||
| - [ ] JetBrains AI Assistant | ||
| - [ ] VSCode IntelliCode | ||
| - [ ] ChatGPT | ||
| - [ ] Claude | ||
| - [ ] Gemini | ||
| - [ ] Other AI tool | ||
| - [ ] No AI tools were used | ||
|
|
||
| Tip: If you want to avoid this comment in the future, you can add a label of the format `🤖 ai-*` when creating your PR. | ||
|
|
||
65 changes: 65 additions & 0 deletions
65
...loads/automation-library/integrations/ai-assistance/comment_ai_prompt_with_known_users.cm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # -*- mode: yaml -*- | ||
|
|
||
| manifest: | ||
| version: 1.0 | ||
| triggers: | ||
| on: | ||
| - pr_created | ||
|
|
||
| automations: | ||
| comment_ai_assistance_prompt: | ||
| # Post a comment for all PRs to prompt the PR author to indicate whether they used AI to assist coding in this PR | ||
| # Only do this if there's no existing AI-related label and we haven't asked before | ||
| if: | ||
| - {{ pr.labels | match(regex=r/🤖 ai-*/) | nope }} | ||
| - {{ pr.author | match(list=copilot_contributors) | nope }} | ||
| - {{ pr.author | match(list=cursor_contributors) | nope }} | ||
| run: | ||
| - action: add-comment@v1 | ||
| args: | ||
| comment: | | ||
| Please mark which AI tools you used for this PR by checking the appropriate boxes: | ||
|
|
||
| - [ ] GitHub Copilot | ||
| - [ ] Cursor | ||
| - [ ] Tabnine | ||
| - [ ] JetBrains AI Assistant | ||
| - [ ] VSCode IntelliCode | ||
| - [ ] ChatGPT | ||
| - [ ] Claude | ||
| - [ ] Gemini | ||
| - [ ] Other AI tool | ||
| - [ ] No AI tools were used | ||
|
|
||
| **Tip**: If you want to avoid this comment in the future, add a label of the format `🤖 ai-*` when creating your PR, or ask your admin to add you to the pre-defined lists of known users | ||
|
|
||
| label_copilot_known_users: | ||
| # For all PRs authored by someone who is specified in the genai_contributors list | ||
| if: | ||
| - {{ pr.author | match(list=copilot_contributors) | some }} | ||
| # Apply a label indicating the user has adopted Copilot | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: '🤖 ai-copilot' | ||
|
|
||
| label_cursor_known_users: | ||
| # For all PRs authored by someone who is specified in the genai_contributors list | ||
| if: | ||
| - {{ pr.author | match(list=cursor_contributors) | some }} | ||
| # Apply a label indicating the user has adopted Copilot | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: '🤖 ai-cursor' | ||
|
|
||
| copilot_contributors: | ||
| - username1 | ||
| - username2 | ||
| - usernameN | ||
|
|
||
| cursor_contributors: | ||
| - username1 | ||
| - username2 | ||
| - usernameN | ||
|
|
71 changes: 71 additions & 0 deletions
71
docs/downloads/automation-library/integrations/ai-assistance/track_ai_models.cm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # -*- mode: yaml -*- | ||
|
|
||
| manifest: | ||
| version: 1.0 | ||
|
|
||
| automations: | ||
| label_ai_tools_by_checkbox: | ||
| # Apply labels based on the checkboxes selected in the PR comment | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] GitHub Copilot/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-copilot" | ||
|
|
||
| label_ai_cursor: | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] Cursor/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-cursor" | ||
|
|
||
| label_ai_tabnine: | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] Tabnine/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-tabnine" | ||
|
|
||
| label_ai_jetbrains: | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] JetBrains AI Assistant/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-jetbrains" | ||
|
|
||
| label_ai_intellicode: | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] VSCode IntelliCode/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-intellicode" | ||
|
|
||
| label_ai_chatgpt: | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] ChatGPT/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-chatgpt" | ||
|
|
||
| label_ai_other: | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] Other AI tool/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-other" | ||
|
|
||
| label_ai_none: | ||
| if: | ||
| - {{ pr.comments | filter(attr='content', regex=r/\- \[x\] No AI tools were used/) | some }} | ||
| run: | ||
| - action: add-label@v1 | ||
| args: | ||
| label: "🤖 ai-none" | ||
|
|
4 changes: 2 additions & 2 deletions
4
docs/downloads/automation-library/integrations/copilot/comment_copilot_prompt.cm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.