Skip to content

Validate Files In Pull Request

Marcello de Sales edited this page Nov 27, 2017 · 2 revisions

Contents

  1. Requirements
  2. Fork Config Repo
  3. Commit your changes
  4. Validation upon "Merge pull request" click
  5. Fixing errors

Requirements

Requirements:

Fork Config Repo

This scenario involves forking a github config repo for the creation of a Pull Request. Users usually use the fork button to create a new forked repo and start committing changes.

Commit your changes

All commits in the forked repo are NOT validating the changes you make in the UI. For instance, consider the following commits that introduce errors to multiple files.

Validation upon "Merge pull request" click

The validation will be executed by Github Enterprise when the commit objects are received. That will only happen you press the button Merge pull request in the UI.

  • The error about the message returned by the validator.
  • The list of all files validated, including the parser's error message detailing why the file is invalid.
  • Valid files are listed prefixed with (v).
  • Invalid files are listed prefixed with (x).
  • The name of the branch that rejected the commits to be merged in the origin.

Here's an example of such event:

At this point, the only way to push the changes to the same branch, in the forked repo, and try to merge again.

IMPORTANT

  • When the validator rejects your Pull Request in the UI, the commits in the branch are still in the branch in the forked repo.
  • You MUST fix the errors in the files that are in the branch in the forked repo by committing to that branch.
  • Only after the fix you may try pressing the button "Merge pull request" again.

Fixing Errors

When problems are found in your commits, you have different options:

  • Fix each individual file.
  • Create as many new commits as desired.
  • Push the changes in the forked repo.

If you prefer, you can execute the same validation script locally by downloading it.