Skip to content

Commit

Permalink
Merge pull request #578 from stevengill/master
Browse files Browse the repository at this point in the history
2.5.0
  • Loading branch information
stevengill committed Dec 9, 2019
2 parents 5411500 + b854aa9 commit 0c46f6a
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 38 deletions.
48 changes: 27 additions & 21 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You should also make sure you have the latest versions of `pip`, `setuptools`, `

On macOS, the easiest way to install these tools is by using [Homebrew](https://brew.sh/) and installing the `python`
and `python3` packages. Some of the above packages are preinstalled and you can install the remaining on your own:
`pip install virtualenv wheel twine tox && pip3 install virtualenv twine tox`.
`pip install virtualenv wheel twine tox sphinx && pip3 install virtualenv twine tox sphinx`.

## Tasks

Expand All @@ -40,15 +40,21 @@ You can generate the documentation by running `tox -e docs`.
### Releasing

1. Create the commit for the release:
* Bump the version number in adherence to [Semantic Versioning](http://semver.org/) in `slackclient/version.py`.
* Commit with a message including the new version number. For example `1.0.6`.

- Bump the version number in adherence to [Semantic Versioning](http://semver.org/) in `slackclient/version.py`.
- Add a description of changes to the Changelog in `docs-src/changelog.rst`
- Build the docs with `./docs.sh`.
- Commit with a message including the new version number. For example `2.5.0`.
- Push the commit to a branch and create a PR to sanity check.
- Merge in release PR.
- Create a git tag for the release. For example `git tag 2.5.0`.
- Push the tag up to github with `git push origin --tags`

2. Distribute the release
* Build the distribtuions: `python setup.py sdist bdist_wheel`. This will create artifacts in the `dist` directory.
* Publish to PyPI: `twine upload dist/*`. You must have access to the credentials to publish.
* Create a GitHub Release. You will select the commit with updated version number (e.g. `1.0.6`) to assiociate with
the tag, and name the tag after this version (e.g. `1.0.6`). This will also serve as a Changelog for the project.
Add a description of changes to the Release. Mention Issue and PR #'s and @-mention contributors.

- Build the distribtuions: `python setup.py sdist bdist_wheel --universal`. This will create artifacts in the `dist` directory.
- Publish to PyPI: `twine upload dist/*`. You must have access to the credentials to publish.
- Create a GitHub Release. You will select the commit with updated version number (e.g. `2.5.0`) to assiociate with the tag, and name the tag after this version (e.g. `2.5.0`). This will also serve as a Changelog for the project. Add a description of changes to the Release. Mention Issue and PR #'s and @-mention contributors.

3. (Slack Internal) Communicate the release internally. Include a link to the GitHub Release.

Expand All @@ -75,18 +81,18 @@ versions.

Labels are used to run issues through an organized workflow. Here are the basic definitions:

* `bug`: A confirmed bug report. A bug is considered confirmed when reproduction steps have been
documented and the issue has been reproduced.
* `enhancement`: A feature request for something this package might not already do.
* `docs`: An issue that is purely about documentation work.
* `tests`: An issue that is purely about testing work.
* `needs feedback`: An issue that may have claimed to be a bug but was not reproducible, or was otherwise missing some information.
* `discussion`: An issue that is purely meant to hold a discussion. Typically the maintainers are looking for feedback in this issues.
* `question`: An issue that is like a support request because the user's usage was not correct.
* `semver:major|minor|patch`: Metadata about how resolving this issue would affect the version number.
* `security`: An issue that has special consideration for security reasons.
* `good first contribution`: An issue that has a well-defined relatively-small scope, with clear expectations. It helps when the testing approach is also known.
* `duplicate`: An issue that is functionally the same as another issue. Apply this only if you've linked the other issue by number.
- `bug`: A confirmed bug report. A bug is considered confirmed when reproduction steps have been
documented and the issue has been reproduced.
- `enhancement`: A feature request for something this package might not already do.
- `docs`: An issue that is purely about documentation work.
- `tests`: An issue that is purely about testing work.
- `needs feedback`: An issue that may have claimed to be a bug but was not reproducible, or was otherwise missing some information.
- `discussion`: An issue that is purely meant to hold a discussion. Typically the maintainers are looking for feedback in this issues.
- `question`: An issue that is like a support request because the user's usage was not correct.
- `semver:major|minor|patch`: Metadata about how resolving this issue would affect the version number.
- `security`: An issue that has special consideration for security reasons.
- `good first contribution`: An issue that has a well-defined relatively-small scope, with clear expectations. It helps when the testing approach is also known.
- `duplicate`: An issue that is functionally the same as another issue. Apply this only if you've linked the other issue by number.

**Triage** is the process of taking new issues that aren't yet "seen" and marking them with a basic level of information
with labels. An issue should have **one** of the following labels applied: `bug`, `enhancement`, `question`,
Expand All @@ -97,4 +103,4 @@ reopening is great and better than creating a duplicate issue.

## Everything else

When in doubt, find the other maintainers and ask.
When in doubt, find the other maintainers and ask.
6 changes: 6 additions & 0 deletions docs-src/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
==============================================

v2.5.0 (2019-12-09)
-------------------
**New Features**

1. [WebClient] Adding new oauth.v2.access Web API method. #577

v2.4.0 (2019-11-27)
-------------------
**New Features**
Expand Down
6 changes: 6 additions & 0 deletions docs/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-5-0-2019-12-09">v2.5.0 (2019-12-09)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-4-0-2019-11-27">v2.4.0 (2019-11-27)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-3-1-2019-10-29">v2.3.1 (2019-10-29)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-3-0-2019-10-22">v2.3.0 (2019-10-22)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-2-1-2019-10-08">v2.2.1 (2019-10-08)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-2-0-2019-09-25">v2.2.0 (2019-09-25)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-1-0-2019-07-01">v2.1.0 (2019-07-01)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-0-0-2019-04-29">v2.0.0 (2019-04-29)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v1-3-1-2019-02-28">v1.3.1 (2019-02-28)</a></li>
Expand Down
16 changes: 11 additions & 5 deletions docs/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a><ul>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-5-0-2019-12-09">v2.5.0 (2019-12-09)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-4-0-2019-11-27">v2.4.0 (2019-11-27)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-3-1-2019-10-29">v2.3.1 (2019-10-29)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-3-0-2019-10-22">v2.3.0 (2019-10-22)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-2-1-2019-10-08">v2.2.1 (2019-10-08)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-2-0-2019-09-25">v2.2.0 (2019-09-25)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-1-0-2019-07-01">v2.1.0 (2019-07-01)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-0-0-2019-04-29">v2.0.0 (2019-04-29)</a></li>
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v1-3-1-2019-02-28">v1.3.1 (2019-02-28)</a></li>
Expand Down Expand Up @@ -244,7 +250,7 @@ <h2>Single Workspace Install<a class="headerlink" href="#single-workspace-instal
</div>
<div class="section" id="multiple-workspace-install">
<h2>Multiple Workspace Install<a class="headerlink" href="#multiple-workspace-install" title="Permalink to this headline"></a></h2>
<p>If you intend for an app to be installed on multiple Slack workspaces, you will need to handle this installation via the industry-standard OAuth protocol. You can read more about <a class="reference external" href="https://api.slack.com/docs/oauth">how Slack handles Oauth</a>.</p>
<p>If you intend for an app to be installed on multiple Slack workspaces, you will need to handle this installation via the industry-standard OAuth protocoal. You can read more about <a class="reference external" href="https://api.slack.com/docs/oauth">how Slack handles Oauth</a>.</p>
<p>(The OAuth exchange is facilitated via HTTP and requires a webserver; in this example, we’ll use <a class="reference external" href="http://flask.pocoo.org/">Flask</a>.)</p>
<p>To configure your app for OAuth, you’ll need a client ID, a client secret, and a set of one or more scopes that will be applied to the token once it is granted. The client ID and client secret are available from your <a class="reference external" href="https://api.slack.com/apps">app’s configuration page</a>. The scopes are determined by the functionality of the app – every method you wish to access has a corresponding scope and your app will need to request that scope in order to be able to access the method. Review Slack’s <a class="reference external" href="https://api.slack.com/docs/oauth-scopes">full list of OAuth scopes</a>.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span>
Expand All @@ -261,14 +267,14 @@ <h2>Multiple Workspace Install<a class="headerlink" href="#multiple-workspace-in
<p><strong>The OAuth initiation link</strong></p>
<p>To begin the OAuth flow that will install your app on a workspace, you’ll need to provide the user with a link to Slack’s OAuth page. This can be a simple link to <a class="reference external" href="https://slack.com/oauth/authorize">https://slack.com/oauth/authorize</a> with <code class="docutils literal notranslate"><span class="pre">scope</span></code> and <code class="docutils literal notranslate"><span class="pre">client_id</span></code> query parameters, or you can use our pre-built <a class="reference external" href="https://api.slack.com/docs/slack-button">Add to Slack button</a> to do all the work for you.</p>
<p>This link directs the user to Slack’s OAuth acceptance page, where the user will review and accept or refuse the permissions your app is requesting as defined by the scope(s).</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@app.route</span><span class="p">(</span><span class="s2">&quot;/begin_auth&quot;</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;GET&quot;</span><span class="p">])</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">&quot;/begin_auth&quot;</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;GET&quot;</span><span class="p">])</span>
<span class="k">def</span> <span class="nf">pre_install</span><span class="p">():</span>
<span class="k">return</span> <span class="n">f</span><span class="s1">&#39;&lt;a href=&quot;https://slack.com/oauth/authorize?scope={ oauth_scope }&amp;client_id={ client_id }&quot;&gt;Add to Slack&lt;/a&gt;&#39;</span>
<span class="k">return</span> <span class="sa">f</span><span class="s1">&#39;&lt;a href=&quot;https://slack.com/oauth/authorize?scope={ oauth_scope }&amp;client_id={ client_id }&quot;&gt;Add to Slack&lt;/a&gt;&#39;</span>
</pre></div>
</div>
<p><strong>The OAuth completion page</strong></p>
<p>Once the user has agreed to the permissions you’ve requested, Slack will redirect the user to your auth completion page, which includes a <code class="docutils literal notranslate"><span class="pre">code</span></code> query string param. You’ll use the <code class="docutils literal notranslate"><span class="pre">code</span></code> param to call the <code class="docutils literal notranslate"><span class="pre">oauth.access</span></code> <a class="reference external" href="https://api.slack.com/methods/oauth.access">endpoint</a> that will finally grant you the token.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@app.route</span><span class="p">(</span><span class="s2">&quot;/finish_auth&quot;</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;GET&quot;</span><span class="p">,</span> <span class="s2">&quot;POST&quot;</span><span class="p">])</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">&quot;/finish_auth&quot;</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;GET&quot;</span><span class="p">,</span> <span class="s2">&quot;POST&quot;</span><span class="p">])</span>
<span class="k">def</span> <span class="nf">post_install</span><span class="p">():</span>
<span class="c1"># Retrieve the auth code from the request params</span>
<span class="n">auth_code</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s1">&#39;code&#39;</span><span class="p">]</span>
Expand Down Expand Up @@ -326,4 +332,4 @@ <h2>Multiple Workspace Install<a class="headerlink" href="#multiple-workspace-in
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
</body>
</html>
</html>
Loading

0 comments on commit 0c46f6a

Please sign in to comment.