Skip to content

Commit 515c86f

Browse files
authored
Contributor docs update
2 parents 2639f11 + ccd1399 commit 515c86f

File tree

5 files changed

+108
-44
lines changed

5 files changed

+108
-44
lines changed

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
58+
reported by contacting the project team at <milen.nikolov@sagebase.org>. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

CONTRIBUTION.md

Lines changed: 77 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,101 @@
11
# Contributing
22

3-
When contributing to this repository, please first discuss the change you wish to make via issue,
4-
email, or any other method with the owners of this repository before making a change.
3+
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
54

6-
Please note we have a code of conduct, please follow it in all your interactions with the project.
5+
Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
76

8-
## Getting started
7+
## How to contribute
98

10-
### General Contribution Instructions
9+
### Reporting bugs or feature requests
1110

12-
1. Fork the repository.
13-
2. Clone the forked repository.
14-
3. Push all your changes to the dev branch of the forked repository.
15-
4. Create pull requests to the origin repository.
11+
You can use the [`Issues`](https://github.com/Sage-Bionetworks/schematic/issues) tab to **create bug and feature requests**. Providing enough details to the developers to verify and troubleshoot your issue is paramount:
12+
- **Provide a clear and descriptive title as well as a concise summary** of the issue to identify the problem.
13+
- **Describe the exact steps which reproduce the problem** in as many details as possible.
14+
- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
15+
- **Explain which behavior you expected to see** instead and why.
16+
- **Provide screenshots of the expected or actual behaviour** where applicable.
1617

17-
### Setup Project for Development and Testing
18+
### General contribution instructions
19+
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.
24+
25+
*Note*: Make sure you have you have the latest version of the `develop` branch on your local machine.
26+
27+
```
28+
git checkout develop
29+
git pull upstream develop
30+
```
31+
32+
5. Create pull requests to the upstream repository.
33+
34+
### The development lifecycle
35+
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.
40+
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.
42+
43+
### Development environment setup
44+
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
47+
48+
```
49+
git clone https://github.com/Sage-Bionetworks/schematic.git
50+
```
1851

19-
1. Install [package dependencies](https://sage-schematic.readthedocs.io/en/develop/README.html#installation-requirements-and-pre-requisites).
20-
2. Clone the `schematic` package repository: `git clone https://github.com/Sage-Bionetworks/schematic.git`
2152
3. [Create and activate](https://sage-schematic.readthedocs.io/en/develop/README.html#virtual-environment-setup) a virtual environment.
2253
4. Run the following commands to build schematic and install the package along with all of its dependencies:
23-
```python
24-
cd schematic # change directory to schematic
25-
git checkout develop # switch to develop branch of schematic
26-
poetry build # build source and wheel archives
27-
pip install dist/schematicpy-0.1.11-py3-none-any.whl # install wheel file
28-
```
54+
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+
2964
5. [Obtain](https://sage-schematic.readthedocs.io/en/develop/README.html#obtain-google-credentials-file-s) appropriate Google credentials file(s).
3065
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.
3166
7. [Run](https://docs.pytest.org/en/stable/usage.html) the test suite.
3267

33-
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+
*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.
69+
70+
8. To test new changes made to any of the modules within `schematic`, do the following:
3471

35-
## Pull Request Process
72+
```
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
77+
```
3678

37-
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
38-
build.
39-
2. If needed, update the README.md with details of changes to the interface, this includes new environment
40-
variables, exposed ports, useful file locations and container parameters.
41-
3. You may merge the Pull Request in once you have the sign-off of at least one other developer, or if you
42-
do not have permission to do that, you may request the second reviewer to merge it for you.
43-
4. When merging into dev into master follow release procedures (TODO: releas process to be determined)
79+
## Testing
4480

45-
## Updating Synapse Test Resources
81+
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.
82+
83+
You can run the test suite in the following way:
84+
85+
```
86+
pytest -vs tests/
87+
```
88+
89+
### Updating Synapse test resources
4690

4791
1. Duplicate the entity being updated (or folder if applicable).
4892
2. Edit the duplicates (_e.g._ annotations, contents, name).
49-
3. Update the test suite in your branch to use these duplicates, including the expected values in the test assertions.
50-
4. Open a PR as per the usual process (see above).
51-
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.
52-
- 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.
93+
3. Update the test suite in your branch to use these duplicates, including the expected values in the test assertions.
94+
4. Open a PR as per the usual process (see above).
95+
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.
96+
- 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.
5397

5498
## Code style
5599

56-
* Please consult this code style guide prior contributing code to the project:
57-
http://google.github.io/styleguide/pyguide.html
58-
100+
* Please consult the [Google Python style guide](http://google.github.io/styleguide/pyguide.html) prior to contributing code to this project.
59101
* Be consistent and follow existing code conventions and spirit.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Introduction
55

6-
SCHEMATIC is an acronym for _Schema Engine for Manifest Ingress and Curation_. The Python based infrastructure provides a _novel_ schema-based, data ingress ecosystem, that is meant to streamline the process of dataset annotation, metadata validation and submission to an asset store for various data contributors.
6+
SCHEMATIC is an acronym for _Schema Engine for Manifest Ingress and Curation_. The Python based infrastructure provides a _novel_ schema-based, metadata ingress ecosystem, that is meant to streamline the process of biomedical dataset annotation, metadata validation and submission to a data repository for various data contributors.
77

88
## Installation Requirements and Pre-requisites
99

@@ -61,4 +61,5 @@ Active contributors and maintainers:
6161
- [Milen Nikolov](https://github.com/milen-sage)
6262
- [Sujay Patil](https://github.com/sujaypatil96)
6363
- [Bruno Grande](https://github.com/BrunoGrandePhD)
64+
- [Robert Allaway](https://github.com/allaway)
6465
- [Xengie Doan](https://github.com/xdoan)

docs/README.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ on ``macOS``, you can consider using `miniconda <https://docs.conda.io/en/latest
3434

3535
- `poetry <https://github.com/python-poetry/poetry>`__
3636

37+
If you are using a ``Windows`` machine, typical bash programs will not work
38+
on `cmd` in the same way as they work in the Linux/MacOS terminals. To circumvent this,
39+
it is recommended that you set up
40+
*Bash on Windows* (`WSL <https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/>`__),
41+
`Cygwin <https://cygwin.com/index.html>`__ or `Git Bash <https://gitforwindows.org/>`__ so you can easily execute the
42+
command line utilities that are described later in these docs.
43+
3744
**Note**: Make sure you are a registered and certified user on
3845
`synapse.org <https://www.synapse.org/>`__, and also have all the
3946
right permissions to download credentials files in the following steps.
@@ -52,7 +59,9 @@ credentials files.
5259
5360
.. code:: bash
5461
55-
source .venv/bin/activate # activate the `venv` virtual environment
62+
# activate the `.venv` virtual environment
63+
source .venv/bin/activate # on Linux and MacOS
64+
.\.venv\Scripts\activate # on Windows
5665
5766
3.2. Installing
5867
~~~~~~~~~~~~~~~~~
@@ -67,13 +76,14 @@ credentials files.
6776
There are two main configuration files that need to be edited –
6877
`config.yml <https://github.com/Sage-Bionetworks/schematic/blob/develop/config.yml>`__
6978
and
70-
`.synapseConfig <https://github.com/Sage-Bionetworks/synapsePythonClient/blob/v2.2.2-rc/synapseclient/.synapseConfig>`__.
79+
`.synapseConfig <https://raw.githubusercontent.com/Sage-Bionetworks/synapsePythonClient/v2.3.0-rc/synapseclient/.synapseConfig>`__.
7180

7281
Download a copy of the ``.synapseConfig`` file, open the file in the
7382
editor of your choice and edit the
74-
`authtoken <https://github.com/Sage-Bionetworks/synapsePythonClient/blob/ba42e2d35673d19ce2b5bbd089f4fc1e99aca178/synapseclient/.synapseConfig#L9>`__
83+
`username <https://github.com/Sage-Bionetworks/synapsePythonClient/blob/v2.3.0-rc/synapseclient/.synapseConfig#L8>`__ and
84+
`authtoken <https://github.com/Sage-Bionetworks/synapsePythonClient/blob/v2.3.0-rc/synapseclient/.synapseConfig#L9>`__
7585
attribute under the
76-
`[authentication] <https://github.com/Sage-Bionetworks/synapsePythonClient/blob/ba42e2d35673d19ce2b5bbd089f4fc1e99aca178/synapseclient/.synapseConfig#L7>`__
86+
`[authentication] <https://github.com/Sage-Bionetworks/synapsePythonClient/blob/v2.3.0-rc/synapseclient/.synapseConfig#L7>`__
7787
section.
7888

7989
Description of config.yml attributes
@@ -102,7 +112,7 @@ section.
102112
location: "data/schema_org_schemas/example.jsonld" # path to JSON-LD data model
103113
file_type: "local" # only type "local" is supported currently
104114
validation_schema: "~/path/to/validation_schema.json" # path to custom JSON Validation Schema JSON file
105-
log_location: "~/path/to/log_folder/" # auto-generated JSON Validation Schemas can be logged
115+
log_location: "~/path/to/log_folder/validation_schema.json" # auto-generated JSON Validation Schemas can be logged
106116
107117

108118
Note: Paths can be specified relative to the `config.yml` file or as absolute paths.
@@ -125,7 +135,10 @@ refer to the ``Credentials`` section in the
125135
document.
126136

127137
Use the ``schematic_service_account_creds.json`` file for the service
128-
account mode of authentication (*for Google services/APIs*).
138+
account mode of authentication (*for Google services/APIs*). Service accounts
139+
are special Google accounts that can be used by applications to access Google APIs
140+
programmatically via OAuth2.0, with the advantage being that they do not require
141+
human authorization.
129142

130143
Note: The ``Selection Options`` dropdown which allows the user to select
131144
multiple values in a cell during manifest annotation `does not
@@ -199,4 +212,5 @@ Active contributors and maintainers:
199212
- `Milen Nikolov <https://github.com/milen-sage>`__
200213
- `Sujay Patil <https://github.com/sujaypatil96>`__
201214
- `Bruno Grande <https://github.com/BrunoGrandePhD>`__
215+
- `Robert Allaway <https://github.com/allaway>`__
202216
- `Xengie Doan <https://github.com/xdoan>`__

docs/md/details.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Credentials
22

3+
## OAuth2.0
34
The `credentials.json` file is required when you are using [`OAuth2`](https://developers.google.com/identity/protocols/oauth2) to authenticate with the Google APIs.
45

56
Steps involved in the `OAuth2` [authorization flow](https://github.com/Sage-Bionetworks/schematic/blob/develop/schematic/utils/google_api_utils.py#L18):
@@ -8,4 +9,10 @@ Steps involved in the `OAuth2` [authorization flow](https://github.com/Sage-Bion
89
- If the `token.pickle` file does not exist, the app will load the credentials for you from the `credentials.json` file and create a `token.pickle` in your project root directory when you access any of the schematic services (e.g., through the Command Line Interface) and the authorization flow completes for the first time. For this:
910
- A URL will be prompted to you when you access a _schematic_ CLI utility. Copy the URL from the console and open it in your browser.
1011
- If you are not already logged into your Google account, you will be prompted to log in. If you are logged into multiple Google accounts, you will be asked to select one account to use for the authorization.
11-
- You might see a "Google hasn’t verified this app" warning from Chrome on your browser. To resolve this, click on "Advanced" and then "Quickstart (unsafe)". Select a Google account and authorize the _Quickstart_ script to access Google Drive/Sheets under your account.
12+
- You might see a "Google hasn’t verified this app" warning from Chrome on your browser. To resolve this, click on "Advanced" and then "Quickstart (unsafe)". Select a Google account and authorize the _Quickstart_ script to access Google Drive/Sheets under your account.
13+
14+
## Service Account
15+
- The Google OAuth 2.0 system supports server-to-server interactions such as those between a web application and a Google service. For this scenario you need a service account, which is an account that belongs to your application instead of to an individual end user. Your application calls Google APIs on behalf of the service account, so users aren't directly involved.
16+
- Typically, an application uses a service account when the application uses Google APIs to work with its own data rather than a user's data.
17+
- The `service_account_creds.json` file is a key file that schematic will need access to in order to use the service account mode of authentication.
18+
-

0 commit comments

Comments
 (0)