$30 off During Our Annual Pro Sale. View Details »

Contributing to Ember

Contributing to Ember

Confused about how the release process works? Curious what the heck feature flags are? Wondering which commit prefix you should use for your latest pull request? This talk answers these questions (and many more).

It includes insights into the release process, feature flagging, the build process, which commit prefixes to use, and how to create custom builds with features enabled by default.

Robert Jackson

March 25, 2014
Tweet

More Decks by Robert Jackson

Other Decks in Programming

Transcript

  1. Contributing
    to Ember
    THE INSIDE SCOOP
    http://flic.kr/p/gQ8PaV

    View Slide

  2. Who the heck is this guy?
    ● Ember Release Management Team
    ● Frequent Ember.js Contributor
    ● General OSS addict
    twitter: rwjblue
    github: rjackson

    View Slide

  3. About DockYard
    ● Hosting WickedGoodEmber conference
    (register at wickedgoodember.com)
    ● Contact us at dockyard.com.

    View Slide

  4. Why is Ember Awesome?

    View Slide

  5. Why is Ember Awesome?
    Collection of Concepts/Ideas
    (possibly the only JS “Framework”)

    View Slide

  6. Why is Ember Awesome?
    ● Community
    ● We need your ideas/contributions!
    ● Current at 330+ Contributors

    View Slide

  7. Okay, how can I help?
    ● Fix / Cleanup documentation
    ● Report and/or Fix Bugs you Find
    ● Submit new features

    View Slide

  8. Documentation
    https://flic.kr/p/5mgRqa

    View Slide

  9. Helping with Docs
    ● Often, thankless.
    ● THANK YOU!
    ● Prefix Commit

    View Slide

  10. Commit Prefix - Docs
    ● `[DOC] Fixed typo in blah.`
    ● `[DOC beta] Fixed typo in blah.`
    ● `[DOC release] Fixed typo in blah.`

    View Slide

  11. Bug-fixes
    https://flic.kr/p/2xvHcU

    View Slide

  12. Its messed up, lemme fix it
    ● Add test showing regression
    ● Fix issue
    ● Prefix commit

    View Slide

  13. Commit Prefix - Bug-fixes
    ● `[FEATURE ember-metal-zomg] Fix blah`
    ● `[BUGFIX beta] Fix dummy`
    ● Only severe regressions will be pulled into
    release channel.

    View Slide

  14. Unless its a security vuln...
    ● Email [email protected]
    ● Work with the Core Team on a fix
    ● Read the full policy at: emberjs.com/security

    View Slide

  15. Features
    https://flic.kr/p/4CrXVC

    View Slide

  16. Huh, what are features?
    ● New API’s
    ● Backwards compat changes to API’s
    ● Hidden behind a feature flag

    View Slide

  17. What is a feature flag?
    It’s just an `if` block used by the build process.

    View Slide

  18. Why Feature Flags?
    ● Keep releases stable
    ● Allow faster iteration
    ● Help ensure SemVer

    View Slide

  19. How does it work?
    ● `defeatureify` processes builds
    ● Can strip flagged code

    View Slide

  20. What is enabled?
    Check the `features.json` file.

    View Slide

  21. What does this mean?
    `true`
    `false`
    `null`
    Enable & remove flags
    Disable & remove
    Disable & leave

    View Slide

  22. Features in Channels
    Channel Flags In Build
    Canary Yes
    Beta No
    Release No

    View Slide

  23. Can I enable features in
    beta/release builds?
    YES!!!
    But you may not want to…

    View Slide

  24. YES, PLEASE DO!!!
    Testers welcome, the more the
    merrier!
    Can I enable features in
    canary builds?

    View Slide

  25. Awesome, how do I do it?
    EmberENV = {
    FEATURES: {
    'query-params-new': true
    }
    };

    View Slide

  26. How can I contribute one?
    ● Add to features.json (null value)
    ● Add to FEATURES.md
    ● Hide changes behind flags
    ● Good tests (also behind flags)
    ● Prefix commit

    View Slide

  27. Choosing flag name
    Package Name + Short Feature Name
    `ember-metal-zomg`

    View Slide

  28. Add to features.json
    ● Add as last line
    ● Set value to `null`
    ● Rebase on EVERY change

    View Slide

  29. Add to FEATURES.md
    Add an entry with a clear description.
    Include PR link for further reading.

    View Slide

  30. Hide changes behind flags:
    if (Ember.FEATURES.isEnabled('ember-metal-zomg')){
    // Your feature code here
    } else {
    // Code to execute when disabled
    }

    View Slide

  31. Check the “Enable Opt Features” check box in
    the QUnit UI.
    How do I run the tests?

    View Slide

  32. Commit Prefix - Features
    Use FEATURE + feature name:
    `[FEATURE ember-metal-zomg]`

    View Slide

  33. Merge me, pretty please?
    ● Review takes time
    ● Please be patient
    ● Please be polite :D

    View Slide

  34. OK, its merged, now what?
    ● Security Audit
    ● Reviewed by Core Team
    ● Go/No-Go Decision

    View Slide

  35. Release Cycle
    https://flic.kr/p/7JxoN6

    View Slide

  36. Process
    ● 3 Channels
    ● 6 Week Release Cycles

    View Slide

  37. Canary
    ● New Features
    ● Bugfixes
    ● tldr; Everything

    View Slide

  38. Beta
    ● Branched from Canary
    ● Bug fixes
    ● Doc updates
    ● Weekly Releases

    View Slide

  39. Release
    ● Branched from Beta
    ● Doc updates
    ● Major Regressions
    ● Security Fixes

    View Slide

  40. Commit Prefix Recap
    https://flic.kr/p/7Zd6BJ

    View Slide

  41. Commit Prefix - Recap
    [DOC channel] Message.
    [BUGFIX channel] Message.
    [FEATURE feature-name]
    [SECURITY CVE-111-1111]

    View Slide

  42. [DOC channel]
    ● Use for documentation changes.
    ● Target affected channel.

    View Slide

  43. [BUGFIX channel]
    ● Use for bug-fixes (duh).
    ● Target affected channel
    ● Only severe bugs will warrant new
    tag/release.

    View Slide

  44. [FEATURE feature-name]
    ● Use for new features
    ● Use for bug-fixes to features.

    View Slide

  45. [SECURITY CVE-000-0000]
    ● Used exclusively by security team
    ● Simultaneous publishing and release

    View Slide

  46. Contributions welcome!
    Seriously, I mean it.
    https://flic.kr/p/AApJr

    View Slide

  47. Thank You
    Knowing is half the battle...

    View Slide