|
2 | 2 |
|
3 | 3 | :+1: :tada: Firstly, thanks for taking the time to contribute! :tada: :+1: |
4 | 4 |
|
5 | | -The following is a set of guidelines for contributing to **coteafs-selenium** which is hosted on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. |
| 5 | +The following are set of guidelines for contributing towards this framework on Github. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request. |
6 | 6 |
|
7 | | -## Code contribution |
| 7 | +## Code Contribution |
8 | 8 |
|
9 | | -There are some process which are in place to help maintain the quality of the framework. To adhere to this process, some coding standards and CI pipelines are defined along with static code analysis. The same is detailed below: |
| 9 | +## 1. Where to start from? |
| 10 | + |
| 11 | +If you've noticed a bug or have a question plesae check the [search the issue tracker][tracker] to see if someone else has already created a ticket. If not, go ahead and [add one][new issue]! |
| 12 | + |
| 13 | +## 2. Want to fix an issue or add new feature? |
| 14 | + |
| 15 | +If this is something you think you can fix, then follow the following steps: |
| 16 | + |
| 17 | +### Step 1: Discuss |
| 18 | + |
| 19 | +Before jumping on any ticket or any feature which you think should be there in the framework, discuss with me on my [site][] or email me @ wasbhamla2005@gmail.com. Once you get go-ahead, you can proceed by following the steps mentioned hereafter. |
| 20 | + |
| 21 | +### Step 2: Setup your E-mail in Git |
| 22 | + |
| 23 | +Assuming you have already done this. But if you are new and may forget this, you can do it as described [here][setup]. |
| 24 | + |
| 25 | +### Step 3: Fork and clone the repository |
| 26 | + |
| 27 | +To Fork and clone the repository, see this useful [post][fork]. |
| 28 | + |
| 29 | +### Step 4: Create new Branch |
| 30 | + |
| 31 | +Now create a new branch with descriptive name in your forked repo. Refer [here][branch] to know about Git branches. |
| 32 | + |
| 33 | +### Step 5: Commit with a descriptive message |
| 34 | + |
| 35 | +If committing a fix for a ticket, always start with `Fixed #[Ticket ID]` than describe the changes in detail. |
| 36 | +For an example on how to write a proper commit message, see [this][commitHelp] post. |
| 37 | + |
| 38 | +### Step 6: Push changes to your cloned fork |
| 39 | + |
| 40 | +After committing the changes, you need to push the commit to your cloned repo by executing `git push origin your-branch-name` command in the terminal. |
| 41 | + |
| 42 | +### Step 7: Send Pull Request |
| 43 | + |
| 44 | +Sending Pull Request will be the last step of your contribution. To know how to raise a Pull Request, see [this][pr] post. |
| 45 | + |
| 46 | +> **NOTE:** From your second contribution onwards, you can skip steps **(1) and (2)**. |
| 47 | +
|
| 48 | +## Process and Guidelines |
| 49 | + |
| 50 | +There is a process in place to help maintain the quality of the framework. To adhere to this process, some coding standards and CI pipelines are defined along with static code analysis. The same are detailed below: |
10 | 51 |
|
11 | 52 | ### Git workflow |
12 | 53 |
|
13 | | -Since the repository is hosted on GitHub, I have configured the GitHub to only accept **signed commits** from any contributor (_including me :wink:_). So make sure that you are signing your commits before sending PR, **else the PR will be rejected**. To know more about signed commits, check out this [post][sign-commit]. |
| 54 | +Since the repository is hosted on GitHub, it has been configured to only accept **signed commits** from any contributor (_including me :wink:_). So make sure to **sign your commits** before sending Pull Request, **else the it will be rejected**. To know more about signed commits, check out this [post][sign-commit]. |
14 | 55 |
|
15 | 56 | ### Branching strategy |
16 | 57 |
|
17 | | -I have defined a specific Branching strategy where **NO COMMITS** are done directly into `master` branch. |
| 58 | +Specific Branching strategy has been defined on this project where **NO COMMITS** are done directly into `master` branch. |
18 | 59 |
|
19 | 60 | There are 3 main branches: |
20 | | -- `develop`: All feature branches will be merged into this branch after `PR` review. |
21 | | -- `release`: When `develop` branch is clean and all CI tests are also **green**, then `develop` branch is merged into this branch via `PR`. After merge, a `beta` release of version is published to Maven central. |
22 | | -- `master`: After successful Beta testing, `release` branch is then merged into `master` via `PR`. After merge, final release version cut is published to Maven central. |
| 61 | +- `develop`: All feature branches will be merged into this branch after `Pull Request` review. |
| 62 | +- `release`: When `develop` branch is clean and all CI tests are **green**, then `develop` branch will be merged into this branch via `Pull Request`. After merge, a `beta` release of version would published to Maven central. |
| 63 | +- `master`: After successful Beta testing, `release` branch will then be merged into `master` via `Pull Request`. After merge, final release version cut would published to Maven central. |
| 64 | + |
| 65 | +### Working on open tickets |
23 | 66 |
|
24 | 67 | Any work being done on any open tickets, should be done in a new branch with naming pattern `issue-<ticket no>` created from `develop` branch. |
25 | 68 |
|
26 | | -### PR pre-requisites |
| 69 | +### Pull Request pre-requisites |
27 | 70 |
|
28 | | -Any PR raised should make sure following checks are successful: |
29 | | -- PR is raised to merge changes to `develop` branch. |
| 71 | +Any Pull Request raised should make sure following checks are successful: |
| 72 | +- Pull Request is raised to merge changes to `develop` branch. |
30 | 73 | - Commits are signed. |
31 | | -- There is at least one reviewer (that would be me.) |
| 74 | +- There is at least one reviewer. |
32 | 75 | - Circle CI tests are green. |
33 | 76 | - Branch is up to date with `develop` branch. |
34 | 77 |
|
35 | 78 | ### Project tracking |
36 | 79 |
|
37 | | -I make sure that whatever is being committed to the code base, is tracked against an issue ticket. Hence, each planned versions are being tracked in `Project` tab on GitHub. Hence, it is mandatory to keep the ticket status updated for which you may be working on. |
| 80 | +Whatever is being committed to the code base, is tracked against an issue ticket. Hence, each planned versions are being tracked in `Project` tab on GitHub. Hence, it is mandatory to keep the ticket status updated which is being worked upon. |
38 | 81 |
|
39 | 82 | ### Circle CI pipelines |
40 | 83 |
|
41 | | -The framework is configured with Circle CI to run tests on **Chrome browser** to make sure that the framework is healthy. This integration is useful when there are multiple contributors working on the project and it is mandatory to add tests for the code you have written. These tests will be executed on every commits to the issue branch. |
| 84 | +This framework is configured with Circle CI to run tests on **Chrome browser** to make sure that the framework is healthy. This integration is useful when there are multiple contributors working on the project and it is mandatory to add unit tests for the code. These tests will be executed on every commits to the issue branch. |
42 | 85 |
|
43 | 86 | Following are the checks which are executed: |
44 | 87 | - Tests coverage |
45 | 88 | - Static Code analysis |
46 | 89 |
|
47 | 90 | ### Code Styling |
48 | 91 |
|
49 | | -When many contributors are working together, then there is always chance for different code styling. To make sure every member is using same coding style, it is advisable that you import code styling formatter from the [java formatter][formatter] repository into your IDE. |
| 92 | +There is always a chance of different code styling when many contributors work together on a project. To make sure every member is using same coding style, it is advisable that you import code styling formatter from the [java formatter][formatter] repository into your IDE. |
50 | 93 |
|
51 | | -Make sure to format the code before sending the **PR**. |
| 94 | +Make sure to format the code before sending the **Pull Request**. |
52 | 95 |
|
53 | 96 | ### Test coverage |
54 | 97 |
|
55 | | -For assuring quality of framework to prospective users, test coverage plays an important role. That's why I want to achieve a benchmark of **80% or more** of overall coverage. It will be advisable to add tests for any new code which you may be adding. |
| 98 | +For assuring quality of framework to prospective users, test coverage plays an important role. That's why a benchmark of **80% or more** is set to be required for overall test coverage on this project. It is advisable to add unit tests for any new code which is being added. |
56 | 99 |
|
57 | 100 | ### SonarCloud Code Quality monitoring |
58 | 101 |
|
59 | | -For each commit to any of the branches described above, CI will also execute static code analysis. It is advisable to check the [SonarCloud][sonar] for any coding issues and solve any issues related to your code before sending across for **PR**. |
| 102 | +For each commit to any of the branches described above, CI will also execute static code analysis. |
60 | 103 |
|
61 | 104 | ## Issues and Suggestions. |
62 | 105 |
|
63 | | -If you find any issue in the framework or you have some suggestions for enhancement in the framework then feel free to raise an issue for the same. Together we can make the framework even more effective and easy for other Test Engineers to use it in their daily Automation tasks. |
| 106 | +If you find any issue in the framework or you have any suggestions for enhancement, please feel free to raise a ticket for it. Together we can make the framework even more effective and easy for other Test Engineers to use it in their daily automation tasks. |
64 | 107 |
|
65 | 108 | [sign-commit]: https://help.github.com/en/articles/signing-commits |
66 | 109 | [formatter]: https://github.com/WasiqB/java-formatter |
| 110 | +[tracker]: https://github.com/WasiqB/coteafs-selenium/issues?q=something |
| 111 | +[new issue]: https://github.com/WasiqB/coteafs-selenium/issues/new |
| 112 | +[fork]: https://help.github.com/articles/fork-a-repo/ |
| 113 | +[branch]: https://www.atlassian.com/git/tutorials/using-branches |
| 114 | +[setup]: https://help.github.com/articles/setting-your-commit-email-address-in-git |
| 115 | +[commitHelp]: https://github.com/erlang/otp/wiki/Writing-good-commit-messages |
| 116 | +[pr]: https://help.github.com/articles/creating-a-pull-request |
| 117 | +[site]: https://wasiqb.github.io |
0 commit comments