Skip to content

Commit 10ab5a6

Browse files
committed
git: merge branch 'develop'
Signed-off-by: Vedant K <gamemaker0042@gmail.com>
2 parents 8e54a67 + 6467227 commit 10ab5a6

File tree

9 files changed

+20003
-7923
lines changed

9 files changed

+20003
-7923
lines changed

contributing.md

Lines changed: 76 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ The following is a set of guidelines for contributing to Dabbu CLI. These are ju
66

77
## Issues
88

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.
1010

1111
## Pull requests
1212

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).
1414

1515
### Step 0: Environment
1616

@@ -32,7 +32,7 @@ Install `git`, `nodejs` and `npm`.
3232

3333
### Step 1: Fork
3434

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.
3636

3737
Run the following in a terminal to clone your fork locally:
3838

@@ -51,10 +51,19 @@ Once you've built the project locally, you're ready to start making changes!
5151

5252
### Step 3: Branch
5353

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
5564

5665
```sh
57-
$ git checkout -b fix-buggy-bug -t upstream/main
66+
$ git checkout -b feature/add-awesome-new-feature -t upstream/develop
5867
```
5968

6069
### Step 4: Code
@@ -71,32 +80,74 @@ To test a change without building the executables, you can type `npm start` and
7180

7281
> 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).
7382
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+
```
75125

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**.
77127

78-
### Step 5: Commit
128+
### Step 7: Commit
79129

80130
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.
81131

82132
```sh
83133
$ git add my/changed/files
84-
$ git commit -m "<commit message>"
134+
$ git commit
85135
```
86136

87137
Note that multiple commits often get squashed when they are landed.
88138

89139
#### Commit message guidelines
90140

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.
92143

93144
Before a pull request can be merged, it **must** have a pull request title with a semantic prefix.
94145

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:
96147

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`
100151

101152
Common prefixes:
102153

@@ -105,8 +156,9 @@ Common prefixes:
105156
- `docs`: Documentation changes
106157
- `perf`: A code change that improves performance
107158
- `refactor`: A code change that neither fixes a bug nor adds a feature
159+
- `test`: A change to the tests
108160
- `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
110162

111163
Other things to keep in mind when writing a commit message:
112164

@@ -122,35 +174,23 @@ A commit that has the text `BREAKING CHANGE:` at the beginning of its optional b
122174

123175
See [conventionalcommits.org](https://conventionalcommits.org) for more details.
124176

125-
### Step 6: Rebase
177+
### Step 8: Rebase
126178

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.
128180

129181
```sh
130182
$ git fetch upstream
131-
$ git rebase upstream/main
183+
$ git rebase upstream/develop
132184
```
133185

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.
147187

148188
### Step 9: Push
149189

150190
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.
151191

152192
```sh
153-
$ git push origin fix-buggy-bug
193+
$ git push origin feature/add-awesome-new-feature
154194
```
155195

156196
### 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
166206
```sh
167207
$ git add my/changed/files
168208
$ git commit
169-
$ git push origin fix-buggy-bug
209+
$ git push origin feature/add-awesome-new-feature
170210
```
171211

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 ...`.
173213

174214
Feel free to post a comment in the pull request to ping reviewers if you are awaiting an answer on something.
175215

176216
**Approval and Request Changes Workflow**
177217

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.
179219

180220
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.
181221

182222
### Step 12: Landing
183223

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.
185225

186226
**Congratulations and thanks a lot for your contribution!**

0 commit comments

Comments
 (0)