|
| 1 | +.. _Contributing: |
| 2 | + |
| 3 | +============ |
| 4 | +Contributing |
| 5 | +============ |
| 6 | + |
| 7 | +*webexteamssdk* is a community development project. Feedback, thoughts, ideas, and code contributions are most welcome! |
| 8 | + |
| 9 | + |
| 10 | +How to contribute Feedback, Issues, Thoughts and Ideas |
| 11 | +======================================================= |
| 12 | + |
| 13 | +Please use the `issues`_ page to report issues or post ideas for enhancement. |
| 14 | + |
| 15 | +Join our `webexteamssdk - Webex Teams SDK - Python Community Contributors <https://eurl.io/#BJ0A8gfOQ>`_ Webex Teams space to join the conversation with other contributors to this project. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +Interested in Contributing Code? |
| 20 | +================================ |
| 21 | + |
| 22 | + |
| 23 | +Developer Scripts |
| 24 | +----------------- |
| 25 | + |
| 26 | +We have created some scripts to automate everyday actions needed when working on the project. Please see the `script`_ directory, and it's README for more information. |
| 27 | + |
| 28 | + |
| 29 | +Notes on the Test Suite |
| 30 | +----------------------- |
| 31 | + |
| 32 | +To test all the API endpoints, the account that you use for testing must be an *admin* user for your Webex Teams Organization. Additionally, you should know that that the testing process creates some test people, rooms, messages, teams, and etc. as part of executing the test suite. We strongly recommend *NOT* running the test suite using your personal Webex Teams account (not that you can't; it's just that you probably don't want it cluttering your account with all these test artifacts). |
| 33 | + |
| 34 | +If you cannot create a test account with *admin* privileges or configure your environment to run the test suite locally, you may always submit your code via a pull request. Our GitHub/Travis CI setup runs the test suite against all pull requests. All tests must pass before your pull request is accepted. |
| 35 | + |
| 36 | + |
| 37 | +Contributing Code - Using the CI Automated Testing |
| 38 | +-------------------------------------------------- |
| 39 | + |
| 40 | +1. Check for open `issues`_ or create a new *issue* for the item you want to work on and make sure to comment and let us know that you are working on it. |
| 41 | + |
| 42 | +2. Fork a copy of the `repository`_ and clone your forked repository to your development environment. |
| 43 | + |
| 44 | +3. Run ``script/setup`` to install the development dependencies and setup your environment. |
| 45 | + |
| 46 | +4. Configure the following environment variables in your development environment: |
| 47 | + |
| 48 | + * ``WEBEX_TEAMS_ACCESS_TOKEN`` - Your test account's Webex Teams access token. |
| 49 | + |
| 50 | +5. Add your code to your forked repository. |
| 51 | + |
| 52 | + If you are creating some new feature or functionality (excellent!), please also write a `test`_ to verify that your code works as expected. |
| 53 | + |
| 54 | +6. We follow `PEP8`_ reasonably strictly for this project. Please make sure your code passes the linter. |
| 55 | + |
| 56 | + Run ``script/test lint`` or simply run ``flake8`` from the project root. |
| 57 | + |
| 58 | +7. Commit your changes. |
| 59 | + |
| 60 | +8. Submit a `pull request`_. The GitHub/Travis CI system runs the test suite against your pull request code. If any tests fail, please review your changes. If everything looks good, we will gladly merge your request! |
| 61 | + |
| 62 | + |
| 63 | +Contributing Code - Running the Test Suite Locally |
| 64 | +-------------------------------------------------- |
| 65 | + |
| 66 | +1. Check for open `issues`_ or create a new 'issue' for the item you want to work on and make sure to comment and let us know that you are working on it. |
| 67 | + |
| 68 | +2. Fork a copy of the `repository`_ and clone your forked repository to your development environment. |
| 69 | + |
| 70 | + Run ``script/setup`` to install the development dependencies and setup your environment. |
| 71 | + |
| 72 | +3. Configure the following environment variables in your development environment: |
| 73 | + |
| 74 | + * ``WEBEX_TEAMS_ACCESS_TOKEN`` - Your test account's Webex Teams access token. |
| 75 | + |
| 76 | + * ``WEBEX_TEAMS_TEST_DOMAIN`` - The test suite creates some users as part of the testing process. The test suite uses this domain name as the e-mail suffix of for the user's e-mail addresses. |
| 77 | + |
| 78 | + * `` WEBEX_TEAMS_TEST_ID_START`` - The test suite uses this integer as the starting number for creating test user accounts (example: " [email protected]"). |
| 79 | + |
| 80 | + * ``WEBEX_TEAMS_TEST_FILE_URL`` - Configure this environment variable with a URL referencing a file that can be downloaded and posted to Webex Teams as part of the testing process. |
| 81 | + |
| 82 | + *Example:* |
| 83 | + |
| 84 | + .. code-block:: bash |
| 85 | +
|
| 86 | + #!/usr/bin/env bash |
| 87 | + export WEBEX_TEAMS_ACCESS_TOKEN="<test account's access token>" |
| 88 | + export WEBEX_TEAMS_TEST_DOMAIN="domain.com" |
| 89 | + export WEBEX_TEAMS_TEST_ID_START=42 |
| 90 | + export WEBEX_TEAMS_TEST_FILE_URL="https://www.webex.com/content/dam/wbx/us/images/dg-integ/teams_icon.png" |
| 91 | +
|
| 92 | +
|
| 93 | +4. Add your code to your forked repository. |
| 94 | + |
| 95 | + If you are creating some new feature or functionality (excellent!), please also write a `test`_ to verify that your code works as expected. |
| 96 | + |
| 97 | +5. We follow `PEP8`_ reasonably strictly for this project. Please make sure your code passes the linter. |
| 98 | + |
| 99 | + Run ``script/test lint`` or simply run ``flake8`` from the project root. |
| 100 | + |
| 101 | +6. Commit your changes. |
| 102 | + |
| 103 | +7. Ensure your code passes all of the default tests. |
| 104 | + |
| 105 | + Run ``script/test`` and ensure all tests execute successfully. |
| 106 | + |
| 107 | +8. Submit a `pull request`_. If everything looks good, we will gladly merge your request! |
| 108 | + |
| 109 | + |
| 110 | +.. _script: https://github.com/CiscoDevNet/webexteamssdk/tree/master/script |
| 111 | +.. _issues: https://github.com/CiscoDevNet/webexteamssdk/issues |
| 112 | +.. _repository: https://github.com/CiscoDevNet/webexteamssdk |
| 113 | +.. _test: https://github.com/CiscoDevNet/webexteamssdk/tree/master/tests |
| 114 | +.. _PEP8: https://www.python.org/dev/peps/pep-0008/ |
| 115 | +.. _pull request: https://github.com/CiscoDevNet/webexteamssdk/pulls |
0 commit comments