Skip to content

Commit d928c38

Browse files
Update release steps
1 parent d746cf6 commit d928c38

File tree

3 files changed

+92
-84
lines changed

3 files changed

+92
-84
lines changed

CONTRIBUTING.md

+2-66
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
> feature request, you are agreeing to comply with this waiver of copyright interest.
66
> Details can be found in our [TERMS](TERMS.md) and [LICENCE](LICENSE).
77
8-
98
There are two primary ways to help:
10-
- Using the issue tracker, and
11-
- Changing the code-base.
129

10+
- Using the issue tracker, and
11+
- Changing the code-base.
1312

1413
## Using the issue tracker
1514

@@ -21,7 +20,6 @@ Use the issue tracker to find ways to contribute. Find a bug or a feature, menti
2120
the issue that you will take on that effort, then follow the _Changing the code-base_
2221
guidance below.
2322

24-
2523
## Changing the code-base
2624

2725
Generally speaking, you should fork this repository, make changes in your
@@ -30,65 +28,3 @@ tests that validate implemented features and the presence or lack of defects.
3028
Additionally, the code should follow any stylistic and architectural guidelines
3129
prescribed by the project. In the absence of such guidelines, mimic the styles
3230
and patterns in the existing code-base.
33-
34-
## Release management
35-
36-
Ready to publish changes to npm?
37-
38-
### Config prep:
39-
1. If you don't have a `.env` file,
40-
copy it from the sample file with `cp .env_SAMPLE .env`.
41-
2. Add a `GITHUB_TOKEN` in your `.env` file (see
42-
https://github.com/settings/tokens/new?scopes=repo&description=ccdb-release-it
43-
to create the token value).
44-
Set the desired token expiry length and click generate.
45-
3. You need to be part of the collaborators for
46-
https://www.npmjs.com/package/@cfpb/ccdb5-ui.
47-
Ask a member of the [consumerfinance.gov](https://github.com/cfpb/consumerfinance.gov) team if you are not.
48-
49-
50-
### Steps:
51-
1. Ensure you're on `main` and `git pull` to confirm you're up-to-date.
52-
2. Run `yarn run build` to ensure you have the latest built artifacts for npm.
53-
Commit any changes to `/dist/` directory files to `main`.
54-
3. Source your `.env` with `source ./.env` (if `GITHUB_TOKEN` in unset).
55-
4. Log into npm with `npm login` (if not already logged in).
56-
5. Run `yarn run release` to start the release.
57-
This'll run the build scripts to copy the latest JS into
58-
the `dist` directory. It then uses
59-
[release-it](https://github.com/release-it/release-it/) to publish to
60-
npm and create a GitHub tag.
61-
6. Manually create an entry in the GitHub releases changelog by visiting
62-
https://github.com/cfpb/ccdb5-ui/releases and clicking "Draft a new release":
63-
- Choose the latest tag generated by the release script in the prior step.
64-
- Title the release the same as the release version.
65-
- Click "Auto-generate release notes" or manually enter release notes.
66-
- Click "Publish release"
67-
68-
69-
### Post-publish steps in consumerfinance.gov
70-
1. Navigate to the root directory of the
71-
[consumerfinance.gov](https://github.com/cfpb/consumerfinance.gov) repo.
72-
2. Create a new branch.
73-
3. Move to CCDB asset app directory with `cd cfgov/unprocessed/apps/ccdb-search/`.
74-
4. `npx yarn-check -u` and update to the latest ccdb5-ui version.
75-
5. Commit the changes to the npm package and node cache.
76-
6. Open a Pull Request from the branch for review.
77-
78-
79-
### Troubleshooting
80-
- `yarn run release` can't find https://www.npmjs.com/package/@cfpb/ccdb5-ui
81-
and doesn't succeed.
82-
- You're probably not an npm maintainer on the ccdb5-ui project.
83-
Reach out to a core consumerfinance.gov member to get access.
84-
- When updating the package in the consumerfinance.gov repo you get a message
85-
similar to "Cannot download package in offline mode."
86-
- This is likely an outdated cache issue, perform the following:
87-
- Delete `cfgov/unprocessed/apps/ccdb-search/npm-packages-offline-cache`
88-
- Delete `cfgov/unprocessed/apps/ccdb-search/node_modules`
89-
- Delete `cfgov/unprocessed/apps/ccdb-search/yarn.lock`
90-
- Temporarily edit the root directory `.yarnrc` file
91-
and remove the last two lines and save.
92-
- Run `yarn cache clean; yarn install`
93-
from `cfgov/unprocessed/apps/ccdb-search/`.
94-
- Re-add the last two lines to the root `.yarnrc` file.

README.md

+89-17
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
This application allows consumers to search complaints submitted to the CFPB by other consumers.
55

66
#### Technology Stack
7+
78
This application is written in JavaScript and [Less](http://lesscss.org) within
89
the [React](https://facebook.github.io/react/) + [Redux](http://redux.js.org/)
9-
framework. It uses [Webpack](http://webpack.github.io/docs/) at runtime to
10+
framework. It uses [Webpack](http://webpack.github.io/docs/) at runtime to
1011
manage module loading.
1112

1213
The code is written with the [ES6](http://es6-features.org/) feature set
@@ -20,6 +21,7 @@ Unit testing of the application is performed within
2021
[yarn](https://yarnpkg.com/) is used to manage the build/test/deploy cycle.
2122

2223
#### Screenshot
24+
2325
![screen August 17, 2017](documentation/screenshot.png)
2426

2527
## Dependencies
@@ -48,19 +50,20 @@ Please see the subsection Configuring in [INSTALL](INSTALL.md#configuring)
4850
#### Developing code
4951

5052
###### Prerequisites
53+
5154
This application depends on the [Public Complaints API](https://github.com/cfpb/ccdb5-api)
5255
to be available.
5356

5457
For local development, you will need to the following:
5558

56-
* [Run consumerfinance.gov locally (which includes the API)](https://github.com/cfpb/consumerfinance.gov#quickstart).
57-
* [Fill the local Elasticsearch with data](https://github.com/cfpb/ccdb-data-pipeline/blob/main/INSTALL.md).
59+
- [Run consumerfinance.gov locally (which includes the API)](https://github.com/cfpb/consumerfinance.gov#quickstart).
60+
- [Fill the local Elasticsearch with data](https://github.com/cfpb/ccdb-data-pipeline/blob/main/INSTALL.md).
5861

59-
***Note:*** The Public Complaints API runs as part of consumerfinance.gov, but you can run the API as an independent app:
62+
**_Note:_** The Public Complaints API runs as part of consumerfinance.gov, but you can run the API as an independent app:
6063

61-
* Ensure the consumerfinance.gov python container is stopped with `docker-compose stop python`.
62-
* [Install the API](https://github.com/cfpb/ccdb5-api#setup--running) and run it with `python manage.py runserver`.
63-
* Edit [`env.js`](https://github.com/cfpb/ccdb5-ui/blob/main/config/env.js#L104) to point `ccdbApiUrl.dev` to the locally running API (likely at `http://localhost:8000/`).
64+
- Ensure the consumerfinance.gov python container is stopped with `docker-compose stop python`.
65+
- [Install the API](https://github.com/cfpb/ccdb5-api#setup--running) and run it with `python manage.py runserver`.
66+
- Edit [`env.js`](https://github.com/cfpb/ccdb5-ui/blob/main/config/env.js#L104) to point `ccdbApiUrl.dev` to the locally running API (likely at `http://localhost:8000/`).
6467

6568
###### Code-Build cycle
6669

@@ -80,6 +83,7 @@ Enter `Control-C` to exit development mode
8083
## How to test the software
8184

8285
#### Unit testing
86+
8387
To launch the JavaScript test runner in interactive watch/test mode:
8488

8589
```bash
@@ -100,9 +104,11 @@ Timeouts and the local `baseUrl` are set in cypress.json
100104
### To run Cypress tests locally
101105

102106
- Set your node env to development:
107+
103108
```bash
104109
export NODE_ENV=development
105110
```
111+
106112
You can run the tests in headless mode and just see results, or you can open the Cypress test-runner, which lets you choose tests and watch them run in a Chrome browser. Having the live browser allows you to see page state during tests, and you can open Chrome dev tools to check console errors and network requests.
107113

108114
To run local tests and just see results:
@@ -124,6 +130,7 @@ yarn run cypress open --browser chrome
124130
```
125131

126132
### To run against a server
133+
127134
You can also run Cypress tests against a server by passing a `baseUrl` config with the path to the server's consumer complaints search page.
128135

129136
**Note**: If you run against a server that has Django's `DEBUG=False` setting,
@@ -134,6 +141,70 @@ Our internal DEV servers can be deployed with `DEBUG=True` for running Cypress t
134141
yarn run cypress run --browser chrome --headless --config baseUrl=https://[DEV SERVER URL]/data-research/consumer-complaints/search/
135142
```
136143

144+
## Release management
145+
146+
Ready to publish changes to npm?
147+
148+
### Config prep:
149+
150+
1. If you don't have a `.env` file,
151+
copy it from the sample file with `cp .env_SAMPLE .env`.
152+
2. Add a `GITHUB_TOKEN` in your `.env` file (see
153+
https://github.com/settings/tokens/new?scopes=repo&description=ccdb-release-it
154+
to create the token value).
155+
Set the desired token expiry length and click generate.
156+
3. You need to be part of the collaborators for
157+
https://www.npmjs.com/package/@cfpb/ccdb5-ui.
158+
Ask a member of the [consumerfinance.gov](https://github.com/cfpb/consumerfinance.gov) team if you are not.
159+
160+
### Steps:
161+
162+
1. Ensure you're on `main` and `git pull` to confirm you're up-to-date.
163+
2. Run `yarn run build` to ensure you have the latest built artifacts for npm.
164+
Commit any changes to `/dist/` directory files to `main`.
165+
3. Source your `.env` with `source ./.env` (if `GITHUB_TOKEN` in unset).
166+
4. Log into npm with `npm login` (if not already logged in).
167+
5. Run `yarn run release` to start the release.
168+
This'll run the build scripts to copy the latest JS into
169+
the `dist` directory. It then uses
170+
[release-it](https://github.com/release-it/release-it/) to publish to
171+
npm and create a GitHub tag.
172+
6. Manually create an entry in the GitHub releases changelog by visiting
173+
https://github.com/cfpb/ccdb5-ui/releases and clicking "Draft a new release":
174+
- Choose the latest tag generated by the release script in the prior step.
175+
- Title the release the same as the release version.
176+
- Click "Auto-generate release notes" or manually enter release notes.
177+
- Click "Publish release"
178+
179+
### Post-publish steps in consumerfinance.gov
180+
181+
1. Navigate to the root directory of the
182+
[consumerfinance.gov](https://github.com/cfpb/consumerfinance.gov) repo.
183+
2. Create a new branch.
184+
3. Move to CCDB asset app directory with `cd cfgov/unprocessed/apps/ccdb-search/`.
185+
4. `npx yarn-check -u` and update to the latest ccdb5-ui version.
186+
5. Commit the changes to the npm package and node cache.
187+
6. Open a Pull Request from the branch for review.
188+
189+
### Troubleshooting
190+
191+
- Ensure your npm version is up-to-date.
192+
- `yarn run release` can't find https://www.npmjs.com/package/@cfpb/ccdb5-ui
193+
and doesn't succeed.
194+
- You're probably not an npm maintainer on the ccdb5-ui project.
195+
Reach out to a core consumerfinance.gov member to get access.
196+
- When updating the package in the consumerfinance.gov repo you get a message
197+
similar to "Cannot download package in offline mode."
198+
- This is likely an outdated cache issue, perform the following:
199+
- Delete `cfgov/unprocessed/apps/ccdb-search/npm-packages-offline-cache`
200+
- Delete `cfgov/unprocessed/apps/ccdb-search/node_modules`
201+
- Delete `cfgov/unprocessed/apps/ccdb-search/yarn.lock`
202+
- Temporarily edit the root directory `.yarnrc` file
203+
and remove the last two lines and save.
204+
- Run `yarn cache clean; yarn install`
205+
from `cfgov/unprocessed/apps/ccdb-search/`.
206+
- Re-add the last two lines to the root `.yarnrc` file.
207+
137208
## Getting help
138209

139210
If you have questions, concerns, bug reports, etc, please file an issue in this
@@ -143,23 +214,24 @@ repository's [Issue Tracker](https://github.com/cfpb/ccdb5-ui/issues).
143214

144215
[CONTRIBUTING](CONTRIBUTING.md).
145216

146-
----
217+
---
147218

148219
## Open source licensing info
220+
149221
1. [TERMS](TERMS.md)
150222
2. [LICENSE](LICENSE)
151223
3. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)
152224

153-
154-
----
225+
---
155226

156227
## Links that were helpful
157228

158229
#### React-Redux
159-
* https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree
160-
* https://medium.com/lexical-labs-engineering/redux-best-practices-64d59775802e
161-
* https://medium.com/@kylpo/redux-best-practices-eef55a20cc72
162-
* https://github.com/markerikson/react-redux-links/blob/main/tips-and-best-practices.md
163-
* https://getstream.io/blog/react-redux-best-practices-gotchas/
164-
* https://tech.affirm.com/redux-patterns-and-anti-patterns-7d80ef3d53bc
165-
* https://github.com/gaearon/redux-devtools
230+
231+
- https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree
232+
- https://medium.com/lexical-labs-engineering/redux-best-practices-64d59775802e
233+
- https://medium.com/@kylpo/redux-best-practices-eef55a20cc72
234+
- https://github.com/markerikson/react-redux-links/blob/main/tips-and-best-practices.md
235+
- https://getstream.io/blog/react-redux-best-practices-gotchas/
236+
- https://tech.affirm.com/redux-patterns-and-anti-patterns-7d80ef3d53bc
237+
- https://github.com/gaearon/redux-devtools

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"build": "node scripts/build.js",
2121
"dev-flow": "node scripts/test.js --env=jsdom --coverage --watch",
2222
"lint": "yarn prettier \"src/**/*.{js,jsx,ts,tsx,json,md}\" --write && yarn eslint ./src --fix && yarn stylelint \"src/**/*.{css,less}\" --fix",
23-
"release": "yarn run build && release-it --only-version --npm.skipChecks",
23+
"release": "yarn run build && release-it --npm.skipChecks",
2424
"start": "node scripts/start.js",
2525
"test": "node scripts/test.js --env=jsdom --coverage",
2626
"lint:cypress": "yarn eslint ./cypress --fix"

0 commit comments

Comments
 (0)