From 847dcefb1456d43d0e48190ab9a670826cc60289 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 30 Apr 2023 15:08:27 +0300 Subject: [PATCH 01/15] copy redis-py CONTRIBUTING.md --- CONTRIBUTING.md | 184 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..3284f21d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,184 @@ +# Contributing + +## Introduction + +First off, thank you for considering contributing to NRedisStack. We value +community contributions! + +## Contributions We Need + +You may already know what you want to contribute \-- a fix for a bug you +encountered, or a new feature your team wants to use. + +If you don't know what to contribute, keep an open mind! Improving +documentation, bug triaging, and writing tutorials are all examples of +helpful contributions that mean less work for you. + +## Your First Contribution + +Unsure where to begin contributing? You can start by looking through +[help-wanted +issues](https://github.com/redis/NRedisStack/labels/help-wanted). + +Never contributed to open source before? Here are a couple of friendly +tutorials: + +- +- + +## Getting Started + +Here's how to get started with your code contribution: + +1. Create your own fork of NRedisStack +2. Do the changes in your fork ***From Here need to be change to NRedisStack instead of redis-py*** +3. + *Create a virtualenv and install the development dependencies from the dev_requirements.txt file:* + + a. python -m venv .venv + b. source .venv/bin/activate + c. pip install -r dev_requirements.txt + +4. If you need a development environment, run `invoke devenv` +5. While developing, make sure the tests pass by running `invoke tests` +6. If you like the change and think the project could use it, send a + pull request + +To see what else is part of the automation, run `invoke -l` + +## The Development Environment + +Running `invoke devenv` installs the development dependencies specified +in the dev_requirements.txt. It starts all of the dockers used by this +project, and leaves them running. These can be easily cleaned up with +`invoke clean`. NOTE: it is assumed that the user running these tests, +can execute docker and its various commands. + +- A master Redis node +- A Redis replica node +- Three sentinel Redis nodes +- A redis cluster +- An stunnel docker, fronting the master Redis node +- A Redis node, running unstable - the latest redis + +The replica node, is a replica of the master node, using the +[leader-follower replication](https://redis.io/topics/replication) +feature. + +The sentinels monitor the master node in a [sentinel high-availability +configuration](https://redis.io/topics/sentinel). + +## Testing + +Call `invoke tests` to run all tests, or `invoke all-tests` to run linters +tests as well. With the 'tests' and 'all-tests' targets, all Redis and +RedisCluster tests will be run. + +It is possible to run only Redis client tests (with cluster mode disabled) by +using `invoke standalone-tests`; similarly, RedisCluster tests can be run by using +`invoke cluster-tests`. + +Each run of tox starts and stops the various dockers required. Sometimes +things get stuck, an `invoke clean` can help. + +Continuous Integration uses these same wrappers to run all of these +tests against multiple versions of python. Feel free to test your +changes against all the python versions supported, as declared by the +tox.ini file (eg: tox -e py39). If you have the various python versions +on your desktop, you can run *tox* by itself, to test all supported +versions. + +### Docker Tips + +Following are a few tips that can help you work with the Docker-based +development environment. + +To get a bash shell inside of a container: + +`$ docker run -it /bin/bash` + +**Note**: The term \"service\" refers to the \"services\" defined in the +`tox.ini` file at the top of the repo: \"master\", \"replicaof\", +\"sentinel_1\", \"sentinel_2\", \"sentinel_3\". + +Containers run a minimal Debian image that probably lacks tools you want +to use. To install packages, first get a bash session (see previous tip) +and then run: + +`$ apt update && apt install ` + +You can see the logging output of a containers like this: + +`$ docker logs -f ` + +The command make test runs all tests in all tested Python +environments. To run the tests in a single environment, like Python 3.9, +use a command like this: + +`$ docker-compose run test tox -e py39 -- --redis-url=redis://master:6379/9` + +Here, the flag `-e py39` runs tests against the Python 3.9 tox +environment. And note from the example that whenever you run tests like +this, instead of using make test, you need to pass +`-- --redis-url=redis://master:6379/9`. This points the tests at the +\"master\" container. + +Our test suite uses `pytest`. You can run a specific test suite against +a specific Python version like this: + +`$ docker-compose run test tox -e py37 -- --redis-url=redis://master:6379/9 tests/test_commands.py` + +### Troubleshooting + +If you get any errors when running `make dev` or `make test`, make sure +that you are using supported versions of Docker. + +Please try at least versions of Docker. + +- Docker 19.03.12 + +## How to Report a Bug + +### Security Vulnerabilities + +**NOTE**: If you find a security vulnerability, do NOT open an issue. +Email [Redis Open Source ()](mailto:oss@redis.com) instead. + +In order to determine whether you are dealing with a security issue, ask +yourself these two questions: + +- Can I access something that's not mine, or something I shouldn't + have access to? +- Can I disable something for other people? + +If the answer to either of those two questions are *yes*, then you're +probably dealing with a security issue. Note that even if you answer +*no* to both questions, you may still be dealing with a security +issue, so if you're unsure, just email [us](mailto:oss@redis.com). + +### Everything Else + +When filing an issue, make sure to answer these five questions: + +1. What version of redis-py are you using? +2. What version of redis are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? + +## How to Suggest a Feature or Enhancement + +If you'd like to contribute a new feature, make sure you check our +issue list to see if someone has already proposed it. Work may already +be under way on the feature you want -- or we may have rejected a +feature like it already. + +If you don't see anything, open a new issue that describes the feature +you would like and how it should work. + +## Code Review Process + +The core team looks at Pull Requests on a regular basis. We will give +feedback as as soon as possible. After feedback, we expect a response +within two weeks. After that time, we may close your PR if it isn't +showing any activity. From a9683c089702fe845e6d56ef9eac6f0c575696ca Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 30 Apr 2023 17:50:43 +0300 Subject: [PATCH 02/15] finish Contributing.md --- CONTRIBUTING.md | 125 +++++++++--------------------------------------- 1 file changed, 22 insertions(+), 103 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3284f21d..092b270b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,112 +31,31 @@ tutorials: Here's how to get started with your code contribution: 1. Create your own fork of NRedisStack -2. Do the changes in your fork ***From Here need to be change to NRedisStack instead of redis-py*** -3. - *Create a virtualenv and install the development dependencies from the dev_requirements.txt file:* +2. Do the changes in your fork +3. Write your tests - a. python -m venv .venv - b. source .venv/bin/activate - c. pip install -r dev_requirements.txt - -4. If you need a development environment, run `invoke devenv` -5. While developing, make sure the tests pass by running `invoke tests` -6. If you like the change and think the project could use it, send a - pull request - -To see what else is part of the automation, run `invoke -l` - -## The Development Environment - -Running `invoke devenv` installs the development dependencies specified -in the dev_requirements.txt. It starts all of the dockers used by this -project, and leaves them running. These can be easily cleaned up with -`invoke clean`. NOTE: it is assumed that the user running these tests, -can execute docker and its various commands. - -- A master Redis node -- A Redis replica node -- Three sentinel Redis nodes -- A redis cluster -- An stunnel docker, fronting the master Redis node -- A Redis node, running unstable - the latest redis - -The replica node, is a replica of the master node, using the -[leader-follower replication](https://redis.io/topics/replication) -feature. - -The sentinels monitor the master node in a [sentinel high-availability -configuration](https://redis.io/topics/sentinel). +4. Use the `docker run -p 6379:6379 -it redis/redis-stack-server` as your local environment for running the functional tests. +5. Make sure your tests pass using `dotnet test' +6. Push your changes to GitHub +7. Open a pull request ## Testing -Call `invoke tests` to run all tests, or `invoke all-tests` to run linters -tests as well. With the 'tests' and 'all-tests' targets, all Redis and -RedisCluster tests will be run. - -It is possible to run only Redis client tests (with cluster mode disabled) by -using `invoke standalone-tests`; similarly, RedisCluster tests can be run by using -`invoke cluster-tests`. - -Each run of tox starts and stops the various dockers required. Sometimes -things get stuck, an `invoke clean` can help. - -Continuous Integration uses these same wrappers to run all of these -tests against multiple versions of python. Feel free to test your -changes against all the python versions supported, as declared by the -tox.ini file (eg: tox -e py39). If you have the various python versions -on your desktop, you can run *tox* by itself, to test all supported -versions. - -### Docker Tips - -Following are a few tips that can help you work with the Docker-based -development environment. - -To get a bash shell inside of a container: - -`$ docker run -it /bin/bash` - -**Note**: The term \"service\" refers to the \"services\" defined in the -`tox.ini` file at the top of the repo: \"master\", \"replicaof\", -\"sentinel_1\", \"sentinel_2\", \"sentinel_3\". - -Containers run a minimal Debian image that probably lacks tools you want -to use. To install packages, first get a bash session (see previous tip) -and then run: - -`$ apt update && apt install ` - -You can see the logging output of a containers like this: - -`$ docker logs -f ` - -The command make test runs all tests in all tested Python -environments. To run the tests in a single environment, like Python 3.9, -use a command like this: - -`$ docker-compose run test tox -e py39 -- --redis-url=redis://master:6379/9` - -Here, the flag `-e py39` runs tests against the Python 3.9 tox -environment. And note from the example that whenever you run tests like -this, instead of using make test, you need to pass -`-- --redis-url=redis://master:6379/9`. This points the tests at the -\"master\" container. - -Our test suite uses `pytest`. You can run a specific test suite against -a specific Python version like this: - -`$ docker-compose run test tox -e py37 -- --redis-url=redis://master:6379/9 tests/test_commands.py` - -### Troubleshooting - -If you get any errors when running `make dev` or `make test`, make sure -that you are using supported versions of Docker. - -Please try at least versions of Docker. - -- Docker 19.03.12 - +Call `dotnet test` to run all tests + +to test specific test you can use `--filter` flag: +```bash +dotnet test --filter +``` + +If you want to run your tests against a specific host, you can do it this way: +```bash +dotnet test --environment="REDIS=" +``` +e.g: +```bash +dotnet test --environment="REDIS=172.17.0.1:6379" +``` ## How to Report a Bug ### Security Vulnerabilities @@ -160,7 +79,7 @@ issue, so if you're unsure, just email [us](mailto:oss@redis.com). When filing an issue, make sure to answer these five questions: -1. What version of redis-py are you using? +1. What version of NRedisStack are you using? 2. What version of redis are you using? 3. What did you do? 4. What did you expect to see? From 29a4ba60ab975e4848ae7e6196ff1658e7ccb41d Mon Sep 17 00:00:00 2001 From: shacharPash Date: Sun, 30 Apr 2023 18:13:27 +0300 Subject: [PATCH 03/15] update wordlist --- .github/wordlist.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/wordlist.txt b/.github/wordlist.txt index 287dfefd..69a237fb 100644 --- a/.github/wordlist.txt +++ b/.github/wordlist.txt @@ -1,16 +1,22 @@ +cli +codecov Codecov +dotnet +firsttimersonly +github HSET +http Json +json +makeapullrequest NRedisStack NuGet OSS -StackExchange -TimeSeries -cli -codecov -dotnet -github -json +oss pre redis +StackExchange +TimeSeries +triaging +www yml From 62d84ffe50a86bdb4bf0d9ce1149550920482779 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:42:39 +0300 Subject: [PATCH 04/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 092b270b..8ff958eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Introduction -First off, thank you for considering contributing to NRedisStack. We value +We appreciate your interest in contributing to NRedisStack. community contributions! ## Contributions We Need From d33f04a04354b19817570aac1465bc1936ad5550 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:42:50 +0300 Subject: [PATCH 05/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ff958eb..15b48fcf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ ## Introduction We appreciate your interest in contributing to NRedisStack. -community contributions! +Community contributions mean a lot to us. ## Contributions We Need From 2c72362263841ec1943f935cca9d54554ae3e29c Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:42:58 +0300 Subject: [PATCH 06/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15b48fcf..6f91eec9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ We appreciate your interest in contributing to NRedisStack. Community contributions mean a lot to us. -## Contributions We Need +## Contributions we need You may already know what you want to contribute \-- a fix for a bug you encountered, or a new feature your team wants to use. From c31fd43b84e0adcaaa8e249088e33c0baa597aa6 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:43:07 +0300 Subject: [PATCH 07/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f91eec9..1d3ecb88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ Community contributions mean a lot to us. ## Contributions we need -You may already know what you want to contribute \-- a fix for a bug you +You may already know how you'd like to contribute, whether it's a fix for a bug you encountered, or a new feature your team wants to use. If you don't know what to contribute, keep an open mind! Improving From d7e223735754b50c801cf9be53307f5892ee3476 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:43:25 +0300 Subject: [PATCH 08/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d3ecb88..3eb42da2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ Community contributions mean a lot to us. You may already know how you'd like to contribute, whether it's a fix for a bug you encountered, or a new feature your team wants to use. -If you don't know what to contribute, keep an open mind! Improving +If you don't know where to start, consider improving documentation, bug triaging, and writing tutorials are all examples of helpful contributions that mean less work for you. From 3be1998046d9d2969e78782c98153cc1c2d0ba2f Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:43:48 +0300 Subject: [PATCH 09/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3eb42da2..a21e37fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ You may already know how you'd like to contribute, whether it's a fix for a bug encountered, or a new feature your team wants to use. If you don't know where to start, consider improving -documentation, bug triaging, and writing tutorials are all examples of +documentation, triaging bugs, or writing tutorials. These are all examples of helpful contributions that mean less work for you. ## Your First Contribution From dde634b0f150510924b4f2c0c8ba0b2de2391ec5 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:44:02 +0300 Subject: [PATCH 10/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a21e37fd..41097128 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,7 +85,7 @@ When filing an issue, make sure to answer these five questions: 4. What did you expect to see? 5. What did you see instead? -## How to Suggest a Feature or Enhancement +## Suggest a feature or enhancement If you'd like to contribute a new feature, make sure you check our issue list to see if someone has already proposed it. Work may already From 44dc45267f0ae38e5ae206a6e4c948a5139e263f Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:44:15 +0300 Subject: [PATCH 11/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41097128..f7a212a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,7 +89,7 @@ When filing an issue, make sure to answer these five questions: If you'd like to contribute a new feature, make sure you check our issue list to see if someone has already proposed it. Work may already -be under way on the feature you want -- or we may have rejected a +be underway on the feature you want or we may have rejected a feature like it already. If you don't see anything, open a new issue that describes the feature From d87f74413235ae84b2dc75c6dd53dddad1c216a8 Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:44:22 +0300 Subject: [PATCH 12/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7a212a2..a16c62f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,7 +95,7 @@ feature like it already. If you don't see anything, open a new issue that describes the feature you would like and how it should work. -## Code Review Process +## Code review process The core team looks at Pull Requests on a regular basis. We will give feedback as as soon as possible. After feedback, we expect a response From b0dd68639bccb60076929532e25e0e2c89b4f86f Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:44:32 +0300 Subject: [PATCH 13/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a16c62f3..afd9dcdb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,7 +97,7 @@ you would like and how it should work. ## Code review process -The core team looks at Pull Requests on a regular basis. We will give +The core team regularly looks at pull requests. We will provide feedback as as soon as possible. After feedback, we expect a response within two weeks. After that time, we may close your PR if it isn't showing any activity. From c7c2d55b3fdb59f55e1f984a1dfc985d42e2c46b Mon Sep 17 00:00:00 2001 From: shacharPash <93581407+shacharPash@users.noreply.github.com> Date: Tue, 2 May 2023 15:44:42 +0300 Subject: [PATCH 14/15] Update CONTRIBUTING.md Co-authored-by: Nermina Miller <102551568+nermiller@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index afd9dcdb..a27b9e80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,6 +98,6 @@ you would like and how it should work. ## Code review process The core team regularly looks at pull requests. We will provide -feedback as as soon as possible. After feedback, we expect a response +feedback as as soon as possible. After receiving our feedback, please respond within two weeks. After that time, we may close your PR if it isn't showing any activity. From 3a81b0b359b334f758a5e5b23b84b0ffeded457d Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 2 May 2023 15:45:50 +0300 Subject: [PATCH 15/15] chayim changes --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a27b9e80..9cb9846a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,7 +34,7 @@ Here's how to get started with your code contribution: 2. Do the changes in your fork 3. Write your tests -4. Use the `docker run -p 6379:6379 -it redis/redis-stack-server` as your local environment for running the functional tests. +4. Use the `docker run -p 6379:6379 -it redis/redis-stack-server:edge` as your local environment for running the functional tests. 5. Make sure your tests pass using `dotnet test' 6. Push your changes to GitHub 7. Open a pull request @@ -48,7 +48,7 @@ to test specific test you can use `--filter` flag: dotnet test --filter ``` -If you want to run your tests against a specific host, you can do it this way: +If you want to run your tests against a specific host and port, you can do it thus: ```bash dotnet test --environment="REDIS=" ```