UNPKG

8.37 kBMarkdownView Raw
1# Contributing
2
3We would love for you to contribute to atSCM. As a contributor, here are the guidelines we would like you to follow:
4
5## Found a bug?
6
7If you find a bug in the source code, you can help us by submitting an issue to this repository. Even better, you can submit a Pull Request with a fix.
8
9## Missing a feature?
10
11You can *request* a new feature by submitting an issue to this repository. If you would like to *implement* a new feature, please submit an issue with a proposal for your work first, to be sure that we can use it.
12
13## Submission Guidelines
14
15### Submitting an issue
16
17Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
18
19We can only fix an issue if we can reproduce it. To help us provide the following information in your issue description:
20
21 - **The original error message:** Any console output regarding the issue. Consider running *atscm* with verbose logging (using the command line option `-LLLL`) to get more error details.
22 - ***atscm* and *atscm-cli* versions used:** The results of `atscm --version`.
23 - **atvise server version used**
24 - ***node* and *npm* versions used:** The results of `node --version` and `npm version`.
25 - **Special project setup:** Any default overrides to your `Atviseproject.js` file, such as custom Transformers.
26
27### Submitting a Pull Request (PR)
28
29Before you submit your Pull Request (PR) consider the following guidelines:
30
31 - Search GitHub for an open or closed PR that relates to your submission. You don't want to duplicate effort.
32 - Make your changes in a new git branch: Run `git checkout -b my-fix-branch master`
33 - Create your patch, **including appropriate test cases**.
34 - Run the full test suite and ensure all tests pass.
35 - Commit your changes using a descriptive commit message that follows our commit message conventions. Adherence to these conventions is necessary because release notes are automatically generated from these messages.
36 - Push your branch to GitHub and create a pull request **to merge back to the beta branch**.
37 - Once we reviewed your changes, we'll merge your pull request.
38
39> **Merge strategy (Maintainers only)**
40> - Accepted changes from fix/feature branches **should always be squash-merged** to beta.
41> - Once beta is stable **create a regular merge commit** to merge back to master.
42> - After merging to master, changes should be synced back to the beta branch. To do so, run:
43> ```bash
44> git checkout beta
45> git fetch
46> git rebase origin/master
47> # Solve conflicts if any, accepting changes from master
48> git commit -m 'chore: Update from master'
49> git push
50> ```
51
52## Code quality control
53
54> All files inside this project are automatically built, linted and tested by [CircleCI](https://circleci.com/gh/atSCM/atscm).
55
56Builds will only pass if they meet the following criteria:
57
58 - **No ESLint errors:** We use [ESLint](http://eslint.org) to lint our entire JavaScript code. The config used is [eslint-config-lsage](https://www.npmjs.com/package/eslint-config-lsage). Any lint errors will cause the build to fail.
59 - **Test coverage >= 90%:** We use [istanbul](https://gotwarlost.github.io/istanbul/) to validate test coverage is at least 90 percent. Any commits not covered by tests will cause the build to fail.
60 - **Documentation coverage >= 90%:** Our source code is documented using [ESDoc](https://esdoc.org). We will only merge if your contribution is documented as well.
61
62## Setting up the development environment
63
64> In order to meet out coding guideline it's very useful to have your development environment set up right.
65
66### Linting files
67
68You can lint all source files by running `npm run lint`. Although most IDEs support running it directly in the editor:
69
70**Jetbrains Webstorm**
71
72[Webstorm](https://www.jetbrains.com/webstorm/) has built-in support for ESLint. Check out [their documentation](https://www.jetbrains.com/help/webstorm/2016.3/eslint.html) to set it up.
73
74**Atom**
75
76[Atom](https://atom.io) has several packages that provide support for inline ESLint validation. We recommend you to use [linter-eslint](https://atom.io/packages/linter-eslint).
77
78### Running tests
79
80Our [mocha](https://mochajs.org) tests can be run by calling `npm test`. If you want the tests to be run right after you saved your changes, then run `npm run test:watch`.
81
82**Setup needed to run tests on atvise server**
83
84Please note, that you have to **provide a valid atvise server connection** in order to get tests against atvise server running. You can achieve that by doing one of the following:
85
86 - Set environment variables `ATVISE_USERNAME` and `ATVISE_PASSWORD` to valid credentials for the public atvise demo server at [demo.ativse.com](http://185.67.228.66:8888).
87 - Adapt host, ports and login credentials inside `./test/fixtures/Atviseproject.babel.js`.
88
89**Check test coverage**
90
91Test coverage can be checked by running `npm run test:coverage`.
92
93### Creating API documentation
94
95Run `npm run docs` to create [ESDoc](https://esdoc.org) API documentation.
96
97<!-- TODO: Add steps for creating good issues -->
98<!-- TODO: Add links to documentation and manuals -->
99
100## Commit Message Guideline
101
102We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to **generate the changelog**.
103
104### Commit message format
105
106> tl;dr: We use an adaption of the [angular commit message convention](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines) with the only difference that capitalized subjects are allowed.
107
108Each commit message consists of a *header*, a *body* and a footer. The header has a special format that includes a *type*, a *scope* and a *subject*:
109
110```
111<type>(<scope>): <subject>
112
113<body>
114
115<footer>
116```
117
118The *header* is mandatory and the *scope* of the *header* is optional. It cannot be longer than **72 characters**.
119
120**Samples**
121
122- Describe a documentation change
123
124 `docs(changelog): Update changelog for version 1.2.3`
125
126- Describes a bug fix affecting mapping
127 ```
128 fix(mapping): Replace invalid data type for html help documents
129
130 Prevents html help documents to have an invalid extension unter atvise server v3.1.0.
131
132 Closes #123
133 ```
134
135#### Type
136
137Must be one of the following:
138
139 - **build:** Changes that affect the build system or external dependencies (example scopes: babel, npm)
140 - **chore:** Maintainance tasks (example tasks: release)
141 - **ci:** Changes to our CI configuration files and scripts (example scopes: circleci, appveyor, codecov)
142 - **docs:** Documentation only changes
143 - **feat:** A new feature
144 - **fix:** A bug fix
145 - **perf:** A code change that improves performance
146 - **refactor:** A code change that neither fixes a bug nor adds a feature
147 - **revert:** Reverts a previous commit.
148 - **style:** Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
149 - **test:** Adding missing tests or correcting existing tests
150
151#### Scope
152
153The scope should describe the feature affected. Must be lower case.
154
155#### Subject
156
157The subject contains succinct description of the change:
158
159 - Use the imperative, present tense: "change" not "changed" nor "changes"
160 - Capitalize first letter *(The only notable difference to the [angular commit message convention](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines))*
161 - no dot (.) at the end
162
163#### Body
164
165Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
166
167#### Footer
168
169The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.
170
171**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
172
173### Commit message linting
174
175The project is setup to use a **git hook that lints commit messages** before creating a commit. Do not bypass this hook.
176
177See [husky's documentation on git GUI support](https://github.com/typicode/husky#git-gui-clients-support).
178
\No newline at end of file