You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+54-19Lines changed: 54 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,23 +106,65 @@ All commits should be tagged. Tags are denoted by square brackets (`[]`) and com
106
106
In general almost all commits should fall into one of the above categories. In the cases where they don't please submit
107
107
your PR untagged.
108
108
109
-
#### Developing a New Feature with Feature Flags
109
+
#### Developing a New Feature with in-progress-feature Flags
110
110
111
-
Sometimes a new feature will require use of a feature flag.
111
+
Sometimes a new feature can't be completed all at once, but portions
112
+
of it can be landed to help parallelize the effort and make the review
113
+
process simpler.
112
114
113
-
Feature flags allow new features to be tested in dev builds, but
114
-
the features are stripped out of production builds automatically.
115
+
`in-progress-feature` flags allow for code to be present on the `master`
116
+
branch but stripped from any build that isn't.
115
117
116
-
1. Add your new feature flag to the [config/features.json](https://github.com/emberjs/data/blob/master/config/features.json) file.
118
+
These flags have three states. Locally here means that a developer is
119
+
working within the `addon` itself. Locally linking `ember-data` to
120
+
another project or using a `master` build will not make code behind
121
+
the flags available unless `isDevelopingAddon` in `index.js` is modified
122
+
to return `true`.
123
+
124
+
-`false`: the feature is only available locally and the code behind the
125
+
flag is stripped at all times and never included in test runs. To develop
126
+
on this feature use `--enable-in-progress-flag="desired-flag-name,another-flag-name"`
127
+
when running a command. This flag will never be active in `CI` jobs
128
+
meaning that both tests and code wrapped in a check for this flag will
129
+
not run.
130
+
131
+
-`null`: The same as `false` except the `Enabled In-Progress Features`
132
+
job in `CI` will activate the flag to ensure it passes tests.
133
+
Use this for features that are nearing delivery and need protection
134
+
against regressions but are not quite polished off yet.
135
+
136
+
Other test runs and `CI` will still default the flag to `false` to ensure
137
+
that what we would release (were we to release master) works as
138
+
expected.
139
+
140
+
The `--enable-in-progress` flag and the Travis Job `Enabled In-Progress Features`
141
+
will run the tests with any flags set to `null` enabled to prevent
142
+
regressions.
143
+
144
+
-`true`: Indicates that this feature is "complete". Features set to
145
+
`true` will be included in any `release` published while the flag
146
+
is in that state, any build from `master` and all `CI` jobs.
147
+
148
+
This is a sign that the feature has entered a final testing phase
149
+
and the in-progress flags for the feature should be removed
150
+
before a stable release is published.
151
+
152
+
Sometimes a nearly releasable feature may encounter problems late
153
+
in the release cycle. For such problems, the flag should be moved
154
+
back to the `null` state prior to doing a release.
155
+
156
+
Versions published with a flag set to `true` will include that
157
+
feature.
158
+
159
+
1. Add your new feature flag to the [config/in-progress-features.json](https://github.com/emberjs/data/blob/master/config/in-progress-features.json) file with the `ds-` prefix.
117
160
118
161
```js
119
162
{
120
-
"ds-boolean-transform-allow-null":null,
121
-
"ds-mynew-feature":null
163
+
"ds-mynew-feature":false
122
164
}
123
165
```
124
166
125
-
Give it a default of `null` so it will not be used in production builds.
167
+
Give it a default of `false` so it will not be used in production builds.
126
168
127
169
2. Import `isEnabled` from `ember-data/-private`, wrapping any new
128
170
code with your feature:
@@ -152,19 +194,12 @@ if (isEnabled('ds-mynew-feature')) {
152
194
153
195
This will ensure these feature tests are only run when then feature is included in the build for `ember-data`.
154
196
155
-
4. Running tests with all feature flags enabled is possible via
156
-
`ember test --environment=test-optional-features` This is also possible while
157
-
running tests in the browser via the `Enable Opt Feature` checkbox.
158
-
159
-
5. Add your feature to the [Features](https://github.com/emberjs/data/blob/master/FEATURES.md) file.
160
-
Be sure to leave a description of the feature and possible example of how to
161
-
use it (if necessary).
162
-
163
-
For more information about commit prefixes see [Commit Tagging](#commit-tagging).
197
+
4. Commit your work. For more information about commit prefixes see [Commit Tagging](#commit-tagging).
164
198
165
-
6. Push to your fork and submit a pull request. Please provide us with some
199
+
5. Push to your fork and submit a pull request. Please provide us with some
166
200
explanation of why you made the changes you made. For new features make sure to
167
-
explain a standard use case to us.
201
+
explain a standard use case to us. Use the commit tagging guidelines for the PR
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0 commit comments