Skip to main content

Pull Request Validation

CodeValid continuously monitors your repository and automatically runs tests whenever code changes are made.
Think of it as automatic testing and bug detection integrated into your pull request workflow.

When you make changes and create a pull request:

  • CodeValid analyzes the changes
  • Runs all relevant test cases
  • Provides a summary of the test run
  • If any tests fail, it generates a root cause analysis and suggests code fixes that you can review and commit

Setting up Pull Request Validation

  1. Make sure pull request review is enabled in the CodeValid application (available under Settings).
  2. The branch you are creating the pull request from should have a .codevalid folder. If it does not, merge the changes from the CodeValid default branch.

    Hint: You can identify the default branch from the application settings (available under Settings).

Pull Request Validation Setup

Settings page showing the default branch and Enable pull request review option.

How it works

  1. If above settings are configured, CodeValid will automatically assign itself as a reviewer in GitHub when you create a pull request.
  2. Wait a few minutes for CodeValid to start the testing process, as soon as it starts you will see a comment from CodeValid displaying the progress.

Pull Request Validation Progress

  1. Once the testing process is complete, CodeValid will produce:

    • A summary of test execution showing passed and failed tests
    • If there are failures, a root cause analysis explaining the issue
    • Suggested code fixes with an option to commit the changes directly
  2. You can commit the changes proposed by CodeValid by adding a new comment @codevalid/commit. Commit Changes

When does validation runs for a pull request?

CodeValid validation is triggered in all of the following situations:

ScenarioDescription
New Pull Request createdYou open a new pull request.
New commit on Pull RequestYou push one or more new commits to an existing pull request.
Commit with @codevalid/retryYou add a pull request comment whose message includes @codevalid/retry to re-run validation.
Pull Request reopenedA previously closed pull request is reopened.

In each case, the event leads to CodeValid running validation on the Pull Request:

Comment commands

You can use these commands in PR comments to control CodeValid:

CommandDescription
@codevalid/commitApplies and commits the code fixes suggested by CodeValid for the current PR.
@codevalid/retryRe-runs validation on the pull request.