Evaluates constraints (meta-rules) on every commit to a project and integrates with the ProjectRepositoryWidget to display the results. The results are stored in mongodb, see below for how to configure mongo-uri etc.
Details about violations can be viewed for each commit.
Using the webgme-cli the following pieces can be imported (execute from root of repository)...
This should not be executed by the webhook only and will return an error at invocation from the UI.
webgme import plugin ConstraintChecker webgme-constraint-checker
The is visualizer is a commit-badge show the status of the checks - to integrate it with the ProjectRepositoryWidget see below.
webgme import viz ConstraintCheckerCommitBadge webgme-constraint-checker
The router forwards result/status requests ensuring the user has the right access (route is used by the visualizer).
webgme import router ConstraintResults webgme-constraint-checker
To run the webhook first make sure you've enabled webhooks in your gmeConfig, config.webhooks.enable = true;
. Then add a reference to webhook in the package.json under scripts:
"scripts": {
"webgme-constraint-checker": "webgme-constraint-checker"
},
Finally invoke npm run webgme-constraint-checker
from your repository's root directory.
The default configuration is available at components.json. If your repo does not have a config/components.json
or the json lacks the key 'ConstraintCheckerHook'
the default will be used.
If you intend to make your own configuration make sure to copy all the keys.
In order to add the commit-badge to the project repository widget copy over the settings at GenericUIProjectRepositoryWidget
inside the components.json.
npm run hook
and npm start
.
npm version 1.0.0 -m "Release %s"
git push origin master
git checkout v1.0.0
git push origin v1.0.0
npm publish ./