Skip to content

pr-agentの導入 #117 - #118

Merged
t1k2a merged 1 commit into
mainfrom
feature
Oct 19, 2025
Merged

pr-agentの導入 #117#118
t1k2a merged 1 commit into
mainfrom
feature

Conversation

@t1k2a

@t1k2a t1k2a commented Oct 19, 2025

Copy link
Copy Markdown
Owner

PR Type

Enhancement


Description

  • Introduces pr-agent GitHub Action workflow

  • Enables automated PR description generation

  • Enables automated PR code review

  • Enables automated code improvement suggestions

  • Configures Japanese language output for all features


Diagram Walkthrough

flowchart LR
  A["GitHub Events<br/>PR opened/reopened/synchronized<br/>Issue comments"] -->|"Triggers"| B["pr-agent Workflow"]
  B -->|"Auto-generates"| C["PR Description<br/>in Japanese"]
  B -->|"Auto-generates"| D["PR Review<br/>in Japanese"]
  B -->|"Auto-generates"| E["Code Suggestions<br/>in Japanese"]
  C --> F["Enhanced PR<br/>Documentation"]
  D --> F
  E --> F
Loading

File Walkthrough

Relevant files
Configuration changes
pr-agent.yml
New pr-agent GitHub Actions workflow configuration             

.github/workflows/pr-agent.yml

  • Creates new GitHub Actions workflow file for pr-agent integration
  • Configures workflow triggers for PR events (opened, reopened,
    ready_for_review, synchronize) and issue comments
  • Sets up pr-agent action with OpenAI and GitHub token authentication
  • Enables three automation features: auto_describe, auto_review, and
    auto_improve
  • Adds Japanese language instructions for PR descriptions, reviews, and
    code suggestions
+26/-0   

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@vercel

vercel Bot commented Oct 19, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
leaving-work Ready Ready Preview Comment Oct 19, 2025 6:52am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@qodo-code-review

Copy link
Copy Markdown

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@t1k2a

t1k2a commented Oct 19, 2025

Copy link
Copy Markdown
Owner Author

/description

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Correct environment variable configuration format

Correct the environment variable format for pr-agent configuration by replacing
dots with double underscores (e.g., github_action.auto_describe becomes
GITHUB_ACTION__AUTO_DESCRIBE) to ensure the settings are applied.

.github/workflows/pr-agent.yml [21-26]

-github_action.auto_describe: true
-github_action.auto_review: true
-github_action.auto_improve: true
-PR_DESCRIPTION.EXTRA_INSTRUCTIONS: '日本語で記述してください。タイトルに次のPrefixをつけてください。`feat:`, `fix:`, `perf:`, `refactor:`, `test:`, `chore:`, `ci:`, `docs:` etc'
-PR_REVIEWER.EXTRA_INSTRUCTIONS: '日本語で記述してください。'
-PR_CODE_SUGGESTIONS.EXTRA_INSTRUCTIONS: '日本語で記述してください。'
+GITHUB_ACTION__AUTO_DESCRIBE: "true"
+GITHUB_ACTION__AUTO_REVIEW: "true"
+GITHUB_ACTION__AUTO_IMPROVE: "true"
+PR_DESCRIPTION__EXTRA_INSTRUCTIONS: '日本語で記述してください。タイトルに次のPrefixをつけてください。`feat:`, `fix:`, `perf:`, `refactor:`, `test:`, `chore:`, `ci:`, `docs:` etc'
+PR_REVIEWER__EXTRA_INSTRUCTIONS: '日本語で記述してください。'
+PR_CODE_SUGGESTIONS__EXTRA_INSTRUCTIONS: '日本語で記述してください。'
  • Apply / Chat
Suggestion importance[1-10]: 10

__

Why: This suggestion correctly identifies a critical configuration error that would cause the pr-agent action to ignore all custom settings and revert to default behavior, thus breaking the intended functionality of the PR.

High
High-level
Pin action version and refine triggers

For improved stability and security, pin the qodo-ai/pr-agent action to a
specific version instead of using @main. Also, consider adjusting the triggers
to run reviews and improvements on-demand to reduce noise and cost.

Examples:

.github/workflows/pr-agent.yml [3]
    types: [opened, reopened, ready_for_review, synchronize]
.github/workflows/pr-agent.yml [17]
       uses: qodo-ai/pr-agent@main

Solution Walkthrough:

Before:

on:
  pull_request:
    types: [opened, reopened, ready_for_review, synchronize]
...
steps:
 - name: PR Agent action step
   uses: qodo-ai/pr-agent@main
   env:
    ...
    github_action.auto_review: true
    github_action.auto_improve: true
    ...

After:

on:
  pull_request:
    # Removed 'synchronize' to reduce noise and cost.
    # Review/improve can be triggered on-demand via comments.
    types: [opened, reopened, ready_for_review]
  issue_comment:
    types: [created]
...
steps:
 - name: PR Agent action step
   # Pinned to a specific version for stability and security
   uses: qodo-ai/pr-agent@vX.Y.Z
   env:
    ...
    github_action.auto_review: true
    github_action.auto_improve: true
    ...
Suggestion importance[1-10]: 8

__

Why: This suggestion provides crucial best practices for GitHub Actions, enhancing workflow stability by pinning the action version and improving cost-efficiency and user experience by refining event triggers.

Medium
Security
Pin action to a specific version

Pin the qodo-ai/pr-agent action to a specific version tag (e.g., @vX.Y.Z)
instead of @main to improve workflow stability and security.

.github/workflows/pr-agent.yml [17]

-uses: qodo-ai/pr-agent@main
+uses: qodo-ai/pr-agent@v0.4.10
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a security and stability risk by using @main and recommends pinning the action to a specific version, which is a standard best practice for GitHub Actions.

Medium
General
Restrict workflow to PR comments only

Modify the job's if condition to run only on pull request comments, not on
regular issue comments, to prevent unnecessary workflow executions.

.github/workflows/pr-agent.yml [1-7]

 on:
   pull_request:
     types: [opened, reopened, ready_for_review, synchronize]
   issue_comment:
 jobs:
   pr_agent_job:
-    if: ${{ github.event.sender.type != 'Bot' }}
+    if: ${{ github.event.sender.type != 'Bot' && (github.event_name != 'issue_comment' || github.event.issue.pull_request) }}
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that the workflow would run unnecessarily on issue comments and provides the correct condition to restrict it to pull request comments only, improving efficiency.

Medium
  • More

@t1k2a
t1k2a merged commit f1dab4b into main Oct 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant