Skip to content

Conversation

letonghan
Copy link
Contributor

@letonghan letonghan commented Sep 25, 2025

User description

Type of Change

feature or bug fix or documentation or validation or others
API changed or not

Description

detail description

Expected Behavior & Potential Risk

the expected behavior that triggered by this PR

How has this PR been tested?

how to reproduce the test (including hardware information)

Dependency Change?

any library dependency introduced or removed


PR Type

Enhancement


Description

  • Added PR Agent workflow configuration

  • Configured job to run on specific PR events

  • Set up environment variables for API access

  • Included steps to check LLM server and run PR-Agent


Diagram Walkthrough

flowchart LR
  init["Initialize PR Agent Workflow"] -- "Configure Events" --> events["Pull Request Events"]
  events -- "Set Permissions" --> permissions["Read Contents, Write PRs & Issues"]
  permissions -- "Define Steps" --> check_llm["Check LLM Server"]
  check_llm -- "Run PR-Agent" --> run_agent["Execute PR-Agent Actions"]
Loading

File Walkthrough

Relevant files
Enhancement
pr-agent.yml
Add PR Agent Workflow                                                                       

.github/workflows/pr-agent.yml

  • Added new workflow file for PR Agent
  • Configured to run on PR open, reopen, and ready for review
  • Set environment variables for API keys and tokens
  • Included steps to verify LLM server and execute PR-Agent
+40/-0   

letonghan and others added 3 commits September 24, 2025 11:20
Signed-off-by: letonghan <letong.han@intel.com>
Signed-off-by: letonghan <letong.han@intel.com>
@PRAgent4INC
Copy link
Collaborator

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 Security concerns

Sensitive information exposure:
The workflow uses secrets for API keys and tokens. Ensure that these secrets are securely managed and that the workflow does not inadvertently expose them.

⚡ Recommended focus areas for review

Environment Variables

Ensure that all environment variables used in the workflow are correctly set and secured. Verify that secrets.OPENAI_API_BASE, secrets.OPENAI_KEY, secrets.MODEL_NAME, and secrets.PR_GITHUB_TOKEN are properly configured and stored in GitHub Secrets.

    OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
    OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
    MODEL: ${{ secrets.MODEL_NAME }}
  run: |
    curl -sf "$OPENAI_API_BASE/models" -H "Authorization: Bearer $OPENAI_KEY"
- name: Run PR-Agent
  uses: qodo-ai/pr-agent@main
  env:
    OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }}
    OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
    GITHUB_TOKEN: ${{ secrets.PR_GITHUB_TOKEN }}
    config.model: "openai/${{ secrets.MODEL_NAME }}"
Job Runner

Confirm that the specified runner agent exists and is correctly configured to execute the workflow. If agent is a self-hosted runner, ensure it is available and has the necessary permissions.

runs-on: agent

@PRAgent4INC
Copy link
Collaborator

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use valid runner label

Ensure that agent is a valid runner label. Consider using a more specific runner
label like ubuntu-latest.

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

-runs-on: agent
+runs-on: ubuntu-latest
Suggestion importance[1-10]: 6

__

Why: Suggesting a more specific runner label improves the reliability and consistency of the workflow execution.

Low
Validate model name secret

Verify that secrets.MODEL_NAME is correctly set and does not contain any typos or
incorrect values.

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

+config.model: "openai/${{ secrets.MODEL_NAME }}"
 
-
Suggestion importance[1-10]: 5

__

Why: Verifying the secret value ensures the workflow uses the correct model, but this suggestion does not propose a change.

Low
Review configuration settings

Ensure these configurations align with the desired behavior and security policies.

.github/workflows/pr-agent.yml [38-40]

+github_action_config.auto_review: "true"
+github_action_config.auto_describe: "true"
+github_action_config.auto_improve: "true"
 
-
Suggestion importance[1-10]: 5

__

Why: Ensuring the configurations align with desired behavior and security policies is important, but this suggestion does not propose a change.

Low

Signed-off-by: letonghan <letong.han@intel.com>
@yiliu30
Copy link
Contributor

yiliu30 commented Sep 25, 2025

Great! @letonghan, could you please explain the intended usage and the key functionality of this feature?

@letonghan
Copy link
Contributor Author

Great! @letonghan, could you please explain the intended usage and the key functionality of this feature?

Sure @yiliu30 . This PR is to support PR Agent in INC, which will help to describe/review/improve PRs automatically and manually.
You could check this link for detailed information.

@yiliu30
Copy link
Contributor

yiliu30 commented Sep 25, 2025

Great! @letonghan, could you please explain the intended usage and the key functionality of this feature?

Sure @yiliu30 . This PR is to support PR Agent in INC, which will help to describe/review/improve PRs automatically and manually. You could check this link for detailed information.

Cool, nice to see such a stylish feature.

@yiliu30
Copy link
Contributor

yiliu30 commented Sep 25, 2025

/describe

@letonghan
Copy link
Contributor Author

/describe

manually review will be triggerred after this PR merged.

@XuehaoSun XuehaoSun merged commit 7fb4bde into master Sep 25, 2025
12 checks passed
@XuehaoSun XuehaoSun deleted the pr_agent branch September 25, 2025 06:05
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.

5 participants