Skip to content

Commit 0ace09d

Browse files
authored
Merge pull request #586 from linear-b/refactor-askAI
AskAI improvements
2 parents e2f7517 + 1db811a commit 0ace09d

File tree

13 files changed

+203
-139
lines changed

13 files changed

+203
-139
lines changed

docs/automations/integrations/AI/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/automations/integrations/AI/askAI/README.md

Lines changed: 0 additions & 88 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Integrate gitStream with AI
3+
description: Use gitStream to integrate with AI services for Review, describe and add tests.
4+
category: [quality, genai, copilot, tests, efficiency]
5+
---
6+
# Integrate gitStream with AI
7+
8+
<!-- --8<-- [start:examples]-->
9+
!!! warning "Required gitStream Plugins"
10+
This example requires you to install the [`askAI`](/filter-function-plugins/#askai) plugin.
11+
12+
[Learn more about gitStream plugins](/plugins/).
13+
14+
## Ask AI to Summarize the Changes in a PR
15+
16+
--8<-- "docs/automations/integrations/askAI/summarize-pr/README.md:example"
17+
18+
## Ask AI to Suggest Tests
19+
20+
--8<-- "docs/automations/integrations/askAI/add-tests/README.md:example"
21+
22+
## Ask AI for a Code Review
23+
24+
--8<-- "docs/automations/integrations/askAI/code-review/README.md:example"
25+
26+
<!-- --8<-- [end:examples]-->
27+
28+
## Additional Resources
29+
30+
--8<-- "docs/snippets/general.md"
31+
32+
--8<-- "docs/snippets/automation-footer.md"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Automation - Ask AI to Suggest Tests
3+
description: Use gitStream's integration with AI services to suggests additional tests
4+
category: [quality, genai, copilot, tests, efficiency]
5+
---
6+
# Ask AI to Suggest Tests
7+
8+
<!-- --8<-- [start:example]-->
9+
Use AI to suggests additional test cases for uncovered or modified functions in the PR, including edge cases.
10+
11+
!!! info "Configuration Description"
12+
13+
Conditions (all must be true):
14+
15+
* A PR is created or new code has been committed to the PR.
16+
* The PR has a label "askai tests"
17+
18+
Automation Actions:
19+
20+
* Add a comment with suggested tests generated by an AI model
21+
22+
!!! example "Configuration Example"
23+
```yaml+jinja
24+
--8<-- "docs/downloads/automation-library/integrations/askAI/askAI_tests.cm"
25+
```
26+
<div class="result" markdown>
27+
<span>
28+
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/askAI/askAI-QA.cm){ .md-button }
29+
</span>
30+
</div>
31+
<!-- --8<-- [end:example]-->
32+
33+
## Additional Resources
34+
35+
--8<-- "docs/snippets/general.md"
36+
37+
**Related Automations**:
38+
39+
--8<-- "docs/snippets/context-automation.md"
40+
41+
--8<-- "docs/snippets/automation-footer.md"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Automation - Ask AI for a Code Review
3+
description: Use gitStream's integration with AI services to perform a comprehensive code review to your code
4+
category: [quickstart, quality, genai, copilot, tests, efficiency]
5+
---
6+
# Ask AI for a Code Review
7+
8+
<!-- --8<-- [start:example]-->
9+
Use AI to perform a comprehensive code review, identify bugs, security risks, performance issues, deprecated methods, and style guide violations, and suggests improvements.
10+
11+
!!! info "Configuration Description"
12+
13+
Conditions (all must be true):
14+
15+
* A PR is created or new code has been committed to the PR.
16+
* The PR has a label "askai cr"
17+
18+
Automation Actions:
19+
20+
* Add a comment with a code review generated by an AI model
21+
22+
!!! example "Configuration Example"
23+
```yaml+jinja
24+
--8<-- "docs/downloads/automation-library/integrations/askAI/askAI_CR.cm"
25+
```
26+
<div class="result" markdown>
27+
<span>
28+
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/askAI/askAI-CR.cm){ .md-button }
29+
</span>
30+
</div>
31+
<!-- --8<-- [end:example]-->
32+
33+
## Additional Resources
34+
35+
--8<-- "docs/snippets/general.md"
36+
37+
**Related Automations**:
38+
39+
--8<-- "docs/snippets/context-automation.md"
40+
41+
--8<-- "docs/snippets/automation-footer.md"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: Automation - Ask AI to Summarize the Changes in a PR
3+
description: Use gitStream's integration with AI services to generate a summary of the changes in the PR.
4+
category: [quality, genai, copilot, tests, efficiency]
5+
---
6+
# Ask AI to Summarize the Changes in a PR
7+
8+
<!-- --8<-- [start:example]-->
9+
Use AI to generate a concise bullet-point summary of the changes in the pull request.
10+
11+
![summarized-pr](/automations/integrations/askAI/summarize-pr/summarized-pr.png)
12+
13+
!!! info "Configuration Description"
14+
15+
Conditions (all must be true):
16+
17+
* A PR is created or new code has been committed to the PR.
18+
* The PR has a label "askai summarize"
19+
20+
Automation Actions:
21+
22+
* Add a comment with a summary of the PR
23+
24+
!!! example "Configuration Example"
25+
```yaml+jinja
26+
--8<-- "docs/downloads/automation-library/integrations/askAI/askAI_summarize.cm"
27+
```
28+
<div class="result" markdown>
29+
<span>
30+
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/askAI/askAI-QA.cm){ .md-button }
31+
</span>
32+
</div>
33+
<!-- --8<-- [end:example]-->
34+
35+
## Additional Resources
36+
37+
--8<-- "docs/snippets/general.md"
38+
39+
**Related Automations**:
40+
41+
--8<-- "docs/snippets/context-automation.md"
42+
43+
--8<-- "docs/snippets/automation-footer.md"
Loading

docs/downloads/automation-library/integrations/askAI/askAI_CR.cm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ automations:
1515
args:
1616
comment: |
1717
# ✨ gitStream Review ✨
18-
{{ source | askAI("Based on the given context, can you write a few bullet points about how I can improve my code? Please relate only to code diff, if it exists.", env.OPEN_AI_TOKEN) | encode }}
18+
{{ source | askAI("
19+
Review the PR code diff.
20+
- Identify bugs, security risks, and performance issues
21+
- Check for deprecated methods and style guide violations
22+
- Provide specific improvement suggestions based on the changes", env.OPEN_AI_TOKEN) | encode }}

docs/downloads/automation-library/integrations/askAI/askAI_QA.cm

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/downloads/automation-library/integrations/askAI/askAI_describe.cm

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)