2016-03-17 00:42:28 +08:00
|
|
|
# Development process
|
|
|
|
|
|
|
|
For any modification of crankshaft, such as adding new features,
|
2016-08-13 00:34:13 +08:00
|
|
|
refactoring or bugfixing, a topic branch must be created out of the `develop`.
|
2016-03-17 00:42:28 +08:00
|
|
|
|
|
|
|
Modifications are done inside `src/pg/sql` and `src/py/crankshaft`.
|
|
|
|
|
|
|
|
Take into account:
|
|
|
|
|
|
|
|
* Tests must be added for any new functionality
|
|
|
|
(inside `src/pg/test`, `src/py/crankshaft/test`) as well as to
|
|
|
|
detect any bugs that are being fixed.
|
|
|
|
* Add or modify the corresponding documentation files in the `doc` folder.
|
2016-08-13 00:34:13 +08:00
|
|
|
* Naming conventions for function names:
|
|
|
|
- use `CamelCase`
|
|
|
|
- prefix "public" functions with `CDB_`. E.g: `CDB_SpatialMarkovTrend`
|
|
|
|
- prefix "private" functions with an underscore. E.g: `_CDB_MyObscureInternalImplementationDetail`
|
2016-03-17 00:42:28 +08:00
|
|
|
|
|
|
|
Once the code is ready to be tested, update the local development installation
|
|
|
|
with `sudo make install`.
|
|
|
|
This will update the 'dev' version of the extension in `src/pg/` and
|
|
|
|
make it available to PostgreSQL.
|
|
|
|
|
|
|
|
Run the tests with `make test`.
|
|
|
|
|
|
|
|
Update extension in a working database with:
|
|
|
|
|
2016-08-13 00:34:13 +08:00
|
|
|
```sql
|
|
|
|
ALTER EXTENSION crankshaft UPDATE TO 'current';
|
|
|
|
ALTER EXTENSION crankshaft UPDATE TO 'dev';
|
|
|
|
```
|
2016-03-17 00:42:28 +08:00
|
|
|
|
|
|
|
If the extension has not previously been installed in a database,
|
|
|
|
it can be installed directly with:
|
2016-08-13 00:34:13 +08:00
|
|
|
```sql
|
|
|
|
CREATE EXTENSION IF NOT EXISTS plpythonu;
|
|
|
|
CREATE EXTENSION IF NOT EXISTS postgis;
|
|
|
|
CREATE EXTENSION crankshaft WITH VERSION 'dev';
|
|
|
|
```
|
2016-03-17 00:42:28 +08:00
|
|
|
|
2016-03-17 01:18:59 +08:00
|
|
|
Once the feature or bugfix is completed and all the tests are passing
|
2016-08-13 00:34:13 +08:00
|
|
|
a pull request shall be created, reviewed by a peer
|
|
|
|
and then merged back into the `develop` branch once all the CI tests pass.
|
2016-03-17 00:42:28 +08:00
|
|
|
|
|
|
|
|
2016-08-13 00:34:13 +08:00
|
|
|
## Relevant development targets in the Makefile
|
2016-03-17 00:42:28 +08:00
|
|
|
|
2016-08-13 00:34:13 +08:00
|
|
|
```shell
|
|
|
|
# Show a short description of the available targets
|
|
|
|
make help
|
2016-03-17 00:42:28 +08:00
|
|
|
|
2016-08-13 00:34:13 +08:00
|
|
|
# Generate the extension scripts and install the python package.
|
|
|
|
sudo make install
|
2016-03-17 00:42:28 +08:00
|
|
|
|
2016-08-13 00:34:13 +08:00
|
|
|
# Run the tests against the installed extension.
|
|
|
|
make test
|
2016-03-17 00:42:28 +08:00
|
|
|
```
|