Skip to content

Commit 21f0287

Browse files
josenavasElDeveloper
authored andcommitted
Adding branch description to Contributing (#2256)
* Adding branch description * Adding spaces * Adding timeline
1 parent ef4f566 commit 21f0287

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#Contributing to Qiita
1+
# Contributing to Qiita
22

33
Qiita is an open source software package, and we welcome community contributions. You can find the source code and test code for Qiita under public revision control in the Qiita git repository on [GitHub](http://github.com/biocore/qiita). We very much welcome contributions.
44

55
This document covers what you should do to get started with contributing to Qiita. You should read this whole document before considering submitting code to Qiita. This will save time for both you and the Qiita developers.
66

7-
#General Notes on Development
7+
# General Notes on Development
88

99
Adding source code to Qiita, can take place in three different modules:
1010

@@ -17,7 +17,15 @@ always take into consideration how these new features affect users and whether
1717
or not adding a new section or document to the documentation (found under the
1818
`doc` folder) would be useful.
1919

20-
###The Qiita development rules
20+
### Repository branch structure
21+
22+
The Qiita repository contains three branches:
23+
24+
* `master`: This branch reflects the code deployed in our [main Qiita server](http://qiita.microbio.me).
25+
* `dev`: This branch is the active development branch. All new Pull Requests should be performed against this branch.
26+
* `release-candidate`: This branch is used to freeze the code from the `dev` branch, so we can deploy in our test servers and exercise the code extensively before deploying in our main system. Code freezes typically occur one week before the scheduled deployment. Check our [milestones page](https://github.com/biocore/qiita/milestones) to see the scheduled deployments.
27+
28+
### The Qiita development rules
2129

2230
Since Qiita is a package that is continuously growing, we found ourselves in a position where development rules needed to be established so we can reduce both development and reviewer time. These rules are:
2331

@@ -46,7 +54,7 @@ Since Qiita is a package that is continuously growing, we found ourselves in a p
4654
9. Last but not least, you are working as part of a team and you should try to help others when possible.
4755

4856

49-
###Configuration file
57+
### Configuration file
5058

5159
The Qiita configuration file determines how the package interacts with your system’s resources (redis, postgres and the IPython cluster). Thus you should review the documentation detailed [here](https://docs.google.com/document/d/1u7kwLP31NM513-8xwpwvLbSQxYu0ehI6Jau1APR13e0/edit#), but especially bear in mind the following points:
5260

@@ -55,21 +63,21 @@ The Qiita configuration file determines how the package interacts with your syst
5563

5664
**A note on data accumulation**: Qiita keeps data in the `BASE_DATA_DIR` as the system gets used. When you drop a Qiita environment and create a fresh testing environment, the “old” data that was generated from the previous environment should be **manually** deleted (or, at least, removed from the data directories in the `BASE_DATA_DIR`).
5765

58-
###Unit tests
66+
### Unit tests
5967

6068
Unit tests in Qiita are located inside the tests/test folder of every sub-module, for example `qiita_db/test/test_metadata_template.py`. These can be executed on a per-file basis or using `nosetests` from the base directory.
6169

6270
During test creation make sure the test class is decorated with `@qiita_test_checker()` if database modifications are done during tests. This will automatically drop and rebuild the qiita schema after the entire test class has been executed. This requires to all the tests in a single class be independent of each other, so stochastic failures do not occur due to different test order execution.
6371

6472
Coverage testing is in effect, so run tests using `nosetests --with-coverage [test_file.py]` to check what lines of new code in your pull request are not tested.
6573

66-
###Documentation
74+
### Documentation
6775

6876
The documentation for Qiita is maintained as part of this repository, under the
6977
`qiita_pet/support_files/doc` folder, for more information, see the README.md
7078
file in `qiita_pet/support_files/doc/README.md`.
7179

72-
###Scripts
80+
### Scripts
7381

7482
Scripts in Qiita are located inside the scripts directory, their actions will rely on the settings described in the Qiita config file, for example if you are dropping a database, the database that will be dropped is the one described by the `DATABASE` setting. The following is a list of the most commonly used commands during development:
7583

@@ -79,16 +87,16 @@ Scripts in Qiita are located inside the scripts directory, their actions will re
7987
* `qiita-env stop_cluster qiita-general`, terminates a cluster named ‘qiita-general’.
8088
* `qiita pet webserver start`, will start the Qiita web-application running on port 21174, you can change this using the `--port` flag, for example `--port=7532`.
8189

82-
##Making Database Changes
90+
## Making Database Changes
8391
After the initial production release of Qiita, changes to the database schema will require patches; the database can no longer be dropped and recreated using the most recent schema because all the data would be lost! Therefore, patches must be applied instead.
8492

85-
###Approach
93+
### Approach
8694

8795
1. We keep "unpatched" versions of the SQL and DBS files in the repository
8896
2. We keep fully patched versions of the DBS and HTML files in the repository
8997
3. We keep a patch file for each patch as required in the `qiita_db/support_files/patches` directory. Note that **the patches will be applied in order based on the natural sort order of their filename** (e.g., `2.sql` will be applied before `10.sql`, and `10.sql` will be applied before `a.sql`)
9098

91-
###Developer Workflow
99+
### Developer Workflow
92100

93101
1. Load the fully patched DBS file (e.g., `qiita-db.dbs`) in [DBSchema](http://www.dbschema.com/)
94102
2. Make desired changes
@@ -101,17 +109,17 @@ After the initial production release of Qiita, changes to the database schema wi
101109

102110
One drawback is that developers will need to have [DBSchema](http://www.dbschema.com/) to develop for this project.
103111

104-
###Data Patches
112+
### Data Patches
105113

106114
If you need to submit a patch that changes only data but does not alter the schema, you should still create a patch file with the next name (e.g., `2.sql`) with your changes. Note that a patch should *not* be created if the modifications do not apply to Qiita databases in general; data patches are only necessary in some cases, e.g., if the terms in an ontology change.
107115

108-
###Python Patches
116+
### Python Patches
109117

110118
Occasionally, SQL alone cannot effect the desired changes, and a corresponding python script must be run after the SQL patch is applied. If this is the case, a python file should be created in the `patches/python_patches` directory, and it should have the same basename as the SQL file. For example, if there is a patch `4.sql` in the `patches` directory, and this patch requires a python script be run after the SQL is applied, then the python file should be placed at `patches/python_patches/4.py`. Note that not every SQL patch will have a corresponding python patch, but every python patch will have a corresponding SQL patch.
111119

112120
If in the future we discover a use-case where a python patch must be applied for which there *is no corresponding SQL patch*, then a blank SQL patch file will still need to be created.
113121

114-
##SQL coding guidelines
122+
## SQL coding guidelines
115123
Since the `qiita_db` code contains a mixture of python code and SQL code, here are some coding guidelines to add SQL code to Qiita:
116124

117125
1. Any SQL keyword should be written uppercased:

0 commit comments

Comments
 (0)