You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTION.md
+51-54Lines changed: 51 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,78 +4,78 @@ When contributing to this repository, please first discuss the change you wish t
4
4
5
5
Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
6
6
7
-
## How to contribute
7
+
## How to report bugs or feature requests
8
8
9
-
### Reporting bugs or feature requests
10
-
11
-
You can use [Sage Bionetwork's FAIR Data service desk](https://sagebionetworks.jira.com/servicedesk/customer/portal/5/group/8) to **create bug and feature requests**. Providing enough details to the developers to verify and troubleshoot your issue is paramount:
9
+
You can **create bug and feature requests** through [Sage Bionetwork's FAIR Data service desk](https://sagebionetworks.jira.com/servicedesk/customer/portal/5/group/8). Providing enough details to the developers to verify and troubleshoot your issue is paramount:
12
10
-**Provide a clear and descriptive title as well as a concise summary** of the issue to identify the problem.
13
11
-**Describe the exact steps which reproduce the problem** in as many details as possible.
14
12
-**Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
15
13
-**Explain which behavior you expected to see** instead and why.
16
14
-**Provide screenshots of the expected or actual behaviour** where applicable.
17
15
18
-
### General contribution instructions
16
+
##How to contribute code
19
17
20
-
1. Follow the [Github docs](https://help.github.com/articles/fork-a-repo/) to make a copy (a fork) of the repository to your own Github account.
21
-
2.[Clone the forked repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository) to your local machine so you can begin making changes.
22
-
3. Make sure this repository is set as the [upstream remote repository](https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-for-a-fork) so you are able to fetch the latest commits.
23
-
4. Push all your changes to the `develop` branch of the forked repository.
18
+
### The development environment setup
24
19
25
-
*Note*: Make sure you have you have the latest version of the `develop` branch on your local machine.
20
+
For setting up your environment, please follow the instructions in the `README.md` under `Installation Guide For: Contributors`.
26
21
27
-
```
28
-
git checkout develop
29
-
git pull upstream develop
30
-
```
22
+
### The development workflow
31
23
32
-
5. Create pull requests to the upstream repository.
24
+
For new features, bugs, enhancements:
33
25
34
-
### The development lifecycle
26
+
#### 1. Branch Setup
27
+
* Pull the latest code from the develop branch in the upstream repository.
28
+
* Checkout a new branch formatted like so: `develop-<feature/fix-name>` from the develop branch
35
29
36
-
1. Pull the latest content from the `develop` branch of this central repository (not your fork).
37
-
2. Create a branch off the `develop` branch. Name the branch appropriately, either briefly summarizing the bug (ex., `spatil/add-restapi-layer`) or feature or simply use the issue number in the name (ex., `spatil/issue-414-fix`).
38
-
3. After completing work and testing locally, push the code to the appropriate branch on your fork.
39
-
4. In Github, create a pull request from the bug/feature branch of your fork to the `develop` branch of the central repository.
30
+
#### 2. Development Workflow
31
+
* Develop on your new branch.
32
+
* Ensure pyproject.toml and poetry.lock files are compatible with your environment.
33
+
* Add changed files for tracking and commit changes using [best practices](https://www.perforce.com/blog/vcs/git-best-practices-git-commit)
34
+
* Have granular commits: not “too many” file changes, and not hundreds of code lines of changes
35
+
* You can choose to create a draft PR if you prefer to develop this way
40
36
41
-
> A Sage Bionetworks engineer must review and accept your pull request. A code review (which happens with both the contributor and the reviewer present) is required for contributing.
37
+
#### 3. Branch Management
38
+
* Push code to `develop-<feature/fix-name>` in upstream repo:
39
+
```
40
+
git push <upstream> develop-<feature/fix-name>
41
+
```
42
+
* Branch off `develop-<feature/fix-name>` if you need to work on multiple features associated with the same code base
43
+
* After feature work is complete and before creating a PR to the develop branch in upstream
44
+
a. ensure that code runs locally
45
+
b. test for logical correctness locally
46
+
c. run `pre-commit` to style code if the hook is not installed
47
+
c. wait for git workflow to complete (e.g. tests are run) on github
42
48
43
-
### Development environment setup
49
+
#### 4. Pull Request and Review
50
+
* Create a PR from `develop-<feature/fix-name>` into the develop branch of the upstream repo
51
+
* Request a code review on the PR
52
+
* Once code is approved merge in the develop branch. We suggest creating a merge commit for a cleaner commit history on the `develop` branch.
53
+
* Once the actions pass on the main branch, delete the `develop-<feature/fix-name>` branch
*Note*: Use the appropriate version number (based on the version of the codebase you are pulling) while installing the wheel file above.
63
-
64
-
5.[Obtain](https://sage-schematic.readthedocs.io/en/develop/README.html#obtain-google-credentials-file-s) appropriate Google credentials file(s).
65
-
6.[Obtain and Fill in](https://sage-schematic.readthedocs.io/en/develop/README.html#fill-in-configuration-file-s) the `config.yml` file and the `.synapseConfig` file as well as described in the `Fill in Configuration File(s)` part of the documentation.
66
-
7.[Run](https://docs.pytest.org/en/stable/usage.html) the test suite.
65
+
### Update toml file and lock file
66
+
If you install external libraries by using `poetry add <name of library>`, please make sure that you include `pyproject.toml` and `poetry.lock` file in your commit.
67
67
68
-
*Note*: To ensure that all tests run successfully, contact your DCC liason and request to be added to the `schematic-dev`[team](https://www.synapse.org/#!Team:3419888) on Synapse.
68
+
### Code style
69
69
70
-
8.To test new changes made to any of the modules within `schematic`, do the following:
70
+
To ensure consistent code formatting across the project, we use the `pre-commit` hook. You can manually run `pre-commit` across the respository before making a pull request like so:
Further, please consult the [Google Python style guide](http://google.github.io/styleguide/pyguide.html) prior to contributing code to this project.
77
+
Be consistent and follow existing code conventions and spirit.
78
+
79
79
## Release process
80
80
81
81
Once the code has been merged into the `develop` branch on this repo, there are two processes that need to be completed to ensure a _release_ is complete.
@@ -109,12 +109,13 @@ poetry publish # publish the package to PyPI
109
109
110
110
> You'll need to [register](https://pypi.org/account/register/) for a PyPI account before uploading packages to the package index. Similarly for [Test PyPI](https://test.pypi.org/account/register/) as well.
111
111
112
-
## Testing
112
+
## Testing
113
113
114
-
All code added to the client must have tests. The Python client uses pytest to run tests. The test code is located in the [tests](https://github.com/Sage-Bionetworks/schematic/tree/develop-docs-update/tests) subdirectory.
114
+
*All new code must include tests.
115
115
116
-
You can run the test suite in the following way:
116
+
* Tests are written using pytest and are located in the [tests/](https://github.com/Sage-Bionetworks/schematic/tree/develop/tests) subdirectory.
117
117
118
+
* Run tests with:
118
119
```
119
120
pytest -vs tests/
120
121
```
@@ -128,7 +129,3 @@ pytest -vs tests/
128
129
5. Once the PR is merged, leave the original copies on Synapse to maintain support for feature branches that were forked from `develop` before your update.
129
130
- If the old copies are problematic and need to be removed immediately (_e.g._ contain sensitive data), proceed with the deletion and alert the other contributors that they need to merge the latest `develop` branch into their feature branches for their tests to work.
130
131
131
-
## Code style
132
-
133
-
* Please consult the [Google Python style guide](http://google.github.io/styleguide/pyguide.html) prior to contributing code to this project.
134
-
* Be consistent and follow existing code conventions and spirit.
0 commit comments