source: src/webapp/apigility/CONTRIBUTING.md@ cb39a77

debian/bullseye
Last change on this file since cb39a77 was 74c3571, checked in by Joachim Langenbach <joachim.langenbach@…>, 8 years ago

Added gnuboat_mapservice:

it is a REST webservice designed with Apigility to allow the user to upload data, create waters and so on

  • Property mode set to 100644
File size: 5.5 KB
Line 
1# CONTRIBUTING
2
3## RESOURCES
4
5If you wish to contribute to this project, please be sure to
6read/subscribe to the following resources:
7
8 - [Coding Standards](https://github.com/zendframework/zend-coding-standard)
9 - [Forums](https://discourse.zendframework.com/c/contributors)
10 - [Chat](https://zendframework-slack.herokuapp.com)
11 - [Code of Conduct](CODE_OF_CONDUCT.md)
12
13If you are working on new features or refactoring
14[create a proposal](https://github.com/zfcampus/zf-api-problem/issues/new).
15
16## RUNNING TESTS
17
18To run tests:
19
20- Clone the repository:
21
22 ```console
23 $ git clone git://github.com/zfcampus/zf-api-problem.git
24 $ cd zf-api-problem
25 ```
26
27- Install dependencies via composer:
28
29 ```console
30 $ composer install
31 ```
32
33 If you don't have `composer` installed, please download it from https://getcomposer.org/download/
34
35- Make sure that `zendframework/zend-test` is installed:
36
37 ```console
38 $ composer require --dev zendframework/zend-test
39 ```
40
41- Run the tests using the "test" command shipped in the `composer.json`:
42
43 ```console
44 $ composer test
45 ```
46
47You can turn on conditional tests with the `phpunit.xml` file.
48To do so:
49
50 - Copy `phpunit.xml.dist` file to `phpunit.xml`
51 - Edit `phpunit.xml` to enable any specific functionality you
52 want to test, as well as to provide test values to utilize.
53
54## Running Coding Standards Checks
55
56First, ensure you've installed dependencies via composer, per the previous
57section on running tests.
58
59Make sure that `squizlabs/php_codesniffer` is installed:
60
61```console
62$ composer require --dev squizlabs/php_codesniffer
63```
64
65To run CS checks only:
66
67```console
68$ composer cs-check
69```
70
71To attempt to automatically fix common CS issues:
72
73```console
74$ composer cs-fix
75```
76
77If the above fixes any CS issues, please re-run the tests to ensure
78they pass, and make sure you add and commit the changes after verification.
79
80## Recommended Workflow for Contributions
81
82Your first step is to establish a public repository from which we can
83pull your work into the master repository. We recommend using
84[GitHub](https://github.com), as that is where the component is already hosted.
85
861. Setup a [GitHub account](https://github.com/), if you haven't yet
872. Fork the repository (https://github.com/zfcampus/zf-api-problem)
883. Clone the canonical repository locally and enter it.
89
90 ```console
91 $ git clone git://github.com/zfcampus/zf-api-problem.git
92 $ cd zf-api-problem
93 ```
94
954. Add a remote to your fork; substitute your GitHub username in the command
96 below.
97
98 ```console
99 $ git remote add {username} git@github.com:{username}/zf-api-problem.git
100 $ git fetch {username}
101 ```
102
103### Keeping Up-to-Date
104
105Periodically, you should update your fork or personal repository to
106match the canonical ZF repository. Assuming you have setup your local repository
107per the instructions above, you can do the following:
108
109
110```console
111$ git checkout master
112$ git fetch origin
113$ git rebase origin/master
114# OPTIONALLY, to keep your remote up-to-date -
115$ git push {username} master:master
116```
117
118If you're tracking other branches -- for example, the "develop" branch, where
119new feature development occurs -- you'll want to do the same operations for that
120branch; simply substitute "develop" for "master".
121
122### Working on a patch
123
124We recommend you do each new feature or bugfix in a new branch. This simplifies
125the task of code review as well as the task of merging your changes into the
126canonical repository.
127
128A typical workflow will then consist of the following:
129
1301. Create a new local branch based off either your master or develop branch.
1312. Switch to your new local branch. (This step can be combined with the
132 previous step with the use of `git checkout -b`.)
1333. Do some work, commit, repeat as necessary.
1344. Push the local branch to your remote repository.
1355. Send a pull request.
136
137The mechanics of this process are actually quite trivial. Below, we will
138create a branch for fixing an issue in the tracker.
139
140```console
141$ git checkout -b hotfix/9295
142Switched to a new branch 'hotfix/9295'
143```
144
145... do some work ...
146
147
148```console
149$ git commit
150```
151
152... write your log message ...
153
154
155```console
156$ git push {username} hotfix/9295:hotfix/9295
157Counting objects: 38, done.
158Delta compression using up to 2 threads.
159Compression objects: 100% (18/18), done.
160Writing objects: 100% (20/20), 8.19KiB, done.
161Total 20 (delta 12), reused 0 (delta 0)
162To ssh://git@github.com/{username}/zf-api-problem.git
163 b5583aa..4f51698 HEAD -> master
164```
165
166To send a pull request, you have two options.
167
168If using GitHub, you can do the pull request from there. Navigate to
169your repository, select the branch you just created, and then select the
170"Pull Request" button in the upper right. Select the user/organization
171"zfcampus" (or whatever the upstream organization is) as the recipient.
172
173#### What branch to issue the pull request against?
174
175Which branch should you issue a pull request against?
176
177- For fixes against the stable release, issue the pull request against the
178 "master" branch.
179- For new features, or fixes that introduce new elements to the public API (such
180 as new public methods or properties), issue the pull request against the
181 "develop" branch.
182
183### Branch Cleanup
184
185As you might imagine, if you are a frequent contributor, you'll start to
186get a ton of branches both locally and on your remote.
187
188Once you know that your changes have been accepted to the master
189repository, we suggest doing some cleanup of these branches.
190
191- Local branch cleanup
192
193 ```console
194 $ git branch -d <branchname>
195 ```
196
197- Remote branch removal
198
199 ```console
200 $ git push {username} :<branchname>
201 ```
Note: See TracBrowser for help on using the repository browser.