|
| 1 | +# Node.js Discord Status Worker Contributing Guide |
| 2 | + |
| 3 | +In short, all changes should ideally be contributed to the [upstream worker](https://github.com/WalshyDev/cf-status-worker) first, with the [`$COMMIT_SHA` in `clone.sh`](./clone.sh) then being updated to the latest commit in the upstream repository. The only exceptions to this are changes to the [`clone.sh`](./clone.sh) script itself, or configuration changes in the Worker's [`wrangler.toml`](./worker/wrangler.toml) and [`src/config.ts`](./worker/src/config.ts) files. |
| 4 | + |
| 5 | +## Updating the upstream worker |
| 6 | + |
| 7 | +To update the version of the upstream worker used by this repository, follow these steps: |
| 8 | + |
| 9 | +- Update the `$COMMIT_SHA` in the [`clone.sh`](./clone.sh) script to the latest commit in the upstream repository. |
| 10 | +- Run the [`clone.sh`](./clone.sh) script to update the worker. |
| 11 | +- Validate that the patches in the [`patches`](./patches) directory applied successfully. |
| 12 | +- Commit the change to `clone.sh`, any patches, and the updated worker source code. |
| 13 | +- Create a pull request to merge the changes into the `main` branch. |
| 14 | + |
| 15 | +## Updating the worker configuration |
| 16 | + |
| 17 | +To update the configuration of the worker, follow these steps: |
| 18 | + |
| 19 | +- Update the configuration in the [`wrangler.toml`](./worker/wrangler.toml) and [`src/config.ts`](./worker/src/config.ts) files. |
| 20 | +- From within the `worker`, run `GIT_DIR=../.git.worker git diff -- wrangler.toml src/config.ts > ../patches/config.patch` to update the patch file. |
| 21 | +- Commit the change to the configuration and the updated patch file. |
| 22 | +- Create a pull request to merge the changes into the `main` branch. |
| 23 | + |
| 24 | +## Updating the worker source code |
| 25 | + |
| 26 | +It is highly encouraged that any changes to the logic of the worker be contributed to the [upstream worker](https://github.com/WalshyDev/cf-status-worker) first. If this is not possible, follow these steps: |
| 27 | + |
| 28 | +- Make the changes to the worker source code. |
| 29 | +- From within the `worker` directory, run `GIT_DIR=../.git.worker git diff -- <modified files> > ../patches/<group>.patch` to update the patch file. |
| 30 | + - `<modified files>` should be replaced with the files that were modified. |
| 31 | + - `<group>` should be a one (or few) word summary grouping the changed files. |
| 32 | +- If a modified file is included in another existing patch, it should either be removed from that file, or that patch should be updated to include the changes instead. A file should only be present in one patch. |
| 33 | +- Commit the change to the worker source code and the new/updated patch file(s). |
| 34 | +- Create a pull request to merge the changes into the `main` branch. |
| 35 | + |
| 36 | +## Developer's Certificate of Origin 1.1 |
| 37 | + |
| 38 | +``` |
| 39 | +By contributing to this project, I certify that: |
| 40 | +
|
| 41 | +- (a) The contribution was created in whole or in part by me and I have the right to |
| 42 | + submit it under the open source license indicated in the file; or |
| 43 | +- (b) The contribution is based upon previous work that, to the best of my knowledge, |
| 44 | + is covered under an appropriate open source license and I have the right under that |
| 45 | + license to submit that work with modifications, whether created in whole or in part |
| 46 | + by me, under the same open source license (unless I am permitted to submit under a |
| 47 | + different license), as indicated in the file; or |
| 48 | +- (c) The contribution was provided directly to me by some other person who certified |
| 49 | + (a), (b) or (c) and I have not modified it. |
| 50 | +- (d) I understand and agree that this project and the contribution are public and that |
| 51 | + a record of the contribution (including all personal information I submit with it, |
| 52 | + including my sign-off) is maintained indefinitely and may be redistributed consistent |
| 53 | + with this project or the open source license(s) involved. |
| 54 | +``` |
0 commit comments