Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Good 7.0.0 Release Notes #467

Closed
arb opened this issue Apr 12, 2016 · 2 comments
Closed

Good 7.0.0 Release Notes #467

arb opened this issue Apr 12, 2016 · 2 comments

Comments

@arb
Copy link
Contributor

@arb arb commented Apr 12, 2016

⚠️ This doc may change slightly as this is for a release candidate. Important changes will be called out in the document comments. This issue will remain open until version 7 has been published. ⚠️

Summary

The goal of the 7.0.0 release was to change the reporter interface to use standard node streams and pipes. No more custom interface. This allows developers more control of their needs and broadens the reporter options to any transform or write stream in the node ecosystem.

None of the good-* reporters have their "latest" tags updated (yet). For example, to install the latest version of good-console, you would need to do npm install good-console@6.0.0. Just npm install good-console will give you the 5.x.x version which is not compatible with the good release candidate.

  • Upgrade time: medium - you'll just have to change your config options into good and specifically the reporter options.
  • Complexity: low - change your options and your version of hapi.
  • Risk: moderate - as a major bump, there is always an amount of risk.
  • Dependencies: high - all of the good-reporter will have to be updated to newest versions that adhere to the new pipe interface.

Breaking Changes

  • Removed requestHeaders, requestPayload, and responsePayload. Replaced with includes.request and includes.response.
  • Support for Node 4.x.x and hapi >= 10.x.x
  • Completely overhauled the reporter interface to be a standard stream-and-pipe interface. More information about this can be found here
  • Every object payload to all the reporters now includes a config value that is the merge of request.route.settings.plugins.good and request.plugins.good.
  • "wreck" logging has been removed for the time being. It didn't work right and was inconsistent. Related issues here.
  • good used to expose itself via server.expose. This has been removed.
  • The lifecycle of when events occurred inside good has been slightly tweeked and is different than previous versions.
  • A "stop" event is no longer emitted from good.
  • The "censor" option has been removed. A simple transform stream to do this can easily be created.

New Features

  • More robust reporting options via to pipe and stream interface
  • Per route and request data to allow for more fine-tuned filtering and reporting
  • You can now disable ops reporting if you use something else for your setup

Updated Dependencies

  • hoek
  • joi
  • oppsy (new dep)
  • pumpify (new dep)

Migration

  • Change requestHeaders, requestPayload, and responsePayload to includes.request and includes.response.
  • Update major versions of all the reporters you are using. Make sure any stream in your reporter pipeline is a transform or write stream, NOT a specialized object for reporting.
  • Update your reporter options
var options = {
    reporters: [{
        reporter: require('good-file'),
        events: {
            request: '*'
        },
        config: './__log.log'
    }]
};

needs to be updated to

const options = {
    reporters: {
        file: [{
            module: 'good-squeeze',
            name: 'Squeeze',
            args: [{ request: '*' }]
        }, {
            module: 'good-squeeze',
            name: 'SafeJson'
        }, {
            module: 'good-file',
            args: ['./__log.log']
        }]
    }
};
@gr2m

This comment has been minimized.

Copy link

@gr2m gr2m commented Jun 16, 2016

@arb I’m sorry to bother, I tried to migrate our Good usage at Hoodie (hoodiehq/hoodie#478) but had no luck. We use it at a single place, for our logging: https://github.com/hoodiehq/hoodie/blob/master/server/plugins/logger.js

Would you mind giving us a few pointers on how to migrate to v7? I’d really appreciate it

@arb

This comment has been minimized.

Copy link
Contributor Author

@arb arb commented Jun 16, 2016

I'm not sure what you're asking? What is or is not working? What have you tried? Also, can you open a new issue? This is more just for book keeping reasons and not to add questions about new versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.