From eb251f751f6c727071a17e662297b1bc2c658428 Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Thu, 9 Jun 2016 17:58:21 +0200 Subject: [PATCH 1/2] npm install dredd@stable warning. --- package.json | 3 +++ scripts/print-installation-guidelines.coffee | 12 ++++++++++++ src/transaction-runner.coffee | 1 - 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 scripts/print-installation-guidelines.coffee diff --git a/package.json b/package.json index 821fd5878..92e0b85c4 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "dredd": "bin/dredd" }, "scripts": { + "postinstall": "coffee ./scripts/print-installation-guidelines.coffee", + "postupdate": "coffee ./scripts/print-installation-guidelines.coffee", "changelist": "github-changes -o apiaryio -r dredd --only-pulls --use-commit-body --file CHANGELOG-Generated.md -a", "lint": "coffeelint ./src", "docs:build": "mkdocs build", @@ -31,6 +33,7 @@ "chai": "^3.4.1", "clone": "^1.0.0", "coffee-script": "^1.10.0", + "colors": "^1.1.2", "dredd-transactions": "^1.2.0", "file": "~0.2.2", "gavel": "0.5.2", diff --git a/scripts/print-installation-guidelines.coffee b/scripts/print-installation-guidelines.coffee new file mode 100644 index 000000000..09608be41 --- /dev/null +++ b/scripts/print-installation-guidelines.coffee @@ -0,0 +1,12 @@ + +colors = require('colors') + +command = colors.bold(colors.yellow('npm install dredd@stable')) +console.error(colors.cyan(""" + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + :: :: + :: Install Dredd using #{command} in case you :: + :: prefer stability over new features (e.g. in CI) :: + :: :: + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +""")) diff --git a/src/transaction-runner.coffee b/src/transaction-runner.coffee index 2cd12e2e0..076b6f8df 100644 --- a/src/transaction-runner.coffee +++ b/src/transaction-runner.coffee @@ -81,7 +81,6 @@ class TransactionRunner # - runs beforeValidation hooks # - runs Gavel validation @executeTransaction transaction, hooks, () => - return iterationCallback(@hookHandlerError) if @hookHandlerError? # run afterEach hooks From 50b381a09eff27def0f502d2c3eac8d37317f8ea Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Thu, 9 Jun 2016 18:17:33 +0200 Subject: [PATCH 2/2] Docs regarding release tags. --- CONTRIBUTING.md | 15 +++++++++++++++ docs/overview.md | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c16193e1..eb3ca2d7d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,6 +49,20 @@ Also mind that CoffeeScript is production dependency (not dev dependency), because it's needed not only for compiling Dredd package before uploading to npm, but also for running user-provided hooks written in CoffeeScript. +### Versioning + +Dredd follows [Semantic Versioning][]. To ensure certain stability of Dredd installations (e.g. in CI builds), users can pin their version. They can also use release tags: + +- `npm install dredd` - Installs the latest published version including experimental pre-release versions. +- `npm install dredd@stable` - Skips experimental pre-release versions. Recommended for CI installations. + +When releasing, make sure you respect the tagging: + +- To release pre-release, e.g. `42.1.0-pre.7`, use just `npm publish`. +- To release any other version, e.g. `42.1.0`, use `npm publish && npm dist-tag add dredd@42.1.0 stable`. + +Hopefully this will be automated one day. + ### Testing Use `npm run test` or just `npm test` to run all tests. Use `npm run test:bdd` @@ -127,6 +141,7 @@ There are also some environment variables you could find useful: [Apiary]: https://apiary.io/ [API Blueprint]: http://apiblueprint.org/ +[Semantic Versioning]: http://semver.org/ [coffee-coverage]: https://github.com/benbria/coffee-coverage [coffeelint]: http://www.coffeelint.org/ [CoffeeScript]: http://coffeescript.org diff --git a/docs/overview.md b/docs/overview.md index 9fdf16b65..c320c3438 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -2,6 +2,13 @@ Dredd works by taking your API description document, creating expectations based on the requests and responses in the description, making requests to your API, and seeing if the responses match. Dredd automatically builds these expectations from the API description every time the tests are run. +## Versioning + +Dredd follows [Semantic Versioning][]. To ensure certain stability of your Dredd installation (e.g. in CI), pin the version accordingly. You can also use release tags: + +- `npm install dredd` - Installs the latest published version including experimental pre-release versions. +- `npm install dredd@stable` - Skips experimental pre-release versions. Recommended for CI installations. + ## Automatic Expectations Dredd automatically generates expectations on HTTP responses based on examples in the API description with use of [Gavel.js](https://github.com/apiaryio/gavel.js) library. Please refer to [Gavel](https://www.relishapp.com/apiary/gavel/docs) rules if you want know more. @@ -367,6 +374,7 @@ info: Resource > Update resource > Example 1 info: Resource > Update resource > Example 2 ``` +[Semantic Versioning]: http://semver.org/ [API Blueprint]: http://apiblueprint.org/ [Travis CI]: https://travis-ci.org/ [Gavel.js]: https://github.com/apiaryio/gavel.js