-
Notifications
You must be signed in to change notification settings - Fork 3
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
NIX Validator #33
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e579433
to
facfa95
Compare
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.
7ecf133
to
fb28bf2
Compare
SuccessBadge, WarningBadge, etc.
fb28bf2
to
bcae973
Compare
- Add NIX to list of supported validators. - Link to guide for adding more validation services.
mpsonntag
reviewed
Aug 22, 2019
log.ShowWrite("[Error] writing results file for '%s'", repopath) | ||
switch validator { | ||
case "bids": | ||
err = validateBIDS(valroot, resdir) |
There was a problem hiding this comment.
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 appropriateerror
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.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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()
andrenderBIDSResults()
functions.