Skip to content

Feat(pull): Add pullhero for first pass PR reviews #46

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kdvalin
Copy link
Member

@kdvalin kdvalin commented Jun 25, 2025

Description

This PR adds PullHero to give a first-pass review on PRs.

Before/After Comparison

Before

All code reviewed from scratch, manually

After

PullHero can provide a first pass review, and others can provide more in-depth code review.

Clerical Stuff

TODO

Mention the issue this PR works toward resolving. If the
PR completely solves the issue, use "This closes #x"
to close the issue out automatically.

Mention the JIRA ticket of the issue, this helps keep
everything together so we can find this PR easily.

Relates to JIRA: RPOPC-<TICKET_NUMBER> # Still needs to be done :/

@kdvalin kdvalin requested a review from dvalinrh June 25, 2025 17:41
@redhat-performance redhat-performance deleted a comment from github-actions bot Jul 10, 2025
Copy link

github-actions bot commented Jul 10, 2025

PullHero Review

Provider: generativelanguage.googleapis.com Model: gemini-2.0-flash

Code Review of pullhero.yaml

Overall:

The addition of pullhero.yaml introduces a GitHub Actions workflow to automate code review using the pullhero tool. The workflow is triggered on pull request events (opened, review_requested, edited) and aims to provide automated feedback via comments on pull requests.

Positive Aspects:

  • Clear Trigger Events: The workflow is triggered on relevant pull request events.
  • Secrets Management: The workflow uses GitHub secrets (GITHUB_TOKEN, PULLHERO_API_KEY, PULLHERO_API_HOST, PULLHERO_API_MODEL, PULLHERO_API_ENDPOINT) to securely manage sensitive information.
  • Comprehensive pullhero Configuration: The pullhero command includes various parameters, such as VCS provider, change ID, repository, change type, agent, and LLM API details.

Concerns and Suggestions:

  • Error Handling: There is no explicit error handling. If any step fails (e.g., pip3 install pullhero, pullhero execution), the workflow will fail, but there might not be sufficient context on why it failed. Consider adding error handling, such as checking the exit code of each command and logging relevant information.
  • Secrets Availability: It is assumed that the secrets PULLHERO_API_KEY, PULLHERO_API_HOST, PULLHERO_API_MODEL, and PULLHERO_API_ENDPOINT are properly configured in the repository settings. Add a comment in the workflow file or in the PR description to make users aware of this dependency and how to configure these secrets. Without these secrets being properly configured, the action will fail silently.
  • pullhero Installation: The workflow installs pullhero using pip3. It is generally recommended to use a requirements.txt file for managing dependencies. This allows for easier version control and reproducibility. While this is a single dependency, using requirements.txt is a good habit.
  • ubuntu-latest: While convenient, ubuntu-latest can change over time. Consider pinning to a specific version of Ubuntu if reproducibility is critical.
  • actions/checkout@v3: Using actions/checkout@v3 is good.
  • Missing Documentation: There is no description regarding what pullhero is or where to find more information.

Specific Suggestions:

  1. Add Error Handling:

    - name: Install pullhero
      run: |
        pip3 install pullhero
        if [ $? -ne 0 ]; then
          echo "Error installing pullhero"
          exit 1
        fi
    - name: Push code review
      run: |
        pullhero --vcs-provider github 
        --vcs-token ${{ secrets.GITHUB_TOKEN }}
        --vcs-change-id ${{ github.event.pull_request.number }}
        --vcs-repository ${{ github.repository }}
        --vcs-change-type pr
        --agent review
        --agent-action comment
        --vcs-base-branch ${{ github.event.pull_request.base.ref }}
        --vcs-head-branch ${{ github.event.pull_request.head.ref }}
        --llm-api-key ${{ secrets.PULLHERO_API_KEY }}
        --llm-api-host ${{ secrets.PULLHERO_API_HOST }}
        --llm-api-model ${{ secrets.PULLHERO_API_MODEL }}
        --llm-api-endpoint ${{ secrets.PULLHERO_API_ENDPOINT }}
        if [ $? -ne 0 ]; then
          echo "Error running pullhero"
          exit 1
        fi
  2. Document Secrets: Add a comment near the top of the file.

    # This workflow requires the following secrets to be configured in the repository settings:
    #   - GITHUB_TOKEN:  Automatically provided by GitHub Actions.
    #   - PULLHERO_API_KEY:  API key for pullhero.
    #   - PULLHERO_API_HOST:  API host for pullhero.
    #   - PULLHERO_API_MODEL:  API model for pullhero.
    #   - PULLHERO_API_ENDPOINT: API endpoint for
    

Vote: 0

PullHero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant