Skip to content
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

update workflow naming, update readme #30

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run the qodo-cover-pr action
name: Run the qodo-cover-pr action (Python)

on:
pull_request:
Expand All @@ -12,7 +12,7 @@ permissions:
contents: write # Allows reading and writing files

jobs:
run-qodo-cover:
run-qodo-cover-pr-python:
if: ${{ github.actor != 'github-actions[bot]' }}
runs-on: ubuntu-22.04
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run the qodo-cover action
name: Run the qodo-cover action (Python)

on:
workflow_dispatch:
Expand All @@ -13,7 +13,7 @@ permissions:
contents: write

jobs:
run-qodo-cover:
run-qodo-cover-python:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
Expand Down
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
# Qodo Cover GitHub Action Example

This repo shows how the [Qodo Cover GitHub Action](https://github.com/qodo-ai/qodo-ci) can be added to your repository.
This repo shows how the [Qodo Cover GitHub Actions](https://github.com/qodo-ai/qodo-ci) can be added to your repository.

## Workflow
The repo linked above defines 2 actions:

To use the Qodo Cover GitHub Action, you need to add it to your GitHub workflow. See the example workflow in [`.github/workflows/qodo-cover.yml`](.github/workflows/qodo-cover.yml).
- `qodo-cover`: This action runs the Qodo Cover agent and is intended to be manually triggered. The agent tries to expand coverage on all project files of the specified language.
- `qodo-cover-pr`: This action runs the Qodo Cover agent in "pr" mode, and is intended to be triggered by pull requests. In "pr" mode, the agent tries to expand coverage only on *modified files* of the specified language.

In both of the above actions if the successfully increases coverage it will create a PR with the added tests as well as a coverage improvement report. See [this PR](https://github.com/qodo-ai/qodo-ci-example/pull/19) as an example.

## Supported languages

- Python
- PHP
- Java
- More coming soon!

## Workflow examples

To use a Qodo Cover GitHub Action, you need to add it to your GitHub workflow. Take a look at the following working examples:

- [`.github/workflows/qodo-cover-pr-python.yml`](.github/workflows/qodo-cover-pr-python.yml). This workflow triggers on pull requests and runs the agent in "pr" mode on the Python project in `templated_tests/python-fastapi`.
- [`.github/workflows/qodo-cover-python.yml`](.github/workflows/qodo-cover-python.yml). This workflow is triggered manually and runs the agent on the Python project in `templated_tests/python-fastapi`.
- [`.github/workflows/qodo-cover-java.yml`](.github/workflows/qodo-cover-java.yml). This workflow is triggered manually and runs the agent on the Java project in `templated_tests/java/JokeFunction`.
- [`.github/workflows/qodo-cover-php.yml`](.github/workflows/qodo-cover-php.yml). This workflow is triggered manually and runs the agent on the PHP project in `templated_tests/php/myapp`.

**Remember to enable GitHub Actions to create pull requests:** This setting can be found in a repository's settings under Actions > General > Workflow permissions.

## Generated Tests

While developing the Qodo Cover agent we tested it on some open source repositories. Take a look at the changes in these pull requests:
- [hugginface/pytorch-image-models](https://github.com/huggingface/pytorch-image-models/pull/2331)
- [facebook/prophet](https://github.com/facebook/prophet/pull/2640)
- [microsoft/onnxscript](https://github.com/microsoft/onnxscript/pull/1967)

- [hugginface/pytorch-image-models](https://github.com/huggingface/pytorch-image-models/pull/2331)
- [facebook/prophet](https://github.com/facebook/prophet/pull/2640)
[microsoft/onnxscript](https://github.com/microsoft/onnxscript/pull/1967)