Skip to content

Commit d68f624

Browse files
authored
Merge pull request #1520 from Sage-Bionetworks/develop
v24.10.2
2 parents d4dfaf5 + a8bca77 commit d68f624

File tree

11 files changed

+670
-344
lines changed

11 files changed

+670
-344
lines changed

CONTRIBUTION.md

Lines changed: 51 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,78 +4,78 @@ When contributing to this repository, please first discuss the change you wish t
44

55
Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
66

7-
## How to contribute
7+
## How to report bugs or feature requests
88

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:
1210
- **Provide a clear and descriptive title as well as a concise summary** of the issue to identify the problem.
1311
- **Describe the exact steps which reproduce the problem** in as many details as possible.
1412
- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
1513
- **Explain which behavior you expected to see** instead and why.
1614
- **Provide screenshots of the expected or actual behaviour** where applicable.
1715

18-
### General contribution instructions
16+
## How to contribute code
1917

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
2419

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`.
2621

27-
```
28-
git checkout develop
29-
git pull upstream develop
30-
```
22+
### The development workflow
3123

32-
5. Create pull requests to the upstream repository.
24+
For new features, bugs, enhancements:
3325

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
3529

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
4036

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
4248

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
4454

45-
1. Install [package dependencies](https://sage-schematic.readthedocs.io/en/develop/README.html#installation-requirements-and-pre-requisites).
46-
2. Clone the `schematic` package repository.
55+
### Updating readthedocs documentation
56+
1. Navigate to the docs directory.
57+
2. Run make html to regenerate the build after changes.
58+
3. Contact the development team to publish the updates.
4759

48-
```
49-
git clone https://github.com/Sage-Bionetworks/schematic.git
50-
```
60+
*Helpful resources*:
5161

52-
3. [Create and activate](https://sage-schematic.readthedocs.io/en/develop/README.html#virtual-environment-setup) a virtual environment.
53-
4. Run the following commands to build schematic and install the package along with all of its dependencies:
62+
1. [Getting started with Sphinx](https://www.sphinx-doc.org/en/master/usage/quickstart.html)
63+
2. [Installing Sphinx](https://www.sphinx-doc.org/en/master/usage/installation.html)
5464

55-
```
56-
cd schematic # change directory to schematic
57-
git checkout develop # switch to develop branch of schematic
58-
poetry build # build source and wheel archives
59-
pip install dist/schematicpy-x.y.z-py3-none-any.whl # install wheel file
60-
```
61-
62-
*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.
6767

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
6969

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:
7171

7272
```
73-
# make changes to any files or modules
74-
pip uninstall schematicpy # uninstall package
75-
poetry build
76-
pip install dist/schematicpy-x.y.z-py3-none-any.whl # install wheel file
73+
pre-commit run --all-files
7774
```
7875

76+
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+
7979
## Release process
8080

8181
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
109109

110110
> 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.
111111
112-
## Testing
112+
## Testing
113113

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.
115115

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.
117117

118+
* Run tests with:
118119
```
119120
pytest -vs tests/
120121
```
@@ -128,7 +129,3 @@ pytest -vs tests/
128129
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.
129130
- 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.
130131

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

Comments
 (0)