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
+67-25Lines changed: 67 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,21 +51,72 @@ Once you've built the project locally, you're ready to start making changes!
51
51
52
52
### Step 3: Branch
53
53
54
-
To keep your development environment organized, create local branches to hold your work. These should be branched directly off of the `main` branch. While naming branches, try to name it according to the bug it fixes or the feature it adds.
54
+
To keep your development environment organized, create local branches to hold your work. These should be branched directly off of the `develop` branch. While naming branches, try to name it according to the bug it fixes or the feature it adds. Also prefix the branch with the type of change it is making. Here is a list of common prefixes:
55
+
56
+
-`fix/`: A bug fix
57
+
-`feature/`: A new feature
58
+
-`docs/`: Documentation changes
59
+
-`perf/`: A code change that improves performance
60
+
-`refactor/`: A code change that neither fixes a bug nor adds a feature
61
+
-`test/`: A change to the tests
62
+
-`style/`: Changes that do not affect the meaning of the code (linting)
63
+
-`build/`: Bumping a dependency like node or express
To get a decent idea of how the code is organised and what happens where, the code is heavily commented to allow you to understand exactly what happens. Remember to always format the code using `prettier` once you're done.
71
+
To get a decent idea of how the code is organised and what happens where, the code is heavily commented to allow you to understand exactly what happens. Remember to always format the code using `xo` once you're done.
63
72
64
73
To test a change without building the executables, you can type `npm start` and it will run the server directly. Use an HTTP client like `httpie` or `postman` to test the API.
65
74
66
-
To check if the code is formatted correctly, run `npm run check-format`. To format the code using prettier, run `npm run format`.
75
+
### Step 5: Document
76
+
77
+
Once your changes are ready to go, begin the process of documenting your code. The code **must** be heavily commented, so future contributors can move around and make changes easily.
78
+
79
+
Make sure all the changes you make are in accordance with the [Files API Specifications](https://dabbu-knowledge-platform.github.io/files_api/). If you wish to make changes to the API specification itself, drop a message [here](https://github.com/dabbu-knowledge-platform/cli/discussions/categories/general) and we can start discussing the changes.
80
+
81
+
### Step 6: Test
82
+
83
+
Please ensure that all changes/additions come with tests. All PRs must have unit tests unless the maintainer says the PR is text-exempt.
84
+
85
+
If you are adding a new module, add the tests for that module in the `tests/module-tests/<provider id>-test.js`. If you added a utility function, add a test for it in `tests/utils-test.js`. If you modified the handling of an internal method such as the `cache` method, or listing, enabling and disabling providers, add the test to `tests/server-test.js`.
86
+
87
+
Before submitting your changes, please run the linter (`xo`) and all tests in the `tests/` folder:
88
+
89
+
```
90
+
npm test
91
+
```
92
+
93
+
Please ensure that:
94
+
95
+
- your code passes all lint checks (`xo`)
96
+
- your code passes all format checks (`prettier` run by xo)
97
+
- all existing and added tests pass. If the linter points out errors, try fixing them automatically by running:
98
+
99
+
```
100
+
npm run format
101
+
```
102
+
103
+
The linter will try its best to fix all issues, but certain issues require you to fix them manually.
104
+
105
+
If you need to disable any lint rules, please make sure that it is really necessary and there is absolutely no better way of writing that piece of code. Disable lint checks for a certain line by entering typing the following before that line:
106
+
107
+
```
108
+
// eslint-disable-next-line some-lint-rule-id
109
+
```
110
+
111
+
To disable lint checks for an entire file (not recommended), enter the following at the top of the file:
112
+
113
+
```
114
+
/* eslint some-lint-rule-id: 0 */
115
+
```
116
+
117
+
All existing and added tests **MUST** pass for the PR to land. If existing tests are already failing on the `develop` branch, ensure that no additional tests fail due to your changes. Note that **no PRs will be merged until the tests on the `develop` branch are fixed and all of them pass**.
67
118
68
-
### Step 5: Commit
119
+
### Step 7: Commit
69
120
70
121
It is recommended to keep your changes grouped logically within individual commits. Many contributors find it easier to review changes that are split across multiple commits. There is no limit to the number of commits in a pull request.
71
122
@@ -96,8 +147,9 @@ Common prefixes:
96
147
-`docs`: Documentation changes
97
148
-`perf`: A code change that improves performance
98
149
-`refactor`: A code change that neither fixes a bug nor adds a feature
150
+
-`test`: A change to the tests
99
151
-`style`: Changes that do not affect the meaning of the code (linting)
100
-
-`vendor`: Bumping a dependency like node or express
152
+
-`build`: Bumping a dependency like node or express
101
153
102
154
Other things to keep in mind when writing a commit message:
103
155
@@ -113,33 +165,23 @@ A commit that has the text `BREAKING CHANGE:` at the beginning of its optional b
113
165
114
166
See [conventionalcommits.org](https://conventionalcommits.org) for more details.
115
167
116
-
### Step 6: Rebase
168
+
### Step 8: Rebase
117
169
118
-
Once you have committed your changes, it is a good idea to use `git rebase` (_NOT`git merge`_) to synchronize your work with the main repository.
170
+
Once you have committed your changes, it is a good idea to use `git rebase` (NOT`git merge`) to synchronize your work with the develop branch.
119
171
120
172
```sh
121
173
$ git fetch upstream
122
-
$ git rebase upstream/main
174
+
$ git rebase upstream/develop
123
175
```
124
176
125
-
This ensures that your working branch has the latest changes from `dabbu-knowledge-platform/files-api-server` main.
126
-
127
-
### Step 7: Test
128
-
129
-
Bug fixes and features should always come with tests. Please test your own code adequately. Also, before finally pushing your code, clone it into a fresh environment (different user or maybe a different computer) and make sure it works just as fine. Make sure you test the executables in the `dist/` directory.
130
-
131
-
### Step 8: Document
132
-
133
-
Once your commits are ready to go - with adequate testing - begin the process of documenting your code. The code **must** be heavily commented, so future contributors can move around and make changes easily.
134
-
135
-
Make sure all the changes you make are in accordance with the [Files API Specifications](https://dabbu-knowledge-platform.github.io/files_api/). If you wish to make changes to the API specification itself, drop a message [here](https://github.com/dabbu-knowledge-platform/cli/discussions/categories/general) and we can start discussing the changes.
177
+
This ensures that your working branch has the latest changes from `dabbu-knowledge-platform/files-api-server` develop. If any conflicts arise, resolve them and commit the changes again.
136
178
137
179
### Step 9: Push
138
180
139
181
Once you have documented your code as required, begin the process of opening a pull request by pushing your working branch to your fork on GitHub.
140
182
141
183
```sh
142
-
$ git push origin add-awesome-new-feature
184
+
$ git push origin feature/add-awesome-new-feature
143
185
```
144
186
145
187
### Step 10: Opening the Pull Request
@@ -155,21 +197,21 @@ To make changes to an existing pull request, make the changes to your local bran
155
197
```sh
156
198
$ git add my/changed/files
157
199
$ git commit
158
-
$ git push origin add-awesome-new-feature
200
+
$ git push origin feature/add-awesome-new-feature
159
201
```
160
202
161
-
There are a number of more advanced mechanisms for managing commits using `git rebase` that can be used, but are beyond the scope of this guide.
203
+
There are a number of more advanced mechanisms for managing commits using `git rebase` that can be used, but are beyond the scope of this guide. Also, any branch that is being merged must be merged without fast forward, i.e., `git merge --no-ff ...`.
162
204
163
205
Feel free to post a comment in the pull request to ping reviewers if you are awaiting an answer on something.
164
206
165
207
**Approval and Request Changes Workflow**
166
208
167
-
All pull requests require approval from contributors in order to land. Whenever a maintainer reviews a pull request they may request changes. These may be small, such as fixing a typo, or may involve substantive changes. Such requests are intended to be helpful, but at times may come across as abrupt or unhelpful, especially if they do not include concrete suggestions on _how_ to change them.
209
+
All pull requests require approval from at least one maintainer in order to land. Whenever a maintainer reviews a pull request they may request changes. These may be small, such as fixing a typo, or may involve substantive changes. Such requests are intended to be helpful, but at times may come across as abrupt or unhelpful, especially if they do not include concrete suggestions on _how_ to change them.
168
210
169
211
Try not to be discouraged. Try asking the maintainer for advice on how to implement it. If you feel that a review is unfair, say so or seek the input of another project contributor. Often such comments are the result of a reviewer having taken insufficient time to review and are not ill-intended. Such difficulties can often be resolved with a bit of patience. That said, reviewers should be expected to provide helpful feedback.
170
212
171
213
### Step 12: Landing
172
214
173
-
In order to land, a pull request needs to be reviewed and approved by at least one contributor. After that, if there are no objections from other contributors, the pull request can be merged.
215
+
In order to land, a pull request needs to be reviewed and approved by at least one maintainer. After that, if there are no objections from other contributors, the pull request can be merged.
174
216
175
217
**Congratulations and thanks a lot for your contribution!**
[](https://github.com/dabbu-knowledge-platform/files-api-server/actions/workflows/ci.yml)[](https://img.shields.io/badge/platforms-windows%20linux%20macos%20alpine-blue)[](https://img.shields.io/badge/code%20style-xo%2Fprettier-ff69b4)
4
4
5
5
An implementation of the Dabbu Files API that enables you to access your files, folders and emails stored with multiple providers as simple files and folders, all in one place!
6
6
@@ -34,10 +34,10 @@ Here is a list of clients that use the Dabbu API to interact with your files and
0 commit comments