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
+76-36Lines changed: 76 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ The following is a set of guidelines for contributing to Dabbu CLI. These are ju
6
6
7
7
## Issues
8
8
9
-
You can contribute to Dabbu CLI by reporting bugs, fixing bugs, adding features, and spreading the word! If you want to report a bug, create an issue by the clicking [here](https://github.com/dabbu-knowledge-platform/cli/issues/new/choose). While creating an issue, try to follow the Bug report or Feature request template.
9
+
You can contribute to Dabbu CLI by reporting bugs, fixing bugs, adding features, and spreading the word! If you want to report a bug, create an issue by clicking [here](https://github.com/dabbu-knowledge-platform/cli/issues/new/choose). While creating an issue, try to follow the Bug report or Feature request template.
10
10
11
11
## Pull requests
12
12
13
-
This guide assumes you are familiar with Github and the command line. If not, [here](https://guides.github.com/activities/hello-world/) is a guide to get started with Github. If you are stuck on something, feel free to ask on [Github Discussions](https://github.com/dabbu-knowledge-platform/cli/discussions/categories/want-to-want-to-contribute).
13
+
This guide assumes you are familiar with Github and the command line. If not, [here](https://guides.github.com/activities/hello-world/) is a guide to get started with Github. If you are stuck on something, feel free to ask on [Github Discussions](https://github.com/dabbu-knowledge-platform/cli/discussions/categories/want-to-contribute).
14
14
15
15
### Step 0: Environment
16
16
@@ -32,7 +32,7 @@ Install `git`, `nodejs` and `npm`.
32
32
33
33
### Step 1: Fork
34
34
35
-
Fork the project [on the GitHub site](https://github.com/dabbu-knowledge-platform/cli) and clone your fork locally.
35
+
Fork the project [on the GitHub website](https://github.com/dabbu-knowledge-platform/cli) and clone your fork locally.
36
36
37
37
Run the following in a terminal to clone your fork locally:
38
38
@@ -51,10 +51,19 @@ 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
@@ -71,32 +80,74 @@ To test a change without building the executables, you can type `npm start` and
71
80
72
81
> While running the CLI for the first time, you will be asked to enter the URL to a Dabbu Server. For testing and development purposes, you may use the server hosted on Heroku - https://dabbu-server.herokuapp.com - but for continued use, it is recommended to setup your own server following the instructions [here](https://dabbu-knowledge-platform.github.io/impls/server).
73
82
74
-
Remember to always format the code using `prettier` once you're done. To check if the code is formatted correctly, run `npm run check-format`. To format the code using prettier, run `npm run format`.
83
+
Remember to always format the code using `xo` once you're done.
84
+
85
+
### Step 5: Document
86
+
87
+
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.
88
+
89
+
If you are adding new features, or making changes to the behaviour of existing features, make sure you create a separate pull request in the [user docs repository](https://github.com/dabbu-knowledge-platform/dabbu-knowledge-platform.github.io/), and add relevant info to the `impls/cli.md` page. Also add the same changes to the `readme.md` file.
90
+
91
+
The documentation uses jekyll. To set up jekyll on your computer and make changes to the documentation, follow [this](https://docs.github.com/en/github/working-with-github-pages/testing-your-github-pages-site-locally-with-jekyll) guide.
92
+
93
+
### Step 6: Test
94
+
95
+
Before submitting your changes, please run the linter (`xo`):
96
+
97
+
```
98
+
npm test
99
+
```
100
+
101
+
Please ensure that:
102
+
103
+
- your code passes all lint checks (`xo`)
104
+
- your code passes all format checks (`prettier` run by xo)
105
+
106
+
If the linter points out errors, try fixing them automatically by running:
107
+
108
+
```
109
+
npm run format
110
+
```
111
+
112
+
The linter will try its best to fix all issues, but certain issues require you to fix them manually.
113
+
114
+
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:
115
+
116
+
```
117
+
// eslint-disable-next-line some-lint-rule-id
118
+
```
119
+
120
+
To disable lint checks for an entire file (not recommended), enter the following at the top of the file:
121
+
122
+
```
123
+
/* eslint some-lint-rule-id: 0 */
124
+
```
75
125
76
-
If you find yourself stuck somewhere, or need help with some code, feel free to ask for help on [Github Discussions](https://github.com/dabbu-knowledge-platform/cli/discussions/categories/want-to-contribute).
126
+
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**.
77
127
78
-
### Step 5: Commit
128
+
### Step 7: Commit
79
129
80
130
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.
81
131
82
132
```sh
83
133
$ git add my/changed/files
84
-
$ git commit -m "<commit message>"
134
+
$ git commit
85
135
```
86
136
87
137
Note that multiple commits often get squashed when they are landed.
88
138
89
139
#### Commit message guidelines
90
140
91
-
A good commit message should describe what changed and why. This project uses [semantic commit messages](https://conventionalcommits.org/) to streamline the release process.
141
+
A good commit message should describe what changed and why. This project uses [semantic commit messages](https://conventionalcommits.org/) to streamline
142
+
the release process.
92
143
93
144
Before a pull request can be merged, it **must** have a pull request title with a semantic prefix.
94
145
95
-
Examples of commit messages with semantic prefixes: (Also, note that they must be in present tense)
146
+
Examples of commit messages with semantic prefixes:
96
147
97
-
-`fix: fix crash in Google Drive client`
98
-
-`feat: add MS OneDrive client for CLI`
99
-
-`docs: fix typo in README.md`
148
+
-`fix: don't reload config everytime`
149
+
-`feat: add MS OneDrive provider`
150
+
-`docs: fix typo in APIs.md`
100
151
101
152
Common prefixes:
102
153
@@ -105,8 +156,9 @@ Common prefixes:
105
156
-`docs`: Documentation changes
106
157
-`perf`: A code change that improves performance
107
158
-`refactor`: A code change that neither fixes a bug nor adds a feature
159
+
-`test`: A change to the tests
108
160
-`style`: Changes that do not affect the meaning of the code (linting)
109
-
-`vendor`: Bumping a dependency like node or express
161
+
-`build`: Bumping a dependency like node or express
110
162
111
163
Other things to keep in mind when writing a commit message:
112
164
@@ -122,35 +174,23 @@ A commit that has the text `BREAKING CHANGE:` at the beginning of its optional b
122
174
123
175
See [conventionalcommits.org](https://conventionalcommits.org) for more details.
124
176
125
-
### Step 6: Rebase
177
+
### Step 8: Rebase
126
178
127
-
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.
179
+
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.
128
180
129
181
```sh
130
182
$ git fetch upstream
131
-
$ git rebase upstream/main
183
+
$ git rebase upstream/develop
132
184
```
133
185
134
-
This ensures that your working branch has the latest changes from `dabbu-knowledge-platform/cli` main.
135
-
136
-
### Step 7: Test
137
-
138
-
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.
139
-
140
-
### Step 8: Document
141
-
142
-
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.
143
-
144
-
If you are adding new features, or making changes to the behaviour of existing features, make sure you create a separate pull request in the [user docs repository](https://github.com/dabbu-knowledge-platform/dabbu-knowledge-platform.github.io/), and add relevant info to the `impls/cli.md` page.
145
-
146
-
The documentation uses jekyll. To set up jekyll on your computer and make changes to the documentation, follow [this](https://docs.github.com/en/github/working-with-github-pages/testing-your-github-pages-site-locally-with-jekyll) guide.
186
+
This ensures that your working branch has the latest changes from `dabbu-knowledge-platform/cli` develop. If any conflicts arise, resolve them and commit the changes again.
147
187
148
188
### Step 9: Push
149
189
150
190
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.
151
191
152
192
```sh
153
-
$ git push origin fix-buggy-bug
193
+
$ git push origin feature/add-awesome-new-feature
154
194
```
155
195
156
196
### Step 10: Opening the Pull Request
@@ -166,21 +206,21 @@ To make changes to an existing pull request, make the changes to your local bran
166
206
```sh
167
207
$ git add my/changed/files
168
208
$ git commit
169
-
$ git push origin fix-buggy-bug
209
+
$ git push origin feature/add-awesome-new-feature
170
210
```
171
211
172
-
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.
212
+
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 ...`.
173
213
174
214
Feel free to post a comment in the pull request to ping reviewers if you are awaiting an answer on something.
175
215
176
216
**Approval and Request Changes Workflow**
177
217
178
-
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.
218
+
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.
179
219
180
220
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.
181
221
182
222
### Step 12: Landing
183
223
184
-
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.
224
+
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.
185
225
186
226
**Congratulations and thanks a lot for your contribution!**
0 commit comments