Skip to content

Commit 973a9b6

Browse files
authored
Merge branch 'main' into zimeg-feat-hooks-watch
2 parents 5312738 + 49f25d8 commit 973a9b6

14 files changed

Lines changed: 225 additions & 164 deletions

File tree

.github/CODEOWNERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Salesforce Open Source project configuration
2+
# Learn more: https://github.com/salesforce/oss-template
3+
#ECCN:Open Source
4+
#GUSINFO:Open Source,Open Source Workflow
5+
6+
# @slackapi/slack-platform-python
7+
# are code reviewers for all changes in this repo.
8+
* @slackapi/slack-platform-python
9+
10+
# @slackapi/developer-education
11+
# are code reviewers for changes in the `/docs` directory.
12+
/docs/ @slackapi/developer-education

.github/maintainers_guide.md

Lines changed: 81 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ this project. If you use this package within your own software as is but don't p
1010

1111
We recommend using [pyenv](https://github.com/pyenv/pyenv) for Python runtime management. If you use macOS, follow the following steps:
1212

13-
```zsh
13+
```sh
1414
brew update
1515
brew install pyenv
1616
```
1717

1818
Install necessary Python runtimes for development/testing. You can rely on GitHub Actions for testing with various major versions.
1919

20-
```zsh
20+
```sh
2121
pyenv install -l | grep -v "-e[conda|stackless|pypy]"
2222

2323
pyenv install 3.9.18 # select the latest patch version
@@ -34,7 +34,7 @@ pyenv rehash
3434

3535
Then, you can create a new Virtual Environment this way:
3636

37-
```zsh
37+
```sh
3838
python -m venv env_3.9.18
3939
source env_3.9.18/bin/activate
4040
```
@@ -49,38 +49,38 @@ If you make some changes to this project, please write corresponding unit tests
4949

5050
If this is your first time to run tests, although it may take a bit longer, running the following script is the easiest.
5151

52-
```zsh
52+
```sh
5353
./scripts/install_and_run_tests.sh
5454
```
5555

5656
To simply install all the development dependencies for this project.
5757

58-
```zsh
58+
```sh
5959
./scripts/install.sh
6060
```
6161

6262
Once you installed all the required dependencies, you can use the following.
6363

64-
```zsh
64+
```sh
6565
./scripts/run_tests.sh
6666
./scripts/run_tests.sh tests/scenario_test/test_get_hooks.py
6767
```
6868

6969
To format this project
7070

71-
```zsh
71+
```sh
7272
./scripts/format.sh
7373
```
7474

7575
To lint this project
7676

77-
```zsh
77+
```sh
7878
./scripts/lint.sh
7979
```
8080

8181
This project uses [mypy](https://mypy.readthedocs.io/en/stable/index.html) to check and infers types for your Python code.
8282

83-
```zsh
83+
```sh
8484
./scripts/run_mypy.sh
8585
```
8686

@@ -92,7 +92,7 @@ If you want to test the package locally you can.
9292

9393
- Run
9494

95-
```zsh
95+
```sh
9696
scripts/build_pypi_package.sh
9797
```
9898

@@ -103,7 +103,7 @@ If you want to test the package locally you can.
103103
- Example `/dist/slack_cli_hooks-1.2.3-py2.py3-none-any.whl` was created
104104
- From anywhere on your machine you can install this package to a project with
105105

106-
```zsh
106+
```sh
107107
pip install <project path>/dist/slack_cli_hooks-1.2.3-py2.py3-none-any.whl
108108
```
109109

@@ -113,125 +113,101 @@ If you want to test the package locally you can.
113113

114114
[TestPyPI](https://test.pypi.org/) is a separate instance of the Python Package
115115
Index that allows you to try distribution tools and processes without affecting
116-
the real index. This is useful with changes that relate to the package itself,
117-
example the contents of the `pyproject.toml`
116+
the real index. This is particularly useful when making changes related to the
117+
package configuration itself, for example, modifications to the `pyproject.toml` file.
118118

119-
The following can be used to deploy this project on <https://test.pypi.org/>.
119+
You can deploy this project to TestPyPI using GitHub Actions.
120120

121-
```zsh
121+
To deploy using GitHub Actions:
122122

123+
1. Push your changes to a branch or tag
124+
2. Navigate to <https://github.com/slackapi/python-slack-hooks/actions/workflows/pypi-release.yml>
125+
3. Click on "Run workflow"
126+
4. Select your branch or tag from the dropdown
127+
5. Click "Run workflow" to build and deploy your branch to TestPyPI
128+
129+
Alternatively, you can deploy from your local machine with:
130+
131+
```sh
123132
./scripts/deploy_to_test_pypi.sh
124133
```
125134

126135
#### Development Deployment
127136

128-
Deploying a new version of this library to Pypi is triggered by publishing a Github Release.
137+
Deploying a new version of this library to PyPI is triggered by publishing a GitHub Release.
129138
Before creating a new release, ensure that everything on a stable branch has
130139
landed, then [run the tests](#run-all-the-unit-tests).
131140

132-
1. Create a branch in which the development release will live:
133-
- Bump the version number in adherence to
134-
[Semantic Versioning](http://semver.org/) and
135-
[Developmental Release](https://peps.python.org/pep-0440/#developmental-releases)
136-
in `slack_cli_hooks/version.py`
137-
- Example the current version is `1.2.3` a proper development bump would be
138-
`1.2.3.dev0`
139-
- `.dev` will indicate to pip that this is a
140-
[Development Release](https://peps.python.org/pep-0440/#developmental-releases)
141-
- Note that the `dev` version can be bumped in development releases:
142-
`1.2.3.dev0` -> `1.2.3.dev1`
143-
- Commit with a message including the new version number. For example
144-
`1.2.3.dev0` & Push the commit to a branch where the development release
145-
will live (create it if it does not exist)
146-
- `git checkout -b future-release`
147-
- `git commit -m 'version 1.2.3.dev0'`
148-
- `git push -u origin future-release`
149-
2. Create a new GitHub Release from the
150-
[Releases page](https://github.com/slackapi/python-slack-hooks/releases) by
151-
clicking the "Draft a new release" button.
152-
3. Input the version manually into the "Choose a tag" input. You must use the
153-
same version found in `slack_cli_hooks/version.py`
154-
155-
- After you input the new version, click the "Create a new tag: x.x.x on
156-
publish" button. This won't create your tag immediately.
157-
- Auto-generate the release notes by clicking the "Auto-generate release
158-
notes" button. This will pull in changes that will be included in your
159-
release.
160-
- Edit the resulting notes to ensure they have decent messaging that are
161-
understandable by non-contributors, but each commit should still have it's
162-
own line.
163-
- Ensure that this version adheres to
164-
[semantic versioning](http://semver.org/) and
165-
[Developmental Release](https://peps.python.org/pep-0440/#developmental-releases).
166-
See [Versioning](#versioning-and-tags) for correct version format.
167-
168-
4. Set the "Target" input to the feature branch with the development changes.
169-
5. Name the release title after the version tag. It should match the updated
170-
value from `slack_cli_hooks/version.py`!
171-
6. Make any adjustments to generated release notes to make sure they are
172-
accessible and approachable and that an end-user with little context about
173-
this project could still understand.
174-
7. Select "Set as a pre-release"
175-
8. Publish the release by clicking the "Publish release" button!
176-
9. After a few minutes, the corresponding version will be available on
177-
<https://pypi.org/project/slack-cli-hooks/>.
178-
10. (Slack Internal) Communicate the release internally
141+
1. Create the commit for the release
142+
1. Use the latest supported Python version. Using a [virtual environment](#python-and-friends) is recommended.
143+
2. In `slack_cli_hooks/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and [Developmental Release](https://peps.python.org/pep-0440/#developmental-releases).
144+
- Example: if the current version is `1.2.3`, a proper development bump would be `1.2.4.dev0`
145+
- `.dev` will indicate to pip that this is a [Development Release](https://peps.python.org/pep-0440/#developmental-releases)
146+
- Note that the `dev` version can be bumped in development releases: `1.2.4.dev0` -> `1.2.4.dev1`
147+
3. Commit with a message including the new version number. For example `1.2.4.dev0` & push the commit to a branch where the development release will live (create it if it does not exist)
148+
1. `git checkout -b future-release`
149+
2. `git add --all` (review files with `git status` before committing)
150+
3. `git commit -m 'chore(release): version 1.2.4.dev0'`
151+
4. `git push -u origin future-release`
152+
2. Create a new GitHub Release
153+
1. Navigate to the [Releases page](https://github.com/slackapi/python-slack-hooks/releases).
154+
2. Click the "Draft a new release" button.
155+
3. Set the "Target" to the feature branch with the development changes.
156+
4. Click "Tag: Select tag"
157+
5. Input a new tag name manually. The tag name must match the version in `slack_cli_hooks/version.py` prefixed with "v" (e.g., if version is `1.2.4.dev0`, enter `v1.2.4.dev0`)
158+
6. Click the "Create a new tag" button. This won't create your tag immediately.
159+
7. Click the "Generate release notes" button.
160+
8. The release name should match the tag name!
161+
9. Edit the resulting notes to ensure they have decent messaging that is understandable by non-contributors, but each commit should still have its own line.
162+
10. Set this release as a pre-release.
163+
11. Publish the release by clicking the "Publish release" button!
164+
3. Navigate to the [release workflow run](https://github.com/slackapi/python-slack-hooks/actions/workflows/pypi-release.yml). You will need to approve the deployment!
165+
4. After a few minutes, the corresponding version will be available on <https://pypi.org/project/slack-cli-hooks>.
166+
5. (Slack Internal) Communicate the release internally
179167
180168
#### Production Deployment
181169
182-
Deploying a new version of this library to Pypi is triggered by publishing a Github Release.
170+
Deploying a new version of this library to PyPI is triggered by publishing a GitHub Release.
183171
Before creating a new release, ensure that everything on the `main` branch since
184-
the last tag is in a releasable state! At a minimum,
185-
[run the tests](#run-all-the-unit-tests).
172+
the last tag is in a releasable state! At a minimum, [run the tests](#run-all-the-unit-tests).
186173
187174
1. Create the commit for the release
188-
- Bump the version number in adherence to
189-
[Semantic Versioning](http://semver.org/) in `slack_cli_hooks/version.py`
190-
- Commit with a message including the new version number. For example `1.2.3`
191-
& Push the commit to a branch and create a PR to sanity check.
192-
- `git checkout -b 1.2.3-release`
193-
- `git commit -m 'chore(release): tag version 1.2.3'`
194-
- `git push {your-fork} 1.2.3-release`
195-
- Add relevant labels to the PR and add the PR to a GitHub Milestone.
196-
- Merge in release PR after getting an approval from at least one maintainer.
197-
2. Create a new GitHub Release from the
198-
[Releases page](https://github.com/slackapi/python-slack-hooks/releases) by
199-
clicking the "Draft a new release" button.
200-
3. Input the version manually into the "Choose a tag" input. You must use the
201-
same version found in `slack_cli_hooks/version.py`
202-
203-
- After you input the version, click the "Create a new tag: x.x.x on publish"
204-
button. This won't create your tag immediately.
205-
- Click the "Auto-generate release notes" button. This will pull in changes
206-
that will be included in your release.
207-
- Edit the resulting notes to ensure they have decent messaging that are
208-
understandable by non-contributors, but each commit should still have it's
209-
own line.
210-
- Ensure that this version adheres to
211-
[semantic versioning](http://semver.org/). See
212-
[Versioning](#versioning-and-tags) for correct version format.
213-
214-
4. Set the "Target" input to the "main" branch.
215-
5. Name the release title after the version tag. It should match the updated
216-
value from `slack_cli_hooks/version.py`!
217-
6. Make any adjustments to generated release notes to make sure they are
218-
accessible and approachable and that an end-user with little context about
219-
this project could still understand.
220-
7. Publish the release by clicking the "Publish release" button!
221-
8. After a few minutes, the corresponding version will be available on
222-
<https://pypi.org/project/slack-cli-hooks/>.
223-
9. Close the current GitHub Milestone and create one for the next minor version.
224-
10. (Slack Internal) Communicate the release internally
175+
1. Use the latest supported Python version. Using a [virtual environment](#python-and-friends) is recommended.
176+
2. In `slack_cli_hooks/version.py` bump the version number in adherence to [Semantic Versioning](http://semver.org/) and the [Versioning](#versioning-and-tags) section.
177+
3. Commit with a message including the new version number. For example `1.2.3` & push the commit to a branch and create a PR to sanity check.
178+
1. `git checkout -b 1.2.3-release`
179+
2. `git add --all` (review files with `git status` before committing)
180+
3. `git commit -m 'chore(release): version 1.2.3'`
181+
4. `git push -u origin 1.2.3-release`
182+
4. Add relevant labels to the PR and add the PR to a GitHub Milestone.
183+
5. Merge in release PR after getting an approval from at least one maintainer.
184+
2. Create a new GitHub Release
185+
1. Navigate to the [Releases page](https://github.com/slackapi/python-slack-hooks/releases).
186+
2. Click the "Draft a new release" button.
187+
3. Set the "Target" to the `main` branch.
188+
4. Click "Tag: Select tag"
189+
5. Input a new tag name manually. The tag name must match the version in `slack_cli_hooks/version.py` prefixed with "v" (e.g., if version is `1.2.3`, enter `v1.2.3`)
190+
6. Click the "Create a new tag" button. This won't create your tag immediately.
191+
7. Click the "Generate release notes" button.
192+
8. The release name should match the tag name!
193+
9. Edit the resulting notes to ensure they have decent messaging that is understandable by non-contributors, but each commit should still have its own line.
194+
10. Include a link to the current GitHub Milestone.
195+
11. Ensure the "latest release" checkbox is checked to mark this as the latest stable release.
196+
12. Publish the release by clicking the "Publish release" button!
197+
3. Navigate to the [release workflow run](https://github.com/slackapi/python-slack-hooks/actions/workflows/pypi-release.yml). You will need to approve the deployment!
198+
4. After a few minutes, the corresponding version will be available on <https://pypi.org/project/slack-cli-hooks>.
199+
5. Close the current GitHub Milestone and create one for the next patch version.
200+
6. (Slack Internal) Communicate the release internally
225201
- Include a link to the GitHub release
226-
11. (Slack Internal) Tweet by @SlackAPI
202+
7. (Slack Internal) Tweet by @SlackAPI
227203
- Not necessary for patch updates, might be needed for minor updates,
228204
definitely needed for major updates. Include a link to the GitHub release
229205

230206
## Workflow
231207

232208
### Versioning and Tags
233209

234-
This project uses semantic versioning, expressed through the numbering scheme of
210+
This project uses [Semantic Versioning](http://semver.org/), expressed through the numbering scheme of
235211
[PEP-0440](https://www.python.org/dev/peps/pep-0440/).
236212

237213
### Branches

.github/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
2+
changelog:
3+
categories:
4+
- title: 🚀 Enhancements
5+
labels:
6+
- enhancement
7+
- title: 🐛 Bug Fixes
8+
labels:
9+
- bug
10+
- title: 📚 Documentation
11+
labels:
12+
- docs
13+
- title: 🤖 Build
14+
labels:
15+
- build
16+
- title: 🧪 Testing/Code Health
17+
labels:
18+
- code health
19+
- title: 🔒 Security
20+
labels:
21+
- security
22+
- title: 📦 Other changes
23+
labels:
24+
- "*"

.github/workflows/codecov.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
permissions:
1414
contents: read
1515
steps:
16-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1717
with:
1818
persist-credentials: false
1919
- name: Set up Python
20-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
20+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2121
with:
22-
python-version: 3.13
22+
python-version: 3.14
2323
- name: Install dependencies
2424
run: |
2525
pip install -U pip
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
pytest --cov=./slack_cli_hooks/ --cov-report=xml
3131
- name: Upload coverage to Codecov
32-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
32+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
3333
with:
3434
token: ${{ secrets.CODECOV_TOKEN }}
3535
fail_ci_if_error: true
@@ -43,7 +43,7 @@ jobs:
4343
timeout-minutes: 5
4444
steps:
4545
- name: Setup repo
46-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4747
with:
4848
persist-credentials: false
4949
- name: Report health score

.github/workflows/flake8.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,16 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 2
13-
strategy:
14-
matrix:
15-
python-version: ["3.13"]
1613
permissions:
1714
contents: read
1815
steps:
19-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2017
with:
2118
persist-credentials: false
22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
19+
- name: Set up Python
20+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2421
with:
25-
python-version: ${{ matrix.python-version }}
22+
python-version: 3.14
2623
- name: Run flake8 verification
2724
run: |
2825
./scripts/lint.sh

0 commit comments

Comments
 (0)