Skip to content

Commit

Permalink
docs(contributing): add additional step in the feature flags section (#…
Browse files Browse the repository at this point in the history
…21074)

[Follow-Up to this Comment.](#20521 (comment))
> Can you also add this info [here](https://github.com/aws/aws-cdk/blob/68f09b7c6f8e6c1ddf13fdd4e116d12333d24c46/packages/%40aws-cdk/cx-api/README.md?plain=1#L14)? We haven't found the best way to document these yet so until then I figure that will have to do.

In the contributing documentation for the feature flags the part for adding an entry in the feature flags README was added in this PR.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
daschaa authored Jul 14, 2022
1 parent 47ee16c commit ab7cff6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,16 @@ The pattern is simple:
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/lib/features.ts).
This map is inserted to generated `cdk.json` files for new projects created
through `cdk init`.
4. In your tests, use the `testFutureBehavior` and `testLegacyBehavior` [jest helper methods] to test the enabled and disabled behavior.
5. In your PR title (which goes into CHANGELOG), add a `(under feature flag)` suffix. e.g:
4. Add an entry for your feature flag in the [README](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/README.md) file.
5. In your tests, ensure that you test your feature with and without the feature flag enabled. You can do this by passing the feature flag to the `context` property when instantiating an `App`.
```ts
const myFeatureFlag = { [cxapi.MY_FEATURE_FLAG]: true };
const app = new App({
context: myFeatureFlag,
}),
const stackUnderTest = new Stack(app);
```
7. In your PR title (which goes into CHANGELOG), add a `(under feature flag)` suffix. e.g:

`fix(core): impossible to use the same physical stack name for two stacks (under feature flag)`

Expand Down

0 comments on commit ab7cff6

Please sign in to comment.