From 0ba4dc0603960db26f3c150d2f91e33008f86e9b Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 19 Jun 2018 13:18:14 +0100 Subject: [PATCH 1/6] Updated issue and PR templates --- .github/ISSUE_TEMPLATE.md | 36 +++++++++++-- .github/PULL_REQUEST_TEMPLATE.md | 87 +++++++++++++++++++++++++++----- 2 files changed, 107 insertions(+), 16 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index ba295fa1..e49f2c38 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,33 @@ -Please include the following information in your ticket. +Please [read these guidelines](http://ibm.biz/cdt-issue-guide) before opening an issue. -- Cloudant (python-cloudant) version(s) that are affected by this issue. -- Python version -- A small code sample that demonstrates the issue. + + +## Bug Description + +### 1. Steps to reproduce and a small code sample that demonstrates the issue + + +### 2. What you expected to happen + + +### 3. What actually happened + + +## Environment details + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e80303d9..aa44451f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,23 +1,86 @@ + +## Checklist -- [ ] Tick to sign-off your agreement to the [Developer Certificate of Origin (DCO) 1.1](https://github.com/cloudant/python-cloudant/blob/master/DCO1.1.txt) -- [ ] You have added tests for any code changes -- [ ] You have updated the [CHANGES.md](https://github.com/cloudant/python-cloudant/blob/master/CHANGES.md) -- [ ] You have completed the PR template below: +- [ ] Tick to sign-off your agreement to the [Developer Certificate of Origin (DCO) 1.1](../DCO1.1.txt) +- [ ] Added tests for code changes _or_ test/build only changes +- [ ] Updated the change log file (`CHANGES.md`|`CHANGELOG.md`) _or_ test/build only changes +- [ ] Completed the PR template below: -## What +## Description -What was changed, e.g. Added support for querying views. + + +## Approach + + + +## Schema & API Changes + + + +## Security and Privacy + + ## Testing -How to test your changes work, not required for documentation changes. + + +## Monitoring and Logging + From beeb00428a863191b19e1e5816ad3c1e3982e500 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 19 Jun 2018 13:20:00 +0100 Subject: [PATCH 2/6] Updated CONTRIBUTING --- CONTRIBUTING.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.rst | 75 ------------------------------------------ 2 files changed, 84 insertions(+), 75 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 CONTRIBUTING.rst diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..6c51bb00 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,84 @@ +# Contributing + +## Issues + +Please [read these guidelines](http://ibm.biz/cdt-issue-guide) before opening an issue. +If you still need to open an issue then we ask that you complete the template as +fully as possible. + +## Pull requests + +We welcome pull requests, but ask contributors to keep in mind the following: + +* Only PRs with the template completed will be accepted +* We will not accept PRs for user specific functionality + +### Developer Certificate of Origin + +In order for us to accept pull-requests, the contributor must sign-off a +[Developer Certificate of Origin (DCO)](DCO1.1.txt). This clarifies the +intellectual property license granted with any contribution. It is for your +protection as a Contributor as well as the protection of IBM and its customers; +it does not change your rights to use your own Contributions for any other purpose. + +Please read the agreement and acknowledge it by ticking the appropriate box in the PR + text, for example: + +- [x] Tick to sign-off your agreement to the Developer Certificate of Origin (DCO) 1.1 + +## General information + +Python-Cloudant Client Library is written in Python. + +## Requirements + +- Python +- pip + +It is recommended to use a [virtual environment](https://virtualenv.pypa.io/en/latest) during development. The +python-cloudant dependencies can be installed via the `requirements.txt` file using pip. + +For example to create a virtualenv and install requirements: + +```sh +virtualenv . +./bin/activate +pip install -r requirements.txt +pip install -r test-requirements.txt +``` + +## Testing + +The tests need an Apache CouchDB or Cloudant service to run against. + +The tests create databases in your CouchDB instance, these are `db-`. +They also create and delete documents in the `_replicator` database. + +The tests are run with the `nosetests` runner. In this example the `ADMIN_PARTY` environment variable is used to tell + the tests not to use any authentication. See below for the full set of variables that can be used. + +```sh +$ ADMIN_PARTY=true nosetests -w ./tests/unit +``` + +There are several environment variables which affect +test behaviour: + +- `RUN_CLOUDANT_TESTS`: set this to run the tests that use Cloudant-specific features. If + you set this, you must set one of the following combinations of other variables: + - `DB_URL`, `DB_USER` and `DB_PASSWORD`. + - `CLOUDANT_ACCOUNT`, `DB_USER` and `DB_PASSWORD`. + - If you set both `DB_URL` and `CLOUDANT_ACCOUNT`, `DB_URL` is used as the + URL to make requests to and `CLOUDANT_ACCOUNT` is inserted into the `X-Cloudant-User` + header. +- Without `RUN_CLOUDANT_TESTS`, the following environment variables have an effect: + - Set `DB_URL` to set the root URL of the CouchDB/Cloudant instance. It defaults + to `http://localhost:5984`. + - Set `ADMIN_PARTY` to ``true`` to not use any authentication details. + - Without `ADMIN_PARTY`, set `DB_USER` and `DB_PASSWORD` to use those + credentials to access the database. + - Without `ADMIN_PARTY` and `DB_USER`, the tests assume CouchDB is in + admin party mode, but create a user via `_config` to run tests as. + This user is deleted at the end of the test run, but beware it'll + break other applications using the CouchDB instance that rely on + admin party mode being in effect while the tests are running. diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index b4b41f99..00000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,75 +0,0 @@ -Developing this library -======================= - -Python-Cloudant Client Library is written in Python. - -=============================== -Developer Certificate of Origin -=============================== - -In order for us to accept pull-requests, the contributor must sign-off a -`Developer Certificate of Origin (DCO) `_. This clarifies the -intellectual property license granted with any contribution. It is for your -protection as a Contributor as well as the protection of IBM and its customers; -it does not change your rights to use your own Contributions for any other -purpose. - -Please read the agreement and acknowledge it by ticking the appropriate box in -the PR text, for example: - -- [x] Tick to sign-off your agreement to the Developer Certificate of Origin (DCO) 1.1 - -====================== -Development Quickstart -====================== - -Clone the repo into a folder, set up a `virtual environment `_, -install the requirements: - -.. code-block:: bash - - $ git clone git clone git@github.com:cloudant/python-cloudant.git - $ cd python-cloudant - $ virtualenv . - $ ./bin/activate - $ pip install -r requirements.txt - $ pip install -r test-requirements.txt - -Before running the tests, start CouchDB: - -.. code-block:: bash - - $ couchdb - -The tests create databases in your CouchDB instance, these are `db-`. -They also create and delete documents in the `_replicator` database. - -Now, run the tests. Here, I use the ``ADMIN_PARTY`` environment variable to -tell the tests not to use any authentication. See below for the full set of -variables that can be used. - -.. code-block:: bash - - $ ADMIN_PARTY=true nosetests -w ./tests/unit - -There are several environment variables which affect -test behaviour: - -- ``RUN_CLOUDANT_TESTS``: set this to run the tests that use Cloudant-specific features. If - you set this, you must set one of the following combinations of other variables: - - ``DB_URL``, ``DB_USER`` and ``DB_PASSWORD``. - - ``CLOUDANT_ACCOUNT``, ``DB_USER`` and ``DB_PASSWORD``. - - If you set both ``DB_URL`` and ``CLOUDANT_ACCOUNT``, ``DB_URL`` is used as the - URL to make requests to and ``CLOUDANT_ACCOUNT`` is inserted into the ``X-Cloudant-User`` - header. -- Without ``RUN_CLOUDANT_TESTS``, the following environment variables have an effect: - - Set ``DB_URL`` to set the root URL of the CouchDB/Cloudant instance. It defaults - to ``http://localhost:5984``. - - Set ``ADMIN_PARTY`` to ``true`` to not use any authentication details. - - Without ``ADMIN_PARTY``, set ``DB_USER`` and ``DB_PASSWORD`` to use those - credentials to access the database. - - Without ``ADMIN_PARTY`` and ``DB_USER``, the tests assume CouchDB is in - admin party mode, but create a user via ``_config`` to run tests as. - This user is deleted at the end of the test run, but beware it'll - break other applications using the CouchDB instance that rely on - admin party mode being in effect while the tests are running. From 72f0276922b4a6a2dcc7e2524e732f7a0ec17880 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 19 Jun 2018 15:52:12 +0100 Subject: [PATCH 3/6] Fixed markup on true parameter --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c51bb00..21890316 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,7 +74,7 @@ test behaviour: - Without `RUN_CLOUDANT_TESTS`, the following environment variables have an effect: - Set `DB_URL` to set the root URL of the CouchDB/Cloudant instance. It defaults to `http://localhost:5984`. - - Set `ADMIN_PARTY` to ``true`` to not use any authentication details. + - Set `ADMIN_PARTY` to `true` to not use any authentication details. - Without `ADMIN_PARTY`, set `DB_USER` and `DB_PASSWORD` to use those credentials to access the database. - Without `ADMIN_PARTY` and `DB_USER`, the tests assume CouchDB is in From eba45bb591cad33951571d3d7067e0021817dbca Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Tue, 19 Jun 2018 15:52:32 +0100 Subject: [PATCH 4/6] Fixed spacing for version --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e49f2c38..835b6418 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -29,5 +29,5 @@ Got a 400 bad request - Version(s) that are affected by this issue. > 2.0.2 - Python version - >3.6.2 + > 3.6.2 --> From b7f71c97e69ea1885f0529a5e8a14a7213611d68 Mon Sep 17 00:00:00 2001 From: Rich Ellis Date: Wed, 20 Jun 2018 15:46:56 +0100 Subject: [PATCH 5/6] Added feedback from review --- .github/ISSUE_TEMPLATE.md | 16 +++------------ .github/PULL_REQUEST_TEMPLATE.md | 34 +++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 835b6418..95d86bf6 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,25 +4,15 @@ Please [read these guidelines](http://ibm.biz/cdt-issue-guide) before opening an ## Bug Description -### 1. Steps to reproduce and a small code sample that demonstrates the issue +### 1. Steps to reproduce and the simplest code sample possible to demonstrate the issue ### 2. What you expected to happen - ### 3. What actually happened - ## Environment details @@ -34,19 +39,21 @@ particularly sensitive. ## Schema & API Changes ## Security and Privacy ## Monitoring and Logging ## Checklist -- [ ] Tick to sign-off your agreement to the [Developer Certificate of Origin (DCO) 1.1](../DCO1.1.txt) +- [ ] Tick to sign-off your agreement to the [Developer Certificate of Origin (DCO) 1.1](../blob/master/DCO1.1.txt) - [ ] Added tests for code changes _or_ test/build only changes - [ ] Updated the change log file (`CHANGES.md`|`CHANGELOG.md`) _or_ test/build only changes - [ ] Completed the PR template below: