Skip to content

Validate Online Commits

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

Contents

  1. Requirements
  2. Commit your changes
  3. Validation upon UI Commit
  4. Fixing errors

Requirements

Requirements:

Commit your changes

It is normal to use the Github Enterprise UI for quick updates on configuration. However, that is very error-prone specially when dealing with yml files whose format requirements include proper identation. For instance, changes will be automatically validated when clicking in the commit button in the file change UI.

The minimal the Config Validator will do at this time is to validate the file being changed statically.

Validation upon UI Commit

The validation will be executed by Github Enterprise when the commit objects are received. When the validation identifies errors, the git push command will fail showing:

  • 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 config repo is to fix the syntax error in the file.

IMPORTANT

  • When the validator rejects your commit in the UI, the commit is NOT pushed to Github Enterprise.
  • You MUST fix the errors in the file you're changing before trying commit the change in the UI.

Fixing Errors

When problems are found in your commit, the only option for you is to fix the problem in the UI editor and try to commit again.

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