Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NIX Validator #33

Merged
merged 13 commits into from
Aug 23, 2019
Merged

NIX Validator #33

merged 13 commits into from
Aug 23, 2019

Conversation

achilleas-k
Copy link
Member

This PR mostly consists of two new functions:

  • validateNIX(): Runs the nixio-tool validator on all NIX files in the repository (files ending in .nix).
  • renderNIXResults(): Renders the output of a NIX validation. Simply dumps the output inside <pre> tags on the page. In the future, we may add some parsing and formatting to highlight errors and warning differently.

The Dockerfile has been updated to install nixio-tool to the runner image.

BIDS specific code in the previous validation and results functions have has been moved to validateBIDS() and renderBIDSResults() functions.

@achilleas-k achilleas-k force-pushed the nix-validator branch 2 times, most recently from e579433 to facfa95 Compare August 22, 2019 15:03
All 'code' fields should be integers.
A validator function takes a repository path as argument.  This
repository path should be:
- Fully cloned with all annexed content available.
- At the commit required for the validation.

The validator function is responsible for:
- Reading a configuration file (if necessary) for the validator.
- Determining the level of success of the validation (success, error,
warning).
- Rendering the appropriate badge.
- Saving the results to a file.
- Symlinking 'latest' to the newly created results.

Each validation run creates a directory based on the SHA1 of the commit
being validated.  This will help skip subsequent runs of the same
commit.  Since in the current state, the service expects a directory
called 'latest', we symlink 'latest' to the newest commit each time so
it directs to the latest run, but we keep all the previous results
around.
log.ShowWrite("[Error] writing results file for '%s'", repopath)
switch validator {
case "bids":
err = validateBIDS(valroot, resdir)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably restructure the validation process

  • Once a validation has started, the service should create a processing badge for the commit and return, so the user does not have to wait until cloning and validation is done (which might take some time).
  • Currently a validation process never returns an error. If something goes wrong during the validation an error should be returned here; if an error is present, the service should then replace the processing badge with an appropriate error badge. If no error is present it is assumed that the build went through and an appropriate badge has been created by the validation process.

@mpsonntag mpsonntag merged commit a612bd8 into G-Node:master Aug 23, 2019
@achilleas-k achilleas-k deleted the nix-validator branch August 23, 2019 14:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants